class OrderCloud::LineItemApi
Attributes
Public Class Methods
# File lib/order_cloud/api/line_item_api.rb, line 30 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
@param direction Direction of the line item. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param line_item @param [Hash] opts the optional parameters @return [LineItem]
# File lib/order_cloud/api/line_item_api.rb, line 41 def create(direction, order_id, line_item, opts = {}) data, _status_code, _headers = create_with_http_info(direction, order_id, line_item, opts) return data end
@param direction Direction of the line item. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param line_item @param [Hash] opts the optional parameters @return [Array<(LineItem
, Fixnum, Hash)>] LineItem
data, response status code and response headers
# File lib/order_cloud/api/line_item_api.rb, line 53 def create_with_http_info(direction, order_id, line_item, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: LineItemApi.create ..." end # verify the required parameter 'direction' is set fail ArgumentError, "Missing the required parameter 'direction' when calling LineItemApi.create" if direction.nil? # verify the required parameter 'order_id' is set fail ArgumentError, "Missing the required parameter 'order_id' when calling LineItemApi.create" if order_id.nil? # verify the required parameter 'line_item' is set fail ArgumentError, "Missing the required parameter 'line_item' when calling LineItemApi.create" if line_item.nil? # resource path local_var_path = "/orders/{direction}/{orderID}/lineitems".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(line_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 => 'LineItem') if @api_client.config.debugging @api_client.config.logger.debug "API called: LineItemApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
@param direction Direction of the line item. Possible values: Incoming, Outgoing. @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/line_item_api.rb, line 106 def delete(direction, order_id, line_item_id, opts = {}) delete_with_http_info(direction, order_id, line_item_id, opts) return nil end
@param direction Direction of the line item. Possible values: Incoming, Outgoing. @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/line_item_api.rb, line 118 def delete_with_http_info(direction, order_id, line_item_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: LineItemApi.delete ..." end # verify the required parameter 'direction' is set fail ArgumentError, "Missing the required parameter 'direction' when calling LineItemApi.delete" if direction.nil? # verify the required parameter 'order_id' is set fail ArgumentError, "Missing the required parameter 'order_id' when calling LineItemApi.delete" if order_id.nil? # verify the required parameter 'line_item_id' is set fail ArgumentError, "Missing the required parameter 'line_item_id' when calling LineItemApi.delete" if line_item_id.nil? # resource path local_var_path = "/orders/{direction}/{orderID}/lineitems/{lineItemID}".sub('{format}','json').sub('{' + 'direction' + '}', direction.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: LineItemApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
@param direction Direction of the line item. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param line_item_id ID of the line item. @param [Hash] opts the optional parameters @return [LineItem]
# File lib/order_cloud/api/line_item_api.rb, line 170 def get(direction, order_id, line_item_id, opts = {}) data, _status_code, _headers = get_with_http_info(direction, order_id, line_item_id, opts) return data end
@param direction Direction of the line item. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param line_item_id ID of the line item. @param [Hash] opts the optional parameters @return [Array<(LineItem
, Fixnum, Hash)>] LineItem
data, response status code and response headers
# File lib/order_cloud/api/line_item_api.rb, line 182 def get_with_http_info(direction, order_id, line_item_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: LineItemApi.get ..." end # verify the required parameter 'direction' is set fail ArgumentError, "Missing the required parameter 'direction' when calling LineItemApi.get" if direction.nil? # verify the required parameter 'order_id' is set fail ArgumentError, "Missing the required parameter 'order_id' when calling LineItemApi.get" if order_id.nil? # verify the required parameter 'line_item_id' is set fail ArgumentError, "Missing the required parameter 'line_item_id' when calling LineItemApi.get" if line_item_id.nil? # resource path local_var_path = "/orders/{direction}/{orderID}/lineitems/{lineItemID}".sub('{format}','json').sub('{' + 'direction' + '}', direction.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 => 'LineItem') if @api_client.config.debugging @api_client.config.logger.debug "API called: LineItemApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
@param direction Direction of the line item. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param [Hash] opts the optional parameters @option opts [String] :search Search of the line item. @option opts [Array<String>] :search_on Search on of the line item. @option opts [Array<String>] :sort_by Sort by of the line item. @option opts [Integer] :page Page of the line item. @option opts [Integer] :page_size Page size of the line item. @option opts [Hash<String, String>] :filters Filters of the line item. @return [ListLineItem]
# File lib/order_cloud/api/line_item_api.rb, line 240 def list(direction, order_id, opts = {}) data, _status_code, _headers = list_with_http_info(direction, order_id, opts) return data end
@param direction Direction of the line item. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param [Hash] opts the optional parameters @option opts [String] :search Search of the line item. @option opts [Array<String>] :search_on Search on of the line item. @option opts [Array<String>] :sort_by Sort by of the line item. @option opts [Integer] :page Page of the line item. @option opts [Integer] :page_size Page size of the line item. @option opts [Hash<String, String>] :filters Filters of the line item. @return [Array<(ListLineItem
, Fixnum, Hash)>] ListLineItem
data, response status code and response headers
# File lib/order_cloud/api/line_item_api.rb, line 257 def list_with_http_info(direction, order_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: LineItemApi.list ..." end # verify the required parameter 'direction' is set fail ArgumentError, "Missing the required parameter 'direction' when calling LineItemApi.list" if direction.nil? # verify the required parameter 'order_id' is set fail ArgumentError, "Missing the required parameter 'order_id' when calling LineItemApi.list" if order_id.nil? # resource path local_var_path = "/orders/{direction}/{orderID}/lineitems".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 => 'ListLineItem') if @api_client.config.debugging @api_client.config.logger.debug "API called: LineItemApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
@param direction Direction of the line item. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param line_item_id ID of the line item. @param partial_line_item @param [Hash] opts the optional parameters @return [LineItem]
# File lib/order_cloud/api/line_item_api.rb, line 315 def patch(direction, order_id, line_item_id, partial_line_item, opts = {}) data, _status_code, _headers = patch_with_http_info(direction, order_id, line_item_id, partial_line_item, opts) return data end
@param direction Direction of the line item. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param line_item_id ID of the line item. @param partial_address @param [Hash] opts the optional parameters @return [LineItem]
# File lib/order_cloud/api/line_item_api.rb, line 384 def patch_shipping_address(direction, order_id, line_item_id, partial_address, opts = {}) data, _status_code, _headers = patch_shipping_address_with_http_info(direction, order_id, line_item_id, partial_address, opts) return data end
@param direction Direction of the line item. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param line_item_id ID of the line item. @param partial_address @param [Hash] opts the optional parameters @return [Array<(LineItem
, Fixnum, Hash)>] LineItem
data, response status code and response headers
# File lib/order_cloud/api/line_item_api.rb, line 397 def patch_shipping_address_with_http_info(direction, order_id, line_item_id, partial_address, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: LineItemApi.patch_shipping_address ..." end # verify the required parameter 'direction' is set fail ArgumentError, "Missing the required parameter 'direction' when calling LineItemApi.patch_shipping_address" if direction.nil? # verify the required parameter 'order_id' is set fail ArgumentError, "Missing the required parameter 'order_id' when calling LineItemApi.patch_shipping_address" if order_id.nil? # verify the required parameter 'line_item_id' is set fail ArgumentError, "Missing the required parameter 'line_item_id' when calling LineItemApi.patch_shipping_address" if line_item_id.nil? # verify the required parameter 'partial_address' is set fail ArgumentError, "Missing the required parameter 'partial_address' when calling LineItemApi.patch_shipping_address" if partial_address.nil? # resource path local_var_path = "/orders/{direction}/{orderID}/lineitems/{lineItemID}/shipto".sub('{format}','json').sub('{' + 'direction' + '}', direction.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 = @api_client.object_to_http_body(partial_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 => 'LineItem') if @api_client.config.debugging @api_client.config.logger.debug "API called: LineItemApi#patch_shipping_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
@param direction Direction of the line item. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param line_item_id ID of the line item. @param partial_line_item @param [Hash] opts the optional parameters @return [Array<(LineItem
, Fixnum, Hash)>] LineItem
data, response status code and response headers
# File lib/order_cloud/api/line_item_api.rb, line 328 def patch_with_http_info(direction, order_id, line_item_id, partial_line_item, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: LineItemApi.patch ..." end # verify the required parameter 'direction' is set fail ArgumentError, "Missing the required parameter 'direction' when calling LineItemApi.patch" if direction.nil? # verify the required parameter 'order_id' is set fail ArgumentError, "Missing the required parameter 'order_id' when calling LineItemApi.patch" if order_id.nil? # verify the required parameter 'line_item_id' is set fail ArgumentError, "Missing the required parameter 'line_item_id' when calling LineItemApi.patch" if line_item_id.nil? # verify the required parameter 'partial_line_item' is set fail ArgumentError, "Missing the required parameter 'partial_line_item' when calling LineItemApi.patch" if partial_line_item.nil? # resource path local_var_path = "/orders/{direction}/{orderID}/lineitems/{lineItemID}".sub('{format}','json').sub('{' + 'direction' + '}', direction.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 = @api_client.object_to_http_body(partial_line_item) 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 => 'LineItem') if @api_client.config.debugging @api_client.config.logger.debug "API called: LineItemApi#patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
@param direction Direction of the line item. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param line_item_id ID of the line item. @param address @param [Hash] opts the optional parameters @return [LineItem]
# File lib/order_cloud/api/line_item_api.rb, line 453 def set_shipping_address(direction, order_id, line_item_id, address, opts = {}) data, _status_code, _headers = set_shipping_address_with_http_info(direction, order_id, line_item_id, address, opts) return data end
@param direction Direction of the line item. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param line_item_id ID of the line item. @param address @param [Hash] opts the optional parameters @return [Array<(LineItem
, Fixnum, Hash)>] LineItem
data, response status code and response headers
# File lib/order_cloud/api/line_item_api.rb, line 466 def set_shipping_address_with_http_info(direction, order_id, line_item_id, address, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: LineItemApi.set_shipping_address ..." end # verify the required parameter 'direction' is set fail ArgumentError, "Missing the required parameter 'direction' when calling LineItemApi.set_shipping_address" if direction.nil? # verify the required parameter 'order_id' is set fail ArgumentError, "Missing the required parameter 'order_id' when calling LineItemApi.set_shipping_address" if order_id.nil? # verify the required parameter 'line_item_id' is set fail ArgumentError, "Missing the required parameter 'line_item_id' when calling LineItemApi.set_shipping_address" if line_item_id.nil? # verify the required parameter 'address' is set fail ArgumentError, "Missing the required parameter 'address' when calling LineItemApi.set_shipping_address" if address.nil? # resource path local_var_path = "/orders/{direction}/{orderID}/lineitems/{lineItemID}/shipto".sub('{format}','json').sub('{' + 'direction' + '}', direction.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 = @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 => 'LineItem') if @api_client.config.debugging @api_client.config.logger.debug "API called: LineItemApi#set_shipping_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
@param direction Direction of the line item. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param line_item_id ID of the line item. @param line_item @param [Hash] opts the optional parameters @return [LineItem]
# File lib/order_cloud/api/line_item_api.rb, line 522 def update(direction, order_id, line_item_id, line_item, opts = {}) data, _status_code, _headers = update_with_http_info(direction, order_id, line_item_id, line_item, opts) return data end
@param direction Direction of the line item. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param line_item_id ID of the line item. @param line_item @param [Hash] opts the optional parameters @return [Array<(LineItem
, Fixnum, Hash)>] LineItem
data, response status code and response headers
# File lib/order_cloud/api/line_item_api.rb, line 535 def update_with_http_info(direction, order_id, line_item_id, line_item, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: LineItemApi.update ..." end # verify the required parameter 'direction' is set fail ArgumentError, "Missing the required parameter 'direction' when calling LineItemApi.update" if direction.nil? # verify the required parameter 'order_id' is set fail ArgumentError, "Missing the required parameter 'order_id' when calling LineItemApi.update" if order_id.nil? # verify the required parameter 'line_item_id' is set fail ArgumentError, "Missing the required parameter 'line_item_id' when calling LineItemApi.update" if line_item_id.nil? # verify the required parameter 'line_item' is set fail ArgumentError, "Missing the required parameter 'line_item' when calling LineItemApi.update" if line_item.nil? # resource path local_var_path = "/orders/{direction}/{orderID}/lineitems/{lineItemID}".sub('{format}','json').sub('{' + 'direction' + '}', direction.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 = @api_client.object_to_http_body(line_item) 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 => 'LineItem') if @api_client.config.debugging @api_client.config.logger.debug "API called: LineItemApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end