=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 'uri' module UltracartClient class AffiliateApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # 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. # @param click_query Click query # @param [Hash] opts the optional parameters # @option opts [Integer] :_limit The maximum number of records to return on this one API call. (Maximum 10000) (default to 10000) # @option opts [Integer] :_offset Pagination of the record set. Offset is a zero based index. (default to 0) # @option opts [String] :_expand The object expansion to perform on the result. Only option is link. # @return [AffiliateClicksResponse] def get_clicks_by_query(click_query, opts = {}) data, _status_code, _headers = get_clicks_by_query_with_http_info(click_query, opts) data end # 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. # @param click_query Click query # @param [Hash] opts the optional parameters # @option opts [Integer] :_limit The maximum number of records to return on this one API call. (Maximum 10000) # @option opts [Integer] :_offset Pagination of the record set. Offset is a zero based index. # @option opts [String] :_expand The object expansion to perform on the result. Only option is link. # @return [Array<(AffiliateClicksResponse, Fixnum, Hash)>] AffiliateClicksResponse data, response status code and response headers 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 = {} 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 = {} 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(click_query) 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 => 'AffiliateClicksResponse') 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 # 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. # @param ledger_query Ledger query # @param [Hash] opts the optional parameters # @option opts [Integer] :_limit The maximum number of records to return on this one API call. (Maximum 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] :_expand The object expansion to perform on the result. Only option is link. # @return [AffiliateLedgersResponse] def get_ledgers_by_query(ledger_query, opts = {}) data, _status_code, _headers = get_ledgers_by_query_with_http_info(ledger_query, opts) data end # 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. # @param ledger_query Ledger query # @param [Hash] opts the optional parameters # @option opts [Integer] :_limit The maximum number of records to return on this one API call. (Maximum 200) # @option opts [Integer] :_offset Pagination of the record set. Offset is a zero based index. # @option opts [String] :_expand The object expansion to perform on the result. Only option is link. # @return [Array<(AffiliateLedgersResponse, Fixnum, Hash)>] AffiliateLedgersResponse data, response status code and response headers 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 = {} 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 = {} 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(ledger_query) 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 => 'AffiliateLedgersResponse') 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 end end