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
# 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

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

  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



32
33
34
# File 'lib/algolia/api/query_suggestions_client.rb', line 32

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

Instance Method Details

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

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

Required API Key ACLs:

- editSettings

Parameters:

  • query_suggestions_configuration_with_index (QuerySuggestionsConfigurationWithIndex)

    (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)


75
76
77
78
# File 'lib/algolia/api/query_suggestions_client.rb', line 75

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

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

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

Required API Key ACLs:

- editSettings

Parameters:

  • query_suggestions_configuration_with_index (QuerySuggestionsConfigurationWithIndex)

    (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:



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/algolia/api/query_suggestions_client.rb', line 43

def create_config_with_http_info(query_suggestions_configuration_with_index, request_options = {})
  # verify the required parameter 'query_suggestions_configuration_with_index' is set
  if @api_client.config.client_side_validation && query_suggestions_configuration_with_index.nil?
    raise ArgumentError, "Parameter `query_suggestions_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(query_suggestions_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 &quot;/1&quot; 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)


118
119
120
121
# File 'lib/algolia/api/query_suggestions_client.rb', line 118

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 &quot;/1&quot; 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:



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

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 = '/1{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 &quot;/1&quot; 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)


161
162
163
164
# File 'lib/algolia/api/query_suggestions_client.rb', line 161

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 &quot;/1&quot; 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:



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/algolia/api/query_suggestions_client.rb', line 129

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 = '/1{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 &quot;/1&quot; 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)


206
207
208
209
# File 'lib/algolia/api/query_suggestions_client.rb', line 206

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 &quot;/1&quot; 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:



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/algolia/api/query_suggestions_client.rb', line 173

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 = '/1{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 &quot;/1&quot; 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)


251
252
253
254
# File 'lib/algolia/api/query_suggestions_client.rb', line 251

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 &quot;/1&quot; 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:



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/algolia/api/query_suggestions_client.rb', line 218

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 = '/1{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

Delete a Query Suggestions configuration. Deleting only removes the configuration and stops updates to the Query Suggestions index. The Query Suggestions index itself is not deleted.

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)


295
296
297
298
# File 'lib/algolia/api/query_suggestions_client.rb', line 295

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

Delete a Query Suggestions configuration. Deleting only removes the configuration and stops updates to the Query Suggestions index. The Query Suggestions index itself is not deleted.

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:



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/algolia/api/query_suggestions_client.rb', line 263

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<QuerySuggestionsConfigurationResponse>

List 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<QuerySuggestionsConfigurationResponse>)


332
333
334
335
# File 'lib/algolia/api/query_suggestions_client.rb', line 332

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::QuerySuggestionsConfigurationResponse>')
end

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

List 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:



306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# File 'lib/algolia/api/query_suggestions_client.rb', line 306

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

Get a single Query Suggestions configuration.

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:

  • (QuerySuggestionsConfigurationResponse)


376
377
378
379
# File 'lib/algolia/api/query_suggestions_client.rb', line 376

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::QuerySuggestionsConfigurationResponse')
end

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

Report 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:

  • (GetConfigStatus200Response)


420
421
422
423
# File 'lib/algolia/api/query_suggestions_client.rb', line 420

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::GetConfigStatus200Response')
end

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

Report 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:



388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
# File 'lib/algolia/api/query_suggestions_client.rb', line 388

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

Get a single Query Suggestions configuration.

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:



344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
# File 'lib/algolia/api/query_suggestions_client.rb', line 344

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

Get 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:

  • (GetLogFile200Response)


464
465
466
467
# File 'lib/algolia/api/query_suggestions_client.rb', line 464

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::GetLogFile200Response')
end

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

Get 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:



432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# File 'lib/algolia/api/query_suggestions_client.rb', line 432

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

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

Update a QuerySuggestions configuration.

Required API Key ACLs:

- editSettings

Parameters:

  • index_name (String)

    Query Suggestions index name. (required)

  • query_suggestions_configuration (QuerySuggestionsConfiguration)

    (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)


514
515
516
517
# File 'lib/algolia/api/query_suggestions_client.rb', line 514

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

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

Update a QuerySuggestions configuration.

Required API Key ACLs:

- editSettings

Parameters:

  • index_name (String)

    Query Suggestions index name. (required)

  • query_suggestions_configuration (QuerySuggestionsConfiguration)

    (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:



477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
# File 'lib/algolia/api/query_suggestions_client.rb', line 477

def update_config_with_http_info(index_name, query_suggestions_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 'query_suggestions_configuration' is set
  if @api_client.config.client_side_validation && query_suggestions_configuration.nil?
    raise ArgumentError, "Parameter `query_suggestions_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(query_suggestions_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