=begin #UltraCart Rest API V2 #UltraCart REST API Version 2 The version of the OpenAPI document: 2.0.0 Contact: support@ultracart.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.1-SNAPSHOT =end require 'cgi' module UltracartClient class CustomerApi 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::CustomerApi.new(api_client) end # Adds store credit to a customer # Adds store credit to a customer # @param customer_profile_oid [Integer] The customer oid to credit. # @param store_credit_request [CustomerStoreCreditAddRequest] Store credit to add # @param [Hash] opts the optional parameters # @return [BaseResponse] def add_customer_store_credit(customer_profile_oid, store_credit_request, opts = {}) data, _status_code, _headers = add_customer_store_credit_with_http_info(customer_profile_oid, store_credit_request, opts) data end # Adds store credit to a customer # Adds store credit to a customer # @param customer_profile_oid [Integer] The customer oid to credit. # @param store_credit_request [CustomerStoreCreditAddRequest] Store credit to add # @param [Hash] opts the optional parameters # @return [Array<(BaseResponse, Integer, Hash)>] BaseResponse data, response status code and response headers def add_customer_store_credit_with_http_info(customer_profile_oid, store_credit_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.add_customer_store_credit ...' end # verify the required parameter 'customer_profile_oid' is set if @api_client.config.client_side_validation && customer_profile_oid.nil? fail ArgumentError, "Missing the required parameter 'customer_profile_oid' when calling CustomerApi.add_customer_store_credit" end # verify the required parameter 'store_credit_request' is set if @api_client.config.client_side_validation && store_credit_request.nil? fail ArgumentError, "Missing the required parameter 'store_credit_request' when calling CustomerApi.add_customer_store_credit" end # resource path local_var_path = '/customer/customers/{customer_profile_oid}/store_credit'.sub('{' + 'customer_profile_oid' + '}', CGI.escape(customer_profile_oid.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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' content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(store_credit_request) # return_type return_type = opts[:debug_return_type] || 'BaseResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey'] new_options = opts.merge( :operation => :"CustomerApi.add_customer_store_credit", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#add_customer_store_credit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates the cashback balance for a customer by updating the internal gift certificate used, creating the gift certificate if needed. # Updates the cashback balance for a customer by updating the internal gift certificate used, creating the gift certificate if needed. # @param customer_profile_oid [Integer] The customer profile oid # @param adjust_internal_certificate_request [AdjustInternalCertificateRequest] adjustInternalCertificateRequest # @param [Hash] opts the optional parameters # @return [AdjustInternalCertificateResponse] def adjust_internal_certificate(customer_profile_oid, adjust_internal_certificate_request, opts = {}) data, _status_code, _headers = adjust_internal_certificate_with_http_info(customer_profile_oid, adjust_internal_certificate_request, opts) data end # Updates the cashback balance for a customer by updating the internal gift certificate used, creating the gift certificate if needed. # Updates the cashback balance for a customer by updating the internal gift certificate used, creating the gift certificate if needed. # @param customer_profile_oid [Integer] The customer profile oid # @param adjust_internal_certificate_request [AdjustInternalCertificateRequest] adjustInternalCertificateRequest # @param [Hash] opts the optional parameters # @return [Array<(AdjustInternalCertificateResponse, Integer, Hash)>] AdjustInternalCertificateResponse data, response status code and response headers def adjust_internal_certificate_with_http_info(customer_profile_oid, adjust_internal_certificate_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.adjust_internal_certificate ...' end # verify the required parameter 'customer_profile_oid' is set if @api_client.config.client_side_validation && customer_profile_oid.nil? fail ArgumentError, "Missing the required parameter 'customer_profile_oid' when calling CustomerApi.adjust_internal_certificate" end # verify the required parameter 'adjust_internal_certificate_request' is set if @api_client.config.client_side_validation && adjust_internal_certificate_request.nil? fail ArgumentError, "Missing the required parameter 'adjust_internal_certificate_request' when calling CustomerApi.adjust_internal_certificate" end # resource path local_var_path = '/customer/customers/{customer_profile_oid}/adjust_cashback_balance'.sub('{' + 'customer_profile_oid' + '}', CGI.escape(customer_profile_oid.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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' content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(adjust_internal_certificate_request) # return_type return_type = opts[:debug_return_type] || 'AdjustInternalCertificateResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey'] new_options = opts.merge( :operation => :"CustomerApi.adjust_internal_certificate", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#adjust_internal_certificate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a customer # Delete a customer on the UltraCart account. # @param customer_profile_oid [Integer] The customer_profile_oid to delete. # @param [Hash] opts the optional parameters # @return [nil] def delete_customer(customer_profile_oid, opts = {}) delete_customer_with_http_info(customer_profile_oid, opts) nil end # Delete a customer # Delete a customer on the UltraCart account. # @param customer_profile_oid [Integer] The customer_profile_oid to delete. # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_customer_with_http_info(customer_profile_oid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.delete_customer ...' end # verify the required parameter 'customer_profile_oid' is set if @api_client.config.client_side_validation && customer_profile_oid.nil? fail ArgumentError, "Missing the required parameter 'customer_profile_oid' when calling CustomerApi.delete_customer" end # resource path local_var_path = '/customer/customers/{customer_profile_oid}'.sub('{' + 'customer_profile_oid' + '}', CGI.escape(customer_profile_oid.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey'] new_options = opts.merge( :operation => :"CustomerApi.delete_customer", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#delete_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve a customer # Retrieves a single customer using the specified customer profile oid. # @param customer_profile_oid [Integer] The customer oid to retrieve. # @param [Hash] opts the optional parameters # @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples # @return [CustomerResponse] def get_customer(customer_profile_oid, opts = {}) data, _status_code, _headers = get_customer_with_http_info(customer_profile_oid, opts) data end # Retrieve a customer # Retrieves a single customer using the specified customer profile oid. # @param customer_profile_oid [Integer] The customer oid to retrieve. # @param [Hash] opts the optional parameters # @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples # @return [Array<(CustomerResponse, Integer, Hash)>] CustomerResponse data, response status code and response headers def get_customer_with_http_info(customer_profile_oid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.get_customer ...' end # verify the required parameter 'customer_profile_oid' is set if @api_client.config.client_side_validation && customer_profile_oid.nil? fail ArgumentError, "Missing the required parameter 'customer_profile_oid' when calling CustomerApi.get_customer" end # resource path local_var_path = '/customer/customers/{customer_profile_oid}'.sub('{' + 'customer_profile_oid' + '}', CGI.escape(customer_profile_oid.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil? # header parameters header_params = opts[: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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CustomerResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey'] new_options = opts.merge( :operation => :"CustomerApi.get_customer", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#get_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve a customer by Email # Retrieves a single customer using the specified customer email address. # @param email [String] The email address of the customer to retrieve. # @param [Hash] opts the optional parameters # @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples # @return [CustomerResponse] def get_customer_by_email(email, opts = {}) data, _status_code, _headers = get_customer_by_email_with_http_info(email, opts) data end # Retrieve a customer by Email # Retrieves a single customer using the specified customer email address. # @param email [String] The email address of the customer to retrieve. # @param [Hash] opts the optional parameters # @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples # @return [Array<(CustomerResponse, Integer, Hash)>] CustomerResponse data, response status code and response headers def get_customer_by_email_with_http_info(email, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.get_customer_by_email ...' end # verify the required parameter 'email' is set if @api_client.config.client_side_validation && email.nil? fail ArgumentError, "Missing the required parameter 'email' when calling CustomerApi.get_customer_by_email" end # resource path local_var_path = '/customer/customers/by_email/{email}'.sub('{' + 'email' + '}', CGI.escape(email.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil? # header parameters header_params = opts[: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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CustomerResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey'] new_options = opts.merge( :operation => :"CustomerApi.get_customer_by_email", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#get_customer_by_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve values needed for a customer profile editor # Retrieve values needed for a customer profile editor. # @param [Hash] opts the optional parameters # @return [CustomerEditorValues] def get_customer_editor_values(opts = {}) data, _status_code, _headers = get_customer_editor_values_with_http_info(opts) data end # Retrieve values needed for a customer profile editor # Retrieve values needed for a customer profile editor. # @param [Hash] opts the optional parameters # @return [Array<(CustomerEditorValues, Integer, Hash)>] CustomerEditorValues data, response status code and response headers def get_customer_editor_values_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.get_customer_editor_values ...' end # resource path local_var_path = '/customer/editor_values' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CustomerEditorValues' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey'] new_options = opts.merge( :operation => :"CustomerApi.get_customer_editor_values", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#get_customer_editor_values\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve all email lists across all storefronts # Retrieve all email lists across all storefronts # @param [Hash] opts the optional parameters # @return [EmailListsResponse] def get_customer_email_lists(opts = {}) data, _status_code, _headers = get_customer_email_lists_with_http_info(opts) data end # Retrieve all email lists across all storefronts # Retrieve all email lists across all storefronts # @param [Hash] opts the optional parameters # @return [Array<(EmailListsResponse, Integer, Hash)>] EmailListsResponse data, response status code and response headers def get_customer_email_lists_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.get_customer_email_lists ...' end # resource path local_var_path = '/customer/email_lists' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'EmailListsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey'] new_options = opts.merge( :operation => :"CustomerApi.get_customer_email_lists", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#get_customer_email_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve the customer store credit accumulated through loyalty programs # Retrieve the customer store credit accumulated through loyalty programs # @param customer_profile_oid [Integer] The customer oid to retrieve. # @param [Hash] opts the optional parameters # @return [CustomerStoreCreditResponse] def get_customer_store_credit(customer_profile_oid, opts = {}) data, _status_code, _headers = get_customer_store_credit_with_http_info(customer_profile_oid, opts) data end # Retrieve the customer store credit accumulated through loyalty programs # Retrieve the customer store credit accumulated through loyalty programs # @param customer_profile_oid [Integer] The customer oid to retrieve. # @param [Hash] opts the optional parameters # @return [Array<(CustomerStoreCreditResponse, Integer, Hash)>] CustomerStoreCreditResponse data, response status code and response headers def get_customer_store_credit_with_http_info(customer_profile_oid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.get_customer_store_credit ...' end # verify the required parameter 'customer_profile_oid' is set if @api_client.config.client_side_validation && customer_profile_oid.nil? fail ArgumentError, "Missing the required parameter 'customer_profile_oid' when calling CustomerApi.get_customer_store_credit" end # resource path local_var_path = '/customer/customers/{customer_profile_oid}/store_credit'.sub('{' + 'customer_profile_oid' + '}', CGI.escape(customer_profile_oid.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CustomerStoreCreditResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey'] new_options = opts.merge( :operation => :"CustomerApi.get_customer_store_credit", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#get_customer_store_credit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve customers # Retrieves customers from the account. If no parameters are specified, all customers will be returned. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination. # @param [Hash] opts the optional parameters # @option opts [String] :email Email # @option opts [String] :qb_class Quickbooks class # @option opts [String] :quickbooks_code Quickbooks code # @option opts [String] :last_modified_dts_start Last modified date start # @option opts [String] :last_modified_dts_end Last modified date end # @option opts [String] :signup_dts_start Signup date start # @option opts [String] :signup_dts_end Signup date end # @option opts [String] :billing_first_name Billing first name # @option opts [String] :billing_last_name Billing last name # @option opts [String] :billing_company Billing company # @option opts [String] :billing_city Billing city # @option opts [String] :billing_state Billing state # @option opts [String] :billing_postal_code Billing postal code # @option opts [String] :billing_country_code Billing country code # @option opts [String] :billing_day_phone Billing day phone # @option opts [String] :billing_evening_phone Billing evening phone # @option opts [String] :shipping_first_name Shipping first name # @option opts [String] :shipping_last_name Shipping last name # @option opts [String] :shipping_company Shipping company # @option opts [String] :shipping_city Shipping city # @option opts [String] :shipping_state Shipping state # @option opts [String] :shipping_postal_code Shipping postal code # @option opts [String] :shipping_country_code Shipping country code # @option opts [String] :shipping_day_phone Shipping day phone # @option opts [String] :shipping_evening_phone Shipping evening phone # @option opts [Integer] :pricing_tier_oid Pricing tier oid # @option opts [String] :pricing_tier_name Pricing tier name # @option opts [Integer] :_limit The maximum number of records to return on this one API call. (Max 200) (default to 100) # @option opts [Integer] :_offset Pagination of the record set. Offset is a zero based index. (default to 0) # @option opts [String] :_since Fetch customers that have been created/modified since this date/time. # @option opts [String] :_sort The sort order of the customers. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. # @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples # @return [CustomersResponse] def get_customers(opts = {}) data, _status_code, _headers = get_customers_with_http_info(opts) data end # Retrieve customers # Retrieves customers from the account. If no parameters are specified, all customers will be returned. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination. # @param [Hash] opts the optional parameters # @option opts [String] :email Email # @option opts [String] :qb_class Quickbooks class # @option opts [String] :quickbooks_code Quickbooks code # @option opts [String] :last_modified_dts_start Last modified date start # @option opts [String] :last_modified_dts_end Last modified date end # @option opts [String] :signup_dts_start Signup date start # @option opts [String] :signup_dts_end Signup date end # @option opts [String] :billing_first_name Billing first name # @option opts [String] :billing_last_name Billing last name # @option opts [String] :billing_company Billing company # @option opts [String] :billing_city Billing city # @option opts [String] :billing_state Billing state # @option opts [String] :billing_postal_code Billing postal code # @option opts [String] :billing_country_code Billing country code # @option opts [String] :billing_day_phone Billing day phone # @option opts [String] :billing_evening_phone Billing evening phone # @option opts [String] :shipping_first_name Shipping first name # @option opts [String] :shipping_last_name Shipping last name # @option opts [String] :shipping_company Shipping company # @option opts [String] :shipping_city Shipping city # @option opts [String] :shipping_state Shipping state # @option opts [String] :shipping_postal_code Shipping postal code # @option opts [String] :shipping_country_code Shipping country code # @option opts [String] :shipping_day_phone Shipping day phone # @option opts [String] :shipping_evening_phone Shipping evening phone # @option opts [Integer] :pricing_tier_oid Pricing tier oid # @option opts [String] :pricing_tier_name Pricing tier name # @option opts [Integer] :_limit The maximum number of records to return on this one API call. (Max 200) (default to 100) # @option opts [Integer] :_offset Pagination of the record set. Offset is a zero based index. (default to 0) # @option opts [String] :_since Fetch customers that have been created/modified since this date/time. # @option opts [String] :_sort The sort order of the customers. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. # @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples # @return [Array<(CustomersResponse, Integer, Hash)>] CustomersResponse data, response status code and response headers def get_customers_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.get_customers ...' end # resource path local_var_path = '/customer/customers' # query parameters query_params = opts[:query_params] || {} query_params[:'email'] = opts[:'email'] if !opts[:'email'].nil? query_params[:'qb_class'] = opts[:'qb_class'] if !opts[:'qb_class'].nil? query_params[:'quickbooks_code'] = opts[:'quickbooks_code'] if !opts[:'quickbooks_code'].nil? query_params[:'last_modified_dts_start'] = opts[:'last_modified_dts_start'] if !opts[:'last_modified_dts_start'].nil? query_params[:'last_modified_dts_end'] = opts[:'last_modified_dts_end'] if !opts[:'last_modified_dts_end'].nil? query_params[:'signup_dts_start'] = opts[:'signup_dts_start'] if !opts[:'signup_dts_start'].nil? query_params[:'signup_dts_end'] = opts[:'signup_dts_end'] if !opts[:'signup_dts_end'].nil? query_params[:'billing_first_name'] = opts[:'billing_first_name'] if !opts[:'billing_first_name'].nil? query_params[:'billing_last_name'] = opts[:'billing_last_name'] if !opts[:'billing_last_name'].nil? query_params[:'billing_company'] = opts[:'billing_company'] if !opts[:'billing_company'].nil? query_params[:'billing_city'] = opts[:'billing_city'] if !opts[:'billing_city'].nil? query_params[:'billing_state'] = opts[:'billing_state'] if !opts[:'billing_state'].nil? query_params[:'billing_postal_code'] = opts[:'billing_postal_code'] if !opts[:'billing_postal_code'].nil? query_params[:'billing_country_code'] = opts[:'billing_country_code'] if !opts[:'billing_country_code'].nil? query_params[:'billing_day_phone'] = opts[:'billing_day_phone'] if !opts[:'billing_day_phone'].nil? query_params[:'billing_evening_phone'] = opts[:'billing_evening_phone'] if !opts[:'billing_evening_phone'].nil? query_params[:'shipping_first_name'] = opts[:'shipping_first_name'] if !opts[:'shipping_first_name'].nil? query_params[:'shipping_last_name'] = opts[:'shipping_last_name'] if !opts[:'shipping_last_name'].nil? query_params[:'shipping_company'] = opts[:'shipping_company'] if !opts[:'shipping_company'].nil? query_params[:'shipping_city'] = opts[:'shipping_city'] if !opts[:'shipping_city'].nil? query_params[:'shipping_state'] = opts[:'shipping_state'] if !opts[:'shipping_state'].nil? query_params[:'shipping_postal_code'] = opts[:'shipping_postal_code'] if !opts[:'shipping_postal_code'].nil? query_params[:'shipping_country_code'] = opts[:'shipping_country_code'] if !opts[:'shipping_country_code'].nil? query_params[:'shipping_day_phone'] = opts[:'shipping_day_phone'] if !opts[:'shipping_day_phone'].nil? query_params[:'shipping_evening_phone'] = opts[:'shipping_evening_phone'] if !opts[:'shipping_evening_phone'].nil? query_params[:'pricing_tier_oid'] = opts[:'pricing_tier_oid'] if !opts[:'pricing_tier_oid'].nil? query_params[:'pricing_tier_name'] = opts[:'pricing_tier_name'] if !opts[:'pricing_tier_name'].nil? query_params[:'_limit'] = opts[:'_limit'] if !opts[:'_limit'].nil? query_params[:'_offset'] = opts[:'_offset'] if !opts[:'_offset'].nil? query_params[:'_since'] = opts[:'_since'] if !opts[:'_since'].nil? query_params[:'_sort'] = opts[:'_sort'] if !opts[:'_sort'].nil? query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil? # header parameters header_params = opts[: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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CustomersResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey'] new_options = opts.merge( :operation => :"CustomerApi.get_customers", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#get_customers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve customers by query # Retrieves customers from the account. If no parameters are specified, all customers will be returned. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination. # @param customer_query [CustomerQuery] Customer query # @param [Hash] opts the optional parameters # @option opts [Integer] :_limit The maximum number of records to return on this one API call. (Max 200) (default to 100) # @option opts [Integer] :_offset Pagination of the record set. Offset is a zero based index. (default to 0) # @option opts [String] :_since Fetch customers that have been created/modified since this date/time. # @option opts [String] :_sort The sort order of the customers. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. # @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples # @return [CustomersResponse] def get_customers_by_query(customer_query, opts = {}) data, _status_code, _headers = get_customers_by_query_with_http_info(customer_query, opts) data end # Retrieve customers by query # Retrieves customers from the account. If no parameters are specified, all customers will be returned. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination. # @param customer_query [CustomerQuery] Customer query # @param [Hash] opts the optional parameters # @option opts [Integer] :_limit The maximum number of records to return on this one API call. (Max 200) (default to 100) # @option opts [Integer] :_offset Pagination of the record set. Offset is a zero based index. (default to 0) # @option opts [String] :_since Fetch customers that have been created/modified since this date/time. # @option opts [String] :_sort The sort order of the customers. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. # @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples # @return [Array<(CustomersResponse, Integer, Hash)>] CustomersResponse data, response status code and response headers def get_customers_by_query_with_http_info(customer_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.get_customers_by_query ...' end # verify the required parameter 'customer_query' is set if @api_client.config.client_side_validation && customer_query.nil? fail ArgumentError, "Missing the required parameter 'customer_query' when calling CustomerApi.get_customers_by_query" end # resource path local_var_path = '/customer/customers/query' # query parameters query_params = opts[:query_params] || {} query_params[:'_limit'] = opts[:'_limit'] if !opts[:'_limit'].nil? query_params[:'_offset'] = opts[:'_offset'] if !opts[:'_offset'].nil? query_params[:'_since'] = opts[:'_since'] if !opts[:'_since'].nil? query_params[:'_sort'] = opts[:'_sort'] if !opts[:'_sort'].nil? query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil? # header parameters header_params = opts[: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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(customer_query) # return_type return_type = opts[:debug_return_type] || 'CustomersResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey'] new_options = opts.merge( :operation => :"CustomerApi.get_customers_by_query", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#get_customers_by_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve customers for DataTables plugin # Retrieves customers from the account. If no searches are specified, all customers will be returned. # @param [Hash] opts the optional parameters # @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples # @return [DataTablesServerSideResponse] def get_customers_for_data_tables(opts = {}) data, _status_code, _headers = get_customers_for_data_tables_with_http_info(opts) data end # Retrieve customers for DataTables plugin # Retrieves customers from the account. If no searches are specified, all customers will be returned. # @param [Hash] opts the optional parameters # @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples # @return [Array<(DataTablesServerSideResponse, Integer, Hash)>] DataTablesServerSideResponse data, response status code and response headers def get_customers_for_data_tables_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.get_customers_for_data_tables ...' end # resource path local_var_path = '/customer/customers/dataTables' # query parameters query_params = opts[:query_params] || {} query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil? # header parameters header_params = opts[: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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'DataTablesServerSideResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey'] new_options = opts.merge( :operation => :"CustomerApi.get_customers_for_data_tables", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#get_customers_for_data_tables\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a token that can be used to verify a customer email address # Create a token that can be used to verify a customer email address. The implementation of how a customer interacts with this token is left to the merchant. # @param token_request [EmailVerifyTokenRequest] Token request # @param [Hash] opts the optional parameters # @return [EmailVerifyTokenResponse] def get_email_verification_token(token_request, opts = {}) data, _status_code, _headers = get_email_verification_token_with_http_info(token_request, opts) data end # Create a token that can be used to verify a customer email address # Create a token that can be used to verify a customer email address. The implementation of how a customer interacts with this token is left to the merchant. # @param token_request [EmailVerifyTokenRequest] Token request # @param [Hash] opts the optional parameters # @return [Array<(EmailVerifyTokenResponse, Integer, Hash)>] EmailVerifyTokenResponse data, response status code and response headers def get_email_verification_token_with_http_info(token_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.get_email_verification_token ...' end # verify the required parameter 'token_request' is set if @api_client.config.client_side_validation && token_request.nil? fail ArgumentError, "Missing the required parameter 'token_request' when calling CustomerApi.get_email_verification_token" end # resource path local_var_path = '/customer/customers/email_verify/get_token' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(token_request) # return_type return_type = opts[:debug_return_type] || 'EmailVerifyTokenResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey'] new_options = opts.merge( :operation => :"CustomerApi.get_email_verification_token", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#get_email_verification_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Insert a customer # Insert a customer on the UltraCart account. # @param customer [Customer] Customer to insert # @param [Hash] opts the optional parameters # @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples # @return [CustomerResponse] def insert_customer(customer, opts = {}) data, _status_code, _headers = insert_customer_with_http_info(customer, opts) data end # Insert a customer # Insert a customer on the UltraCart account. # @param customer [Customer] Customer to insert # @param [Hash] opts the optional parameters # @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples # @return [Array<(CustomerResponse, Integer, Hash)>] CustomerResponse data, response status code and response headers def insert_customer_with_http_info(customer, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.insert_customer ...' end # verify the required parameter 'customer' is set if @api_client.config.client_side_validation && customer.nil? fail ArgumentError, "Missing the required parameter 'customer' when calling CustomerApi.insert_customer" end # resource path local_var_path = '/customer/customers' # query parameters query_params = opts[:query_params] || {} query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil? # header parameters header_params = opts[: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' content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(customer) # return_type return_type = opts[:debug_return_type] || 'CustomerResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey'] new_options = opts.merge( :operation => :"CustomerApi.insert_customer", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#insert_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Merge customer into this customer # Merge customer into this customer. # @param customer_profile_oid [Integer] The customer_profile_oid to update. # @param customer [CustomerMergeRequest] Customer to merge into this profile. # @param [Hash] opts the optional parameters # @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples # @return [nil] def merge_customer(customer_profile_oid, customer, opts = {}) merge_customer_with_http_info(customer_profile_oid, customer, opts) nil end # Merge customer into this customer # Merge customer into this customer. # @param customer_profile_oid [Integer] The customer_profile_oid to update. # @param customer [CustomerMergeRequest] Customer to merge into this profile. # @param [Hash] opts the optional parameters # @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def merge_customer_with_http_info(customer_profile_oid, customer, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.merge_customer ...' end # verify the required parameter 'customer_profile_oid' is set if @api_client.config.client_side_validation && customer_profile_oid.nil? fail ArgumentError, "Missing the required parameter 'customer_profile_oid' when calling CustomerApi.merge_customer" end # verify the required parameter 'customer' is set if @api_client.config.client_side_validation && customer.nil? fail ArgumentError, "Missing the required parameter 'customer' when calling CustomerApi.merge_customer" end # resource path local_var_path = '/customer/customers/{customer_profile_oid}/merge'.sub('{' + 'customer_profile_oid' + '}', CGI.escape(customer_profile_oid.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil? # header parameters header_params = opts[: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' content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(customer) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey'] new_options = opts.merge( :operation => :"CustomerApi.merge_customer", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#merge_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Searches for all matching values (using POST) # @param lookup_request [LookupRequest] LookupRequest # @param [Hash] opts the optional parameters # @return [LookupResponse] def search_customer_profile_values(lookup_request, opts = {}) data, _status_code, _headers = search_customer_profile_values_with_http_info(lookup_request, opts) data end # Searches for all matching values (using POST) # @param lookup_request [LookupRequest] LookupRequest # @param [Hash] opts the optional parameters # @return [Array<(LookupResponse, Integer, Hash)>] LookupResponse data, response status code and response headers def search_customer_profile_values_with_http_info(lookup_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.search_customer_profile_values ...' end # verify the required parameter 'lookup_request' is set if @api_client.config.client_side_validation && lookup_request.nil? fail ArgumentError, "Missing the required parameter 'lookup_request' when calling CustomerApi.search_customer_profile_values" end # resource path local_var_path = '/customer/search' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(lookup_request) # return_type return_type = opts[:debug_return_type] || 'LookupResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey'] new_options = opts.merge( :operation => :"CustomerApi.search_customer_profile_values", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#search_customer_profile_values\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a customer # Update a customer on the UltraCart account. # @param customer_profile_oid [Integer] The customer_profile_oid to update. # @param customer [Customer] Customer to update # @param [Hash] opts the optional parameters # @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples # @return [CustomerResponse] def update_customer(customer_profile_oid, customer, opts = {}) data, _status_code, _headers = update_customer_with_http_info(customer_profile_oid, customer, opts) data end # Update a customer # Update a customer on the UltraCart account. # @param customer_profile_oid [Integer] The customer_profile_oid to update. # @param customer [Customer] Customer to update # @param [Hash] opts the optional parameters # @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples # @return [Array<(CustomerResponse, Integer, Hash)>] CustomerResponse data, response status code and response headers def update_customer_with_http_info(customer_profile_oid, customer, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.update_customer ...' end # verify the required parameter 'customer_profile_oid' is set if @api_client.config.client_side_validation && customer_profile_oid.nil? fail ArgumentError, "Missing the required parameter 'customer_profile_oid' when calling CustomerApi.update_customer" end # verify the required parameter 'customer' is set if @api_client.config.client_side_validation && customer.nil? fail ArgumentError, "Missing the required parameter 'customer' when calling CustomerApi.update_customer" end # resource path local_var_path = '/customer/customers/{customer_profile_oid}'.sub('{' + 'customer_profile_oid' + '}', CGI.escape(customer_profile_oid.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil? # header parameters header_params = opts[: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' content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(customer) # return_type return_type = opts[:debug_return_type] || 'CustomerResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey'] new_options = opts.merge( :operation => :"CustomerApi.update_customer", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#update_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update email list subscriptions for a customer # Update email list subscriptions for a customer # @param customer_profile_oid [Integer] The customer profile oid # @param list_changes [CustomerEmailListChanges] List changes # @param [Hash] opts the optional parameters # @return [CustomerEmailListChanges] def update_customer_email_lists(customer_profile_oid, list_changes, opts = {}) data, _status_code, _headers = update_customer_email_lists_with_http_info(customer_profile_oid, list_changes, opts) data end # Update email list subscriptions for a customer # Update email list subscriptions for a customer # @param customer_profile_oid [Integer] The customer profile oid # @param list_changes [CustomerEmailListChanges] List changes # @param [Hash] opts the optional parameters # @return [Array<(CustomerEmailListChanges, Integer, Hash)>] CustomerEmailListChanges data, response status code and response headers def update_customer_email_lists_with_http_info(customer_profile_oid, list_changes, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.update_customer_email_lists ...' end # verify the required parameter 'customer_profile_oid' is set if @api_client.config.client_side_validation && customer_profile_oid.nil? fail ArgumentError, "Missing the required parameter 'customer_profile_oid' when calling CustomerApi.update_customer_email_lists" end # verify the required parameter 'list_changes' is set if @api_client.config.client_side_validation && list_changes.nil? fail ArgumentError, "Missing the required parameter 'list_changes' when calling CustomerApi.update_customer_email_lists" end # resource path local_var_path = '/customer/customers/{customer_profile_oid}/email_lists'.sub('{' + 'customer_profile_oid' + '}', CGI.escape(customer_profile_oid.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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' content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(list_changes) # return_type return_type = opts[:debug_return_type] || 'CustomerEmailListChanges' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey'] new_options = opts.merge( :operation => :"CustomerApi.update_customer_email_lists", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#update_customer_email_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Validate a token that can be used to verify a customer email address # Validate a token that can be used to verify a customer email address. The implementation of how a customer interacts with this token is left to the merchant. # @param validation_request [EmailVerifyTokenValidateRequest] Token validation request # @param [Hash] opts the optional parameters # @return [EmailVerifyTokenValidateResponse] def validate_email_verification_token(validation_request, opts = {}) data, _status_code, _headers = validate_email_verification_token_with_http_info(validation_request, opts) data end # Validate a token that can be used to verify a customer email address # Validate a token that can be used to verify a customer email address. The implementation of how a customer interacts with this token is left to the merchant. # @param validation_request [EmailVerifyTokenValidateRequest] Token validation request # @param [Hash] opts the optional parameters # @return [Array<(EmailVerifyTokenValidateResponse, Integer, Hash)>] EmailVerifyTokenValidateResponse data, response status code and response headers def validate_email_verification_token_with_http_info(validation_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.validate_email_verification_token ...' end # verify the required parameter 'validation_request' is set if @api_client.config.client_side_validation && validation_request.nil? fail ArgumentError, "Missing the required parameter 'validation_request' when calling CustomerApi.validate_email_verification_token" end # resource path local_var_path = '/customer/customers/email_verify/validate_token' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(validation_request) # return_type return_type = opts[:debug_return_type] || 'EmailVerifyTokenValidateResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey'] new_options = opts.merge( :operation => :"CustomerApi.validate_email_verification_token", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#validate_email_verification_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end