=begin #UltraCart Rest API V2 #UltraCart REST API Version 2 OpenAPI spec version: 2.0.0 Contact: support@ultracart.com Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.15-SNAPSHOT =end require 'addressable/uri' module UltracartClient class ChannelPartnerApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end def self.new_using_api_key(simple_key, verify_ssl = true, debugging = false) api_config = Configuration.new api_config.api_key_prefix['x-ultracart-simple-key'] = simple_key api_config.api_version = '2017-03-01' api_config.verify_ssl = verify_ssl api_client = ApiClient.new(api_config) api_client.config.debugging = debugging UltracartClient::ChannelPartnerApi.new(api_client) end # Cancel channel partner order by channel partner order id # Cancel channel partner order by channel partner order id # @param order_id The channel partner order id to delete. # @param [Hash] opts the optional parameters # @return [ChannelPartnerCancelResponse] def cancel_order_by_channel_partner_order_id(order_id, opts = {}) data, _status_code, _headers = cancel_order_by_channel_partner_order_id_with_http_info(order_id, opts) data end # Cancel channel partner order by channel partner order id # Cancel channel partner order by channel partner order id # @param order_id The channel partner order id to delete. # @param [Hash] opts the optional parameters # @return [Array<(ChannelPartnerCancelResponse, Fixnum, Hash)>] ChannelPartnerCancelResponse data, response status code and response headers def cancel_order_by_channel_partner_order_id_with_http_info(order_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.cancel_order_by_channel_partner_order_id ...' end # verify the required parameter 'order_id' is set if @api_client.config.client_side_validation && order_id.nil? fail ArgumentError, "Missing the required parameter 'order_id' when calling ChannelPartnerApi.cancel_order_by_channel_partner_order_id" end # resource path local_var_path = '/channel_partner/cancel/by_channel_partner_order_id/{order_id}'.sub('{' + 'order_id' + '}', order_id.to_s) # query parameters query_params = {} # header parameters header_params = {} header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version() # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey'] 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 => 'ChannelPartnerCancelResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ChannelPartnerApi#cancel_order_by_channel_partner_order_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Cancel channel partner order by UltraCart order id # Cancel channel partner order by UltraCart order id # @param order_id The UltraCart order id to delete. # @param [Hash] opts the optional parameters # @return [ChannelPartnerCancelResponse] def cancel_order_by_ultra_cart_order_id(order_id, opts = {}) data, _status_code, _headers = cancel_order_by_ultra_cart_order_id_with_http_info(order_id, opts) data end # Cancel channel partner order by UltraCart order id # Cancel channel partner order by UltraCart order id # @param order_id The UltraCart order id to delete. # @param [Hash] opts the optional parameters # @return [Array<(ChannelPartnerCancelResponse, Fixnum, Hash)>] ChannelPartnerCancelResponse data, response status code and response headers def cancel_order_by_ultra_cart_order_id_with_http_info(order_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.cancel_order_by_ultra_cart_order_id ...' end # verify the required parameter 'order_id' is set if @api_client.config.client_side_validation && order_id.nil? fail ArgumentError, "Missing the required parameter 'order_id' when calling ChannelPartnerApi.cancel_order_by_ultra_cart_order_id" end # resource path local_var_path = '/channel_partner/cancel/by_ultracart_order_id/{order_id}'.sub('{' + 'order_id' + '}', order_id.to_s) # query parameters query_params = {} # header parameters header_params = {} header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version() # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey'] 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 => 'ChannelPartnerCancelResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ChannelPartnerApi#cancel_order_by_ultra_cart_order_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Estimate shipping for channel partner order # Estimate shipping for order from a channel partner. # @param channel_partner_order Order needing shipping estimate # @param [Hash] opts the optional parameters # @return [ChannelPartnerEstimateShippingResponse] def estimate_shipping_for_channel_partner_order(channel_partner_order, opts = {}) data, _status_code, _headers = estimate_shipping_for_channel_partner_order_with_http_info(channel_partner_order, opts) data end # Estimate shipping for channel partner order # Estimate shipping for order from a channel partner. # @param channel_partner_order Order needing shipping estimate # @param [Hash] opts the optional parameters # @return [Array<(ChannelPartnerEstimateShippingResponse, Fixnum, Hash)>] ChannelPartnerEstimateShippingResponse data, response status code and response headers def estimate_shipping_for_channel_partner_order_with_http_info(channel_partner_order, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.estimate_shipping_for_channel_partner_order ...' end # verify the required parameter 'channel_partner_order' is set if @api_client.config.client_side_validation && channel_partner_order.nil? fail ArgumentError, "Missing the required parameter 'channel_partner_order' when calling ChannelPartnerApi.estimate_shipping_for_channel_partner_order" end # resource path local_var_path = '/channel_partner/estimate_shipping' # query parameters query_params = {} # header parameters header_params = {} header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version() # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(channel_partner_order) auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey'] 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 => 'ChannelPartnerEstimateShippingResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ChannelPartnerApi#estimate_shipping_for_channel_partner_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Insert channel partner order # Insert order from a channel partner. # @param channel_partner_order Order to insert # @param [Hash] opts the optional parameters # @return [ChannelPartnerImportResponse] def import_channel_partner_order(channel_partner_order, opts = {}) data, _status_code, _headers = import_channel_partner_order_with_http_info(channel_partner_order, opts) data end # Insert channel partner order # Insert order from a channel partner. # @param channel_partner_order Order to insert # @param [Hash] opts the optional parameters # @return [Array<(ChannelPartnerImportResponse, Fixnum, Hash)>] ChannelPartnerImportResponse data, response status code and response headers def import_channel_partner_order_with_http_info(channel_partner_order, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.import_channel_partner_order ...' end # verify the required parameter 'channel_partner_order' is set if @api_client.config.client_side_validation && channel_partner_order.nil? fail ArgumentError, "Missing the required parameter 'channel_partner_order' when calling ChannelPartnerApi.import_channel_partner_order" end # resource path local_var_path = '/channel_partner/import' # query parameters query_params = {} # header parameters header_params = {} header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version() # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(channel_partner_order) auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey'] 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 => 'ChannelPartnerImportResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ChannelPartnerApi#import_channel_partner_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end