Class: AliseeksApi::SearchApi

Inherits:
Object
  • Object
show all
Defined in:
lib/aliseeks_api/api/search_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SearchApi

Returns a new instance of SearchApi.



19
20
21
# File 'lib/aliseeks_api/api/search_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/aliseeks_api/api/search_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#realtime_search(realtime_search_request, opts = {}) ⇒ RealtimeSearchResponse

Searches AliExpress in realtime

Parameters:

  • realtime_search_request

    Realtime search request body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



26
27
28
29
# File 'lib/aliseeks_api/api/search_api.rb', line 26

def realtime_search(realtime_search_request, opts = {})
  data, _status_code, _headers = realtime_search_with_http_info(realtime_search_request, opts)
  data
end

#realtime_search_with_http_info(realtime_search_request, opts = {}) ⇒ Array<(RealtimeSearchResponse, Fixnum, Hash)>

Searches AliExpress in realtime

Parameters:

  • realtime_search_request

    Realtime search request body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(RealtimeSearchResponse, Fixnum, Hash)>)

    RealtimeSearchResponse data, response status code and response headers



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# 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(search_request, opts = {}) ⇒ SearchResponse

Searches AliExpress in non-realtime. Uses the Aliseeks.com datasource which is continually updated from AliExpress.

Parameters:

  • search_request

    Search request body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



79
80
81
82
# File 'lib/aliseeks_api/api/search_api.rb', line 79

def search(search_request, opts = {})
  data, _status_code, _headers = search_with_http_info(search_request, opts)
  data
end

#search_best_selling(best_selling_search_request, opts = {}) ⇒ BestSellingSearchResponse

Retrieves best selling products from AliExpress in realtime.

Parameters:

  • best_selling_search_request

    Search best selling request body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



132
133
134
135
# 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 = {}) ⇒ Array<(BestSellingSearchResponse, Fixnum, Hash)>

Retrieves best selling products from AliExpress in realtime.

Parameters:

  • best_selling_search_request

    Search best selling request body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(BestSellingSearchResponse, Fixnum, Hash)>)

    BestSellingSearchResponse data, response status code and response headers



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
# 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 = {}) ⇒ ImageSearchResponse

Searches AliExpress by image in realtime.

Parameters:

  • image_search_request

    The image search request body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



185
186
187
188
# 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 = {}) ⇒ Array<(ImageSearchResponse, Fixnum, Hash)>

Searches AliExpress by image in realtime.

Parameters:

  • image_search_request

    The image search request body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ImageSearchResponse, Fixnum, Hash)>)

    ImageSearchResponse data, response status code and response headers



194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# 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 = {}) ⇒ Array<(SearchResponse, Fixnum, Hash)>

Searches AliExpress in non-realtime. Uses the Aliseeks.com datasource which is continually updated from AliExpress.

Parameters:

  • search_request

    Search request body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(SearchResponse, Fixnum, Hash)>)

    SearchResponse data, response status code and response headers



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# 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 = {}) ⇒ UploadImageResponse

Uploads an image to AliExpress to allow it to be used in the image search endpoint

Parameters:

  • upload_image_by_url_request

    The upload image by url request body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



238
239
240
241
# 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 = {}) ⇒ Array<(UploadImageResponse, Fixnum, Hash)>

Uploads an image to AliExpress to allow it to be used in the image search endpoint

Parameters:

  • upload_image_by_url_request

    The upload image by url request body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(UploadImageResponse, Fixnum, Hash)>)

    UploadImageResponse data, response status code and response headers



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# 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