=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 # Delete a ship to preference record for the channel partner. # Delete a ship to preference record for the channel partner. # @param channel_partner_oid # @param channel_partner_ship_to_preference_oid # @param [Hash] opts the optional parameters # @return [nil] def delete_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid, opts = {}) delete_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, opts) nil end # Delete a ship to preference record for the channel partner. # Delete a ship to preference record for the channel partner. # @param channel_partner_oid # @param channel_partner_ship_to_preference_oid # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.delete_channel_partner_ship_to_preference ...' end # verify the required parameter 'channel_partner_oid' is set if @api_client.config.client_side_validation && channel_partner_oid.nil? fail ArgumentError, "Missing the required parameter 'channel_partner_oid' when calling ChannelPartnerApi.delete_channel_partner_ship_to_preference" end # verify the required parameter 'channel_partner_ship_to_preference_oid' is set if @api_client.config.client_side_validation && channel_partner_ship_to_preference_oid.nil? fail ArgumentError, "Missing the required parameter 'channel_partner_ship_to_preference_oid' when calling ChannelPartnerApi.delete_channel_partner_ship_to_preference" end # resource path local_var_path = '/channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences/{channel_partner_ship_to_preference_oid}'.sub('{' + 'channel_partner_oid' + '}', channel_partner_oid.to_s).sub('{' + 'channel_partner_ship_to_preference_oid' + '}', channel_partner_ship_to_preference_oid.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) if @api_client.config.debugging @api_client.config.logger.debug "API called: ChannelPartnerApi#delete_channel_partner_ship_to_preference\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 # Estimate tax for channel partner order # Estimate tax for order from a channel partner. # @param channel_partner_order Order needing tax estimate # @param [Hash] opts the optional parameters # @return [ChannelPartnerEstimateTaxResponse] def estimate_tax_for_channel_partner_order(channel_partner_order, opts = {}) data, _status_code, _headers = estimate_tax_for_channel_partner_order_with_http_info(channel_partner_order, opts) data end # Estimate tax for channel partner order # Estimate tax for order from a channel partner. # @param channel_partner_order Order needing tax estimate # @param [Hash] opts the optional parameters # @return [Array<(ChannelPartnerEstimateTaxResponse, Fixnum, Hash)>] ChannelPartnerEstimateTaxResponse data, response status code and response headers def estimate_tax_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_tax_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_tax_for_channel_partner_order" end # resource path local_var_path = '/channel_partner/estimate_tax' # 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 => 'ChannelPartnerEstimateTaxResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ChannelPartnerApi#estimate_tax_for_channel_partner_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve the ship to preference associated with the channel partner and the specific id. # Retrieve the ship to preference associated with the channel partner and the specific id. # @param channel_partner_oid # @param channel_partner_ship_to_preference_oid # @param [Hash] opts the optional parameters # @return [ChannelPartnerShipToPreferenceResponse] def get_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid, opts = {}) data, _status_code, _headers = get_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, opts) data end # Retrieve the ship to preference associated with the channel partner and the specific id. # Retrieve the ship to preference associated with the channel partner and the specific id. # @param channel_partner_oid # @param channel_partner_ship_to_preference_oid # @param [Hash] opts the optional parameters # @return [Array<(ChannelPartnerShipToPreferenceResponse, Fixnum, Hash)>] ChannelPartnerShipToPreferenceResponse data, response status code and response headers def get_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.get_channel_partner_ship_to_preference ...' end # verify the required parameter 'channel_partner_oid' is set if @api_client.config.client_side_validation && channel_partner_oid.nil? fail ArgumentError, "Missing the required parameter 'channel_partner_oid' when calling ChannelPartnerApi.get_channel_partner_ship_to_preference" end # verify the required parameter 'channel_partner_ship_to_preference_oid' is set if @api_client.config.client_side_validation && channel_partner_ship_to_preference_oid.nil? fail ArgumentError, "Missing the required parameter 'channel_partner_ship_to_preference_oid' when calling ChannelPartnerApi.get_channel_partner_ship_to_preference" end # resource path local_var_path = '/channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences/{channel_partner_ship_to_preference_oid}'.sub('{' + 'channel_partner_oid' + '}', channel_partner_oid.to_s).sub('{' + 'channel_partner_ship_to_preference_oid' + '}', channel_partner_ship_to_preference_oid.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(: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 => 'ChannelPartnerShipToPreferenceResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ChannelPartnerApi#get_channel_partner_ship_to_preference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve the ship to preferences associated with the channel partner. # Retrieve the ship to preferences associated with the channel partner. # @param channel_partner_oid # @param [Hash] opts the optional parameters # @return [ChannelPartnerShipToPreferencesResponse] def get_channel_partner_ship_to_preferences(channel_partner_oid, opts = {}) data, _status_code, _headers = get_channel_partner_ship_to_preferences_with_http_info(channel_partner_oid, opts) data end # Retrieve the ship to preferences associated with the channel partner. # Retrieve the ship to preferences associated with the channel partner. # @param channel_partner_oid # @param [Hash] opts the optional parameters # @return [Array<(ChannelPartnerShipToPreferencesResponse, Fixnum, Hash)>] ChannelPartnerShipToPreferencesResponse data, response status code and response headers def get_channel_partner_ship_to_preferences_with_http_info(channel_partner_oid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.get_channel_partner_ship_to_preferences ...' end # verify the required parameter 'channel_partner_oid' is set if @api_client.config.client_side_validation && channel_partner_oid.nil? fail ArgumentError, "Missing the required parameter 'channel_partner_oid' when calling ChannelPartnerApi.get_channel_partner_ship_to_preferences" end # resource path local_var_path = '/channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences'.sub('{' + 'channel_partner_oid' + '}', channel_partner_oid.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(: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 => 'ChannelPartnerShipToPreferencesResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ChannelPartnerApi#get_channel_partner_ship_to_preferences\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve the channel partners configured on the account. # Retrieve the channel partners configured on the account. # @param [Hash] opts the optional parameters # @return [ChannelPartnersResponse] def get_channel_partners(opts = {}) data, _status_code, _headers = get_channel_partners_with_http_info(opts) data end # Retrieve the channel partners configured on the account. # Retrieve the channel partners configured on the account. # @param [Hash] opts the optional parameters # @return [Array<(ChannelPartnersResponse, Fixnum, Hash)>] ChannelPartnersResponse data, response status code and response headers def get_channel_partners_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.get_channel_partners ...' end # resource path local_var_path = '/channel_partner/channel_partners' # 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(: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 => 'ChannelPartnersResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ChannelPartnerApi#get_channel_partners\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 # Insert a ship to preference record for the channel partner. # Insert a ship to preference record for the channel partner. # @param channel_partner_oid # @param ship_to_preference Ship to preference to create # @param [Hash] opts the optional parameters # @return [ChannelPartnerShipToPreferenceResponse] def insert_channel_partner_ship_to_preference(channel_partner_oid, ship_to_preference, opts = {}) data, _status_code, _headers = insert_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, ship_to_preference, opts) data end # Insert a ship to preference record for the channel partner. # Insert a ship to preference record for the channel partner. # @param channel_partner_oid # @param ship_to_preference Ship to preference to create # @param [Hash] opts the optional parameters # @return [Array<(ChannelPartnerShipToPreferenceResponse, Fixnum, Hash)>] ChannelPartnerShipToPreferenceResponse data, response status code and response headers def insert_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, ship_to_preference, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.insert_channel_partner_ship_to_preference ...' end # verify the required parameter 'channel_partner_oid' is set if @api_client.config.client_side_validation && channel_partner_oid.nil? fail ArgumentError, "Missing the required parameter 'channel_partner_oid' when calling ChannelPartnerApi.insert_channel_partner_ship_to_preference" end # verify the required parameter 'ship_to_preference' is set if @api_client.config.client_side_validation && ship_to_preference.nil? fail ArgumentError, "Missing the required parameter 'ship_to_preference' when calling ChannelPartnerApi.insert_channel_partner_ship_to_preference" end # resource path local_var_path = '/channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences'.sub('{' + 'channel_partner_oid' + '}', channel_partner_oid.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 = @api_client.object_to_http_body(ship_to_preference) 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 => 'ChannelPartnerShipToPreferenceResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ChannelPartnerApi#insert_channel_partner_ship_to_preference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a ship to preference record for the channel partner. # Update a ship to preference record for the channel partner. # @param channel_partner_oid # @param channel_partner_ship_to_preference_oid # @param ship_to_preference Ship to preference to create # @param [Hash] opts the optional parameters # @return [ChannelPartnerShipToPreferenceResponse] def update_channel_partner_ship_to_preference(channel_partner_oid, channel_partner_ship_to_preference_oid, ship_to_preference, opts = {}) data, _status_code, _headers = update_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, ship_to_preference, opts) data end # Update a ship to preference record for the channel partner. # Update a ship to preference record for the channel partner. # @param channel_partner_oid # @param channel_partner_ship_to_preference_oid # @param ship_to_preference Ship to preference to create # @param [Hash] opts the optional parameters # @return [Array<(ChannelPartnerShipToPreferenceResponse, Fixnum, Hash)>] ChannelPartnerShipToPreferenceResponse data, response status code and response headers def update_channel_partner_ship_to_preference_with_http_info(channel_partner_oid, channel_partner_ship_to_preference_oid, ship_to_preference, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ChannelPartnerApi.update_channel_partner_ship_to_preference ...' end # verify the required parameter 'channel_partner_oid' is set if @api_client.config.client_side_validation && channel_partner_oid.nil? fail ArgumentError, "Missing the required parameter 'channel_partner_oid' when calling ChannelPartnerApi.update_channel_partner_ship_to_preference" end # verify the required parameter 'channel_partner_ship_to_preference_oid' is set if @api_client.config.client_side_validation && channel_partner_ship_to_preference_oid.nil? fail ArgumentError, "Missing the required parameter 'channel_partner_ship_to_preference_oid' when calling ChannelPartnerApi.update_channel_partner_ship_to_preference" end # verify the required parameter 'ship_to_preference' is set if @api_client.config.client_side_validation && ship_to_preference.nil? fail ArgumentError, "Missing the required parameter 'ship_to_preference' when calling ChannelPartnerApi.update_channel_partner_ship_to_preference" end # resource path local_var_path = '/channel_partner/channel_partners/{channel_partner_oid}/ship_to_preferences/{channel_partner_ship_to_preference_oid}'.sub('{' + 'channel_partner_oid' + '}', channel_partner_oid.to_s).sub('{' + 'channel_partner_ship_to_preference_oid' + '}', channel_partner_ship_to_preference_oid.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 = @api_client.object_to_http_body(ship_to_preference) auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey'] 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 => 'ChannelPartnerShipToPreferenceResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ChannelPartnerApi#update_channel_partner_ship_to_preference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end