Class: Algolia::QuerySuggestionsClient

Inherits:
Object
  • Object
show all
Defined in:
lib/algolia/api/query_suggestions_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config = nil) ⇒ QuerySuggestionsClient

Returns a new instance of QuerySuggestionsClient.



7
8
9
10
11
12
13
# File 'lib/algolia/api/query_suggestions_client.rb', line 7

def initialize(config = nil)
  raise "`config` is missing." if config.nil?
  raise "`app_id` is missing." if config.app_id.nil? || config.app_id == ""
  raise "`api_key` is missing." if config.api_key.nil? || config.api_key == ""

  @api_client = Algolia::ApiClient.new(config)
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



5
6
7
# File 'lib/algolia/api/query_suggestions_client.rb', line 5

def api_client
  @api_client
end

Class Method Details

.create(app_id, api_key, region = nil, opts = {}) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/algolia/api/query_suggestions_client.rb', line 15

def self.create(app_id, api_key, region = nil, opts = {})
  hosts = []
  regions = ["eu", "us"]

  if region.is_a?(Hash) && (opts.nil? || opts.empty?)
    opts = region
    region = nil
  end

  if region.nil? || !region.is_a?(String) || !regions.include?(region)
    raise "`region` is required and must be one of the following: #{regions.join(", ")}"
  end

  hosts <<
    Transport::StatefulHost.new(
      "query-suggestions.{region}.algolia.com".sub!("{region}", region),
      accept: CallType::READ | CallType::WRITE
    )

  config = Algolia::Configuration.new(app_id, api_key, hosts, "QuerySuggestions", opts)
  create_with_config(config)
end

.create_with_config(config) ⇒ Object



38
39
40
# File 'lib/algolia/api/query_suggestions_client.rb', line 38

def self.create_with_config(config)
  new(config)
end

Instance Method Details

#add_user_agent_segment(segment, version = nil) ⇒ Object



52
53
54
55
56
# File 'lib/algolia/api/query_suggestions_client.rb', line 52

def add_user_agent_segment(segment, version = nil)
  @api_client.config.add_user_agent_segment(segment, version)

  self
end

#create_config(configuration_with_index, request_options = {}) ⇒ BaseResponse

Creates a new Query Suggestions configuration. You can have up to 100 configurations per Algolia application.

Required API Key ACLs:

- editSettings

Parameters:

  • configuration_with_index (ConfigurationWithIndex)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (BaseResponse)


97
98
99
100
# File 'lib/algolia/api/query_suggestions_client.rb', line 97

def create_config(configuration_with_index, request_options = {})
  response = create_config_with_http_info(configuration_with_index, request_options)
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "QuerySuggestions::BaseResponse")
end

#create_config_with_http_info(configuration_with_index, request_options = {}) ⇒ Http::Response

Creates a new Query Suggestions configuration. You can have up to 100 configurations per Algolia application.

Required API Key ACLs:

- editSettings

Parameters:

  • configuration_with_index (ConfigurationWithIndex)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/algolia/api/query_suggestions_client.rb', line 65

def create_config_with_http_info(configuration_with_index, request_options = {})
  # verify the required parameter 'configuration_with_index' is set
  if @api_client.config.client_side_validation && configuration_with_index.nil?
    raise ArgumentError, "Parameter `configuration_with_index` is required when calling `create_config`."
  end

  path = "/1/configs"
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body] || @api_client.object_to_http_body(configuration_with_index)

  new_options = request_options.merge(
    :operation => :"QuerySuggestionsClient.create_config",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:POST, path, new_options)
end

#custom_delete(path, parameters = nil, request_options = {}) ⇒ Object

Parameters:

  • path (String)

    Path of the endpoint, anything after "/1" must be specified. (required)

  • parameters (Hash<String, Object>) (defaults to: nil)

    Query parameters to apply to the current query.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (Object)


140
141
142
143
# File 'lib/algolia/api/query_suggestions_client.rb', line 140

def custom_delete(path, parameters = nil, request_options = {})
  response = custom_delete_with_http_info(path, parameters, request_options)
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
end

#custom_delete_with_http_info(path, parameters = nil, request_options = {}) ⇒ Http::Response

Returns the response.

Parameters:

  • path (String)

    Path of the endpoint, anything after "/1" must be specified. (required)

  • parameters (Hash<String, Object>) (defaults to: nil)

    Query parameters to apply to the current query.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/algolia/api/query_suggestions_client.rb', line 108

def custom_delete_with_http_info(path, parameters = nil, request_options = {})
  # verify the required parameter 'path' is set
  if @api_client.config.client_side_validation && path.nil?
    raise ArgumentError, "Parameter `path` is required when calling `custom_delete`."
  end

  path = "/{path}".sub("{" + "path" + "}", path.to_s)
  query_params = {}
  query_params = query_params.merge(parameters) unless parameters.nil?
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"QuerySuggestionsClient.custom_delete",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:DELETE, path, new_options)
end

#custom_get(path, parameters = nil, request_options = {}) ⇒ Object

Parameters:

  • path (String)

    Path of the endpoint, anything after "/1" must be specified. (required)

  • parameters (Hash<String, Object>) (defaults to: nil)

    Query parameters to apply to the current query.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (Object)


183
184
185
186
# File 'lib/algolia/api/query_suggestions_client.rb', line 183

def custom_get(path, parameters = nil, request_options = {})
  response = custom_get_with_http_info(path, parameters, request_options)
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
end

#custom_get_with_http_info(path, parameters = nil, request_options = {}) ⇒ Http::Response

Returns the response.

Parameters:

  • path (String)

    Path of the endpoint, anything after "/1" must be specified. (required)

  • parameters (Hash<String, Object>) (defaults to: nil)

    Query parameters to apply to the current query.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



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
# File 'lib/algolia/api/query_suggestions_client.rb', line 151

def custom_get_with_http_info(path, parameters = nil, request_options = {})
  # verify the required parameter 'path' is set
  if @api_client.config.client_side_validation && path.nil?
    raise ArgumentError, "Parameter `path` is required when calling `custom_get`."
  end

  path = "/{path}".sub("{" + "path" + "}", path.to_s)
  query_params = {}
  query_params = query_params.merge(parameters) unless parameters.nil?
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"QuerySuggestionsClient.custom_get",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:GET, path, new_options)
end

#custom_post(path, parameters = nil, body = nil, request_options = {}) ⇒ Object

Parameters:

  • path (String)

    Path of the endpoint, anything after "/1" must be specified. (required)

  • parameters (Hash<String, Object>) (defaults to: nil)

    Query parameters to apply to the current query.

  • body (Object) (defaults to: nil)

    Parameters to send with the custom request.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (Object)


228
229
230
231
# File 'lib/algolia/api/query_suggestions_client.rb', line 228

def custom_post(path, parameters = nil, body = nil, request_options = {})
  response = custom_post_with_http_info(path, parameters, body, request_options)
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
end

#custom_post_with_http_info(path, parameters = nil, body = nil, request_options = {}) ⇒ Http::Response

Returns the response.

Parameters:

  • path (String)

    Path of the endpoint, anything after "/1" must be specified. (required)

  • parameters (Hash<String, Object>) (defaults to: nil)

    Query parameters to apply to the current query.

  • body (Object) (defaults to: nil)

    Parameters to send with the custom request.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



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
# File 'lib/algolia/api/query_suggestions_client.rb', line 195

def custom_post_with_http_info(path, parameters = nil, body = nil, request_options = {})
  # verify the required parameter 'path' is set
  if @api_client.config.client_side_validation && path.nil?
    raise ArgumentError, "Parameter `path` is required when calling `custom_post`."
  end

  path = "/{path}".sub("{" + "path" + "}", path.to_s)
  query_params = {}
  query_params = query_params.merge(parameters) unless parameters.nil?
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body] || @api_client.object_to_http_body(body)

  new_options = request_options.merge(
    :operation => :"QuerySuggestionsClient.custom_post",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:POST, path, new_options)
end

#custom_put(path, parameters = nil, body = nil, request_options = {}) ⇒ Object

Parameters:

  • path (String)

    Path of the endpoint, anything after "/1" must be specified. (required)

  • parameters (Hash<String, Object>) (defaults to: nil)

    Query parameters to apply to the current query.

  • body (Object) (defaults to: nil)

    Parameters to send with the custom request.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (Object)


273
274
275
276
# File 'lib/algolia/api/query_suggestions_client.rb', line 273

def custom_put(path, parameters = nil, body = nil, request_options = {})
  response = custom_put_with_http_info(path, parameters, body, request_options)
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
end

#custom_put_with_http_info(path, parameters = nil, body = nil, request_options = {}) ⇒ Http::Response

Returns the response.

Parameters:

  • path (String)

    Path of the endpoint, anything after "/1" must be specified. (required)

  • parameters (Hash<String, Object>) (defaults to: nil)

    Query parameters to apply to the current query.

  • body (Object) (defaults to: nil)

    Parameters to send with the custom request.

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/algolia/api/query_suggestions_client.rb', line 240

def custom_put_with_http_info(path, parameters = nil, body = nil, request_options = {})
  # verify the required parameter 'path' is set
  if @api_client.config.client_side_validation && path.nil?
    raise ArgumentError, "Parameter `path` is required when calling `custom_put`."
  end

  path = "/{path}".sub("{" + "path" + "}", path.to_s)
  query_params = {}
  query_params = query_params.merge(parameters) unless parameters.nil?
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body] || @api_client.object_to_http_body(body)

  new_options = request_options.merge(
    :operation => :"QuerySuggestionsClient.custom_put",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:PUT, path, new_options)
end

#delete_config(index_name, request_options = {}) ⇒ BaseResponse

Deletes a Query Suggestions configuration. Deleting only removes the configuration and stops updates to the Query Suggestions index. To delete the Query Suggestions index itself, use the Search API and the ‘Delete an index` operation.

Required API Key ACLs:

- editSettings

Parameters:

  • index_name (String)

    Query Suggestions index name. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (BaseResponse)


317
318
319
320
# File 'lib/algolia/api/query_suggestions_client.rb', line 317

def delete_config(index_name, request_options = {})
  response = delete_config_with_http_info(index_name, request_options)
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "QuerySuggestions::BaseResponse")
end

#delete_config_with_http_info(index_name, request_options = {}) ⇒ Http::Response

Deletes a Query Suggestions configuration. Deleting only removes the configuration and stops updates to the Query Suggestions index. To delete the Query Suggestions index itself, use the Search API and the ‘Delete an index` operation.

Required API Key ACLs:

- editSettings

Parameters:

  • index_name (String)

    Query Suggestions index name. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# File 'lib/algolia/api/query_suggestions_client.rb', line 285

def delete_config_with_http_info(index_name, request_options = {})
  # verify the required parameter 'index_name' is set
  if @api_client.config.client_side_validation && index_name.nil?
    raise ArgumentError, "Parameter `index_name` is required when calling `delete_config`."
  end

  path = "/1/configs/{indexName}".sub("{" + "indexName" + "}", Transport.encode_uri(index_name.to_s))
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"QuerySuggestionsClient.delete_config",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:DELETE, path, new_options)
end

#get_all_configs(request_options = {}) ⇒ Array<ConfigurationResponse>

Retrieves all Query Suggestions configurations of your Algolia application.

Required API Key ACLs:

- settings

Parameters:

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (Array<ConfigurationResponse>)


354
355
356
357
358
359
360
# File 'lib/algolia/api/query_suggestions_client.rb', line 354

def get_all_configs(request_options = {})
  response = get_all_configs_with_http_info(request_options)
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "Array<QuerySuggestions::ConfigurationResponse>"
  )
end

#get_all_configs_with_http_info(request_options = {}) ⇒ Http::Response

Retrieves all Query Suggestions configurations of your Algolia application.

Required API Key ACLs:

- settings

Parameters:

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/algolia/api/query_suggestions_client.rb', line 328

def get_all_configs_with_http_info(request_options = {})
  path = "/1/configs"
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"QuerySuggestionsClient.get_all_configs",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:GET, path, new_options)
end

#get_config(index_name, request_options = {}) ⇒ ConfigurationResponse

Retrieves a single Query Suggestions configuration by its index name.

Required API Key ACLs:

- settings

Parameters:

  • index_name (String)

    Query Suggestions index name. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (ConfigurationResponse)


401
402
403
404
405
406
407
# File 'lib/algolia/api/query_suggestions_client.rb', line 401

def get_config(index_name, request_options = {})
  response = get_config_with_http_info(index_name, request_options)
  @api_client.deserialize(
    response.body,
    request_options[:debug_return_type] || "QuerySuggestions::ConfigurationResponse"
  )
end

#get_config_status(index_name, request_options = {}) ⇒ ConfigStatus

Reports the status of a Query Suggestions index.

Required API Key ACLs:

- settings

Parameters:

  • index_name (String)

    Query Suggestions index name. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (ConfigStatus)


448
449
450
451
# File 'lib/algolia/api/query_suggestions_client.rb', line 448

def get_config_status(index_name, request_options = {})
  response = get_config_status_with_http_info(index_name, request_options)
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "QuerySuggestions::ConfigStatus")
end

#get_config_status_with_http_info(index_name, request_options = {}) ⇒ Http::Response

Reports the status of a Query Suggestions index.

Required API Key ACLs:

- settings

Parameters:

  • index_name (String)

    Query Suggestions index name. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
# File 'lib/algolia/api/query_suggestions_client.rb', line 416

def get_config_status_with_http_info(index_name, request_options = {})
  # verify the required parameter 'index_name' is set
  if @api_client.config.client_side_validation && index_name.nil?
    raise ArgumentError, "Parameter `index_name` is required when calling `get_config_status`."
  end

  path = "/1/configs/{indexName}/status".sub("{" + "indexName" + "}", Transport.encode_uri(index_name.to_s))
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"QuerySuggestionsClient.get_config_status",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:GET, path, new_options)
end

#get_config_with_http_info(index_name, request_options = {}) ⇒ Http::Response

Retrieves a single Query Suggestions configuration by its index name.

Required API Key ACLs:

- settings

Parameters:

  • index_name (String)

    Query Suggestions index name. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
# File 'lib/algolia/api/query_suggestions_client.rb', line 369

def get_config_with_http_info(index_name, request_options = {})
  # verify the required parameter 'index_name' is set
  if @api_client.config.client_side_validation && index_name.nil?
    raise ArgumentError, "Parameter `index_name` is required when calling `get_config`."
  end

  path = "/1/configs/{indexName}".sub("{" + "indexName" + "}", Transport.encode_uri(index_name.to_s))
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"QuerySuggestionsClient.get_config",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:GET, path, new_options)
end

#get_log_file(index_name, request_options = {}) ⇒ LogFile

Retrieves the logs for a single Query Suggestions index.

Required API Key ACLs:

- settings

Parameters:

  • index_name (String)

    Query Suggestions index name. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (LogFile)


492
493
494
495
# File 'lib/algolia/api/query_suggestions_client.rb', line 492

def get_log_file(index_name, request_options = {})
  response = get_log_file_with_http_info(index_name, request_options)
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "QuerySuggestions::LogFile")
end

#get_log_file_with_http_info(index_name, request_options = {}) ⇒ Http::Response

Retrieves the logs for a single Query Suggestions index.

Required API Key ACLs:

- settings

Parameters:

  • index_name (String)

    Query Suggestions index name. (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
# File 'lib/algolia/api/query_suggestions_client.rb', line 460

def get_log_file_with_http_info(index_name, request_options = {})
  # verify the required parameter 'index_name' is set
  if @api_client.config.client_side_validation && index_name.nil?
    raise ArgumentError, "Parameter `index_name` is required when calling `get_log_file`."
  end

  path = "/1/logs/{indexName}".sub("{" + "indexName" + "}", Transport.encode_uri(index_name.to_s))
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body]

  new_options = request_options.merge(
    :operation => :"QuerySuggestionsClient.get_log_file",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:GET, path, new_options)
end

#set_client_api_key(api_key) ⇒ void

This method returns an undefined value.

Helper method to switch the API key used to authenticate the requests.

Parameters:

  • api_key (String)

    the new API key to use.



46
47
48
49
50
# File 'lib/algolia/api/query_suggestions_client.rb', line 46

def set_client_api_key(api_key)
  @api_client.set_client_api_key(api_key)

  self
end

#update_config(index_name, configuration, request_options = {}) ⇒ BaseResponse

Updates a QuerySuggestions configuration.

Required API Key ACLs:

- editSettings

Parameters:

  • index_name (String)

    Query Suggestions index name. (required)

  • configuration (Configuration)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:

  • (BaseResponse)


542
543
544
545
# File 'lib/algolia/api/query_suggestions_client.rb', line 542

def update_config(index_name, configuration, request_options = {})
  response = update_config_with_http_info(index_name, configuration, request_options)
  @api_client.deserialize(response.body, request_options[:debug_return_type] || "QuerySuggestions::BaseResponse")
end

#update_config_with_http_info(index_name, configuration, request_options = {}) ⇒ Http::Response

Updates a QuerySuggestions configuration.

Required API Key ACLs:

- editSettings

Parameters:

  • index_name (String)

    Query Suggestions index name. (required)

  • configuration (Configuration)

    (required)

  • request_options:

    The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)

Returns:



505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
# File 'lib/algolia/api/query_suggestions_client.rb', line 505

def update_config_with_http_info(index_name, configuration, request_options = {})
  # verify the required parameter 'index_name' is set
  if @api_client.config.client_side_validation && index_name.nil?
    raise ArgumentError, "Parameter `index_name` is required when calling `update_config`."
  end
  # verify the required parameter 'configuration' is set
  if @api_client.config.client_side_validation && configuration.nil?
    raise ArgumentError, "Parameter `configuration` is required when calling `update_config`."
  end

  path = "/1/configs/{indexName}".sub("{" + "indexName" + "}", Transport.encode_uri(index_name.to_s))
  query_params = {}
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
  header_params = {}
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?

  post_body = request_options[:debug_body] || @api_client.object_to_http_body(configuration)

  new_options = request_options.merge(
    :operation => :"QuerySuggestionsClient.update_config",
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :use_read_transporter => false
  )

  @api_client.call_api(:PUT, path, new_options)
end