Class: UltracartClient::AffiliateApi
- Inherits:
-
Object
- Object
- UltracartClient::AffiliateApi
- Defined in:
- lib/ultracart_api/api/affiliate_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Class Method Summary collapse
Instance Method Summary collapse
-
#get_clicks_by_query(click_query, opts = {}) ⇒ AffiliateClicksResponse
Retrieve clicks Retrieves a group of clicks from the account based on a query object.
-
#get_clicks_by_query_with_http_info(click_query, opts = {}) ⇒ Array<(AffiliateClicksResponse, Integer, Hash)>
Retrieve clicks Retrieves a group of clicks from the account based on a query object.
-
#get_ledgers_by_query(ledger_query, opts = {}) ⇒ AffiliateLedgersResponse
Retrieve ledger entries Retrieves a group of ledger entries from the account based on a query object.
-
#get_ledgers_by_query_with_http_info(ledger_query, opts = {}) ⇒ Array<(AffiliateLedgersResponse, Integer, Hash)>
Retrieve ledger entries Retrieves a group of ledger entries from the account based on a query object.
-
#initialize(api_client = ApiClient.default) ⇒ AffiliateApi
constructor
A new instance of AffiliateApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ AffiliateApi
Returns a new instance of AffiliateApi.
19 20 21 |
# File 'lib/ultracart_api/api/affiliate_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/ultracart_api/api/affiliate_api.rb', line 17 def api_client @api_client end |
Class Method Details
.new_using_api_key(simple_key, verify_ssl = true, debugging = false) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/ultracart_api/api/affiliate_api.rb', line 23 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::AffiliateApi.new(api_client) end |
Instance Method Details
#get_clicks_by_query(click_query, opts = {}) ⇒ AffiliateClicksResponse
Retrieve clicks Retrieves a group of clicks from the account based on a query object. If no parameters are specified, the API call will fail with a bad request error. Always specify some parameters to limit the scope of the clicks returned to ones you are truly interested in. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.
43 44 45 46 |
# File 'lib/ultracart_api/api/affiliate_api.rb', line 43 def get_clicks_by_query(click_query, opts = {}) data, _status_code, _headers = get_clicks_by_query_with_http_info(click_query, opts) data end |
#get_clicks_by_query_with_http_info(click_query, opts = {}) ⇒ Array<(AffiliateClicksResponse, Integer, Hash)>
Retrieve clicks Retrieves a group of clicks from the account based on a query object. If no parameters are specified, the API call will fail with a bad request error. Always specify some parameters to limit the scope of the clicks returned to ones you are truly interested in. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/ultracart_api/api/affiliate_api.rb', line 56 def get_clicks_by_query_with_http_info(click_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AffiliateApi.get_clicks_by_query ...' end # verify the required parameter 'click_query' is set if @api_client.config.client_side_validation && click_query.nil? fail ArgumentError, "Missing the required parameter 'click_query' when calling AffiliateApi.get_clicks_by_query" end # resource path local_var_path = '/affiliate/clicks/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[:'_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(click_query) # return_type return_type = opts[:debug_return_type] || 'AffiliateClicksResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey'] = opts.merge( :operation => :"AffiliateApi.get_clicks_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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AffiliateApi#get_clicks_by_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_ledgers_by_query(ledger_query, opts = {}) ⇒ AffiliateLedgersResponse
Retrieve ledger entries Retrieves a group of ledger entries from the account based on a query object. If no parameters are specified, the API call will fail with a bad request error. Always specify some parameters to limit the scope of the ledgers returned to ones you are truly interested in. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.
121 122 123 124 |
# File 'lib/ultracart_api/api/affiliate_api.rb', line 121 def get_ledgers_by_query(ledger_query, opts = {}) data, _status_code, _headers = get_ledgers_by_query_with_http_info(ledger_query, opts) data end |
#get_ledgers_by_query_with_http_info(ledger_query, opts = {}) ⇒ Array<(AffiliateLedgersResponse, Integer, Hash)>
Retrieve ledger entries Retrieves a group of ledger entries from the account based on a query object. If no parameters are specified, the API call will fail with a bad request error. Always specify some parameters to limit the scope of the ledgers returned to ones you are truly interested in. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
# File 'lib/ultracart_api/api/affiliate_api.rb', line 134 def get_ledgers_by_query_with_http_info(ledger_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AffiliateApi.get_ledgers_by_query ...' end # verify the required parameter 'ledger_query' is set if @api_client.config.client_side_validation && ledger_query.nil? fail ArgumentError, "Missing the required parameter 'ledger_query' when calling AffiliateApi.get_ledgers_by_query" end # resource path local_var_path = '/affiliate/ledgers/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[:'_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(ledger_query) # return_type return_type = opts[:debug_return_type] || 'AffiliateLedgersResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey'] = opts.merge( :operation => :"AffiliateApi.get_ledgers_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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AffiliateApi#get_ledgers_by_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |