class AliseeksApi::SearchApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/aliseeks_api/api/search_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

realtime_search_with_http_info(realtime_search_request, opts = {}) click to toggle source

Searches AliExpress in realtime @param realtime_search_request Realtime search request body @param [Hash] opts the optional parameters @return [Array<(RealtimeSearchResponse, Fixnum, Hash)>] RealtimeSearchResponse data, response status code and response headers

# File lib/aliseeks_api/api/search_api.rb, line 35
def realtime_search_with_http_info(realtime_search_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SearchApi.realtime_search ...'
  end
  # verify the required parameter 'realtime_search_request' is set
  if @api_client.config.client_side_validation && realtime_search_request.nil?
    fail ArgumentError, "Missing the required parameter 'realtime_search_request' when calling SearchApi.realtime_search"
  end
  # resource path
  local_var_path = '/search/realtime'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # 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(realtime_search_request)
  auth_names = ['ApiKeyAuth']
  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 => 'RealtimeSearchResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SearchApi#realtime_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
search_best_selling(best_selling_search_request, opts = {}) click to toggle source

Retrieves best selling products from AliExpress in realtime. @param best_selling_search_request Search best selling request body @param [Hash] opts the optional parameters @return [BestSellingSearchResponse]

# File lib/aliseeks_api/api/search_api.rb, line 132
def search_best_selling(best_selling_search_request, opts = {})
  data, _status_code, _headers = search_best_selling_with_http_info(best_selling_search_request, opts)
  data
end
search_best_selling_with_http_info(best_selling_search_request, opts = {}) click to toggle source

Retrieves best selling products from AliExpress in realtime. @param best_selling_search_request Search best selling request body @param [Hash] opts the optional parameters @return [Array<(BestSellingSearchResponse, Fixnum, Hash)>] BestSellingSearchResponse data, response status code and response headers

# File lib/aliseeks_api/api/search_api.rb, line 141
def search_best_selling_with_http_info(best_selling_search_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SearchApi.search_best_selling ...'
  end
  # verify the required parameter 'best_selling_search_request' is set
  if @api_client.config.client_side_validation && best_selling_search_request.nil?
    fail ArgumentError, "Missing the required parameter 'best_selling_search_request' when calling SearchApi.search_best_selling"
  end
  # resource path
  local_var_path = '/search/bestSelling'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # 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(best_selling_search_request)
  auth_names = ['ApiKeyAuth']
  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 => 'BestSellingSearchResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SearchApi#search_best_selling\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
search_by_image(image_search_request, opts = {}) click to toggle source

Searches AliExpress by image in realtime. @param image_search_request The image search request body @param [Hash] opts the optional parameters @return [ImageSearchResponse]

# File lib/aliseeks_api/api/search_api.rb, line 185
def search_by_image(image_search_request, opts = {})
  data, _status_code, _headers = search_by_image_with_http_info(image_search_request, opts)
  data
end
search_by_image_with_http_info(image_search_request, opts = {}) click to toggle source

Searches AliExpress by image in realtime. @param image_search_request The image search request body @param [Hash] opts the optional parameters @return [Array<(ImageSearchResponse, Fixnum, Hash)>] ImageSearchResponse data, response status code and response headers

# File lib/aliseeks_api/api/search_api.rb, line 194
def search_by_image_with_http_info(image_search_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SearchApi.search_by_image ...'
  end
  # verify the required parameter 'image_search_request' is set
  if @api_client.config.client_side_validation && image_search_request.nil?
    fail ArgumentError, "Missing the required parameter 'image_search_request' when calling SearchApi.search_by_image"
  end
  # resource path
  local_var_path = '/search/image'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # 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(image_search_request)
  auth_names = ['ApiKeyAuth']
  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 => 'ImageSearchResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SearchApi#search_by_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
search_with_http_info(search_request, opts = {}) click to toggle source

Searches AliExpress in non-realtime. Uses the Aliseeks.com datasource which is continually updated from AliExpress. @param search_request Search request body @param [Hash] opts the optional parameters @return [Array<(SearchResponse, Fixnum, Hash)>] SearchResponse data, response status code and response headers

# File lib/aliseeks_api/api/search_api.rb, line 88
def search_with_http_info(search_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SearchApi.search ...'
  end
  # verify the required parameter 'search_request' is set
  if @api_client.config.client_side_validation && search_request.nil?
    fail ArgumentError, "Missing the required parameter 'search_request' when calling SearchApi.search"
  end
  # resource path
  local_var_path = '/search'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # 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(search_request)
  auth_names = ['ApiKeyAuth']
  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 => 'SearchResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SearchApi#search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
upload_image_by_url(upload_image_by_url_request, opts = {}) click to toggle source

Uploads an image to AliExpress to allow it to be used in the image search endpoint @param upload_image_by_url_request The upload image by url request body @param [Hash] opts the optional parameters @return [UploadImageResponse]

# File lib/aliseeks_api/api/search_api.rb, line 238
def upload_image_by_url(upload_image_by_url_request, opts = {})
  data, _status_code, _headers = upload_image_by_url_with_http_info(upload_image_by_url_request, opts)
  data
end
upload_image_by_url_with_http_info(upload_image_by_url_request, opts = {}) click to toggle source

Uploads an image to AliExpress to allow it to be used in the image search endpoint @param upload_image_by_url_request The upload image by url request body @param [Hash] opts the optional parameters @return [Array<(UploadImageResponse, Fixnum, Hash)>] UploadImageResponse data, response status code and response headers

# File lib/aliseeks_api/api/search_api.rb, line 247
def upload_image_by_url_with_http_info(upload_image_by_url_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SearchApi.upload_image_by_url ...'
  end
  # verify the required parameter 'upload_image_by_url_request' is set
  if @api_client.config.client_side_validation && upload_image_by_url_request.nil?
    fail ArgumentError, "Missing the required parameter 'upload_image_by_url_request' when calling SearchApi.upload_image_by_url"
  end
  # resource path
  local_var_path = '/search/image/upload'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # 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(upload_image_by_url_request)
  auth_names = ['ApiKeyAuth']
  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 => 'UploadImageResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SearchApi#upload_image_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end