algolia 3.0.0.beta.6 → 3.0.0.beta.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b052211b4a0ecb74c42f11d50147460cf98a1aae441095e4c421800d611c1f0c
4
- data.tar.gz: ce30bdefbd8703da5fc943ebdd24126874c05ad78368212e19e70138eea52f9e
3
+ metadata.gz: df1df29d4bb320313ff2e7f0c05a4b76a3d6188b9f08a692af7403dc6d99472b
4
+ data.tar.gz: 9b18848ff6241cde6f18523aa706303a4c74c4ec067631c922eecadc28d4c0be
5
5
  SHA512:
6
- metadata.gz: 735dc36265137ffee7456a8cd0cfeb5c6607e56c71bb7595b9c113780661d24d48c2f9f37c8053dc9f5928097beb925a6211107c08f2a01d664e101c5795a346
7
- data.tar.gz: ca760e5f13736c3ea825087a46bc9cc4013c98223700c5d140a412eac63559c746d62ca3d07aed6fef9663cf89ad0a349f9e627cd3fdea3608a70d619bdc470e
6
+ metadata.gz: 78c85cc136bdf8d52e43bc14a98c1c7ed54b0c0aa79ebf064610b0a658cb1eca4ec895fc31afbef3f7a8f618303336e339a09b82decc9c2fd2e4d5e91fd1978e
7
+ data.tar.gz: e13c8fcbc458cbaf053f88e3ccf6e87c1744d6dc91947f62a443b3d73aa3c254dc5ccc14adfe8b33c1648a50cd64ecef96f3b6a9975f4d66eb3c0767c5064bbb
@@ -24,4 +24,4 @@ jobs:
24
24
  ruby-version: 3.2.2
25
25
  bundler-cache: true
26
26
 
27
- - uses: rubygems/release-gem@v1
27
+ - uses: rubygems/release-gem@612653d273a73bdae1df8453e090060bb4db5f31
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [3.0.0.beta.8](https://github.com/algolia/algoliasearch-client-ruby/compare/3.0.0.beta.7...3.0.0.beta.8)
2
+
3
+ - [9776cb3ba](https://github.com/algolia/api-clients-automation/commit/9776cb3ba) feat(specs): add redirect to renderingContent ([#3296](https://github.com/algolia/api-clients-automation/pull/3296)) by [@shortcuts](https://github.com/shortcuts/)
4
+
5
+ ## [3.0.0.beta.7](https://github.com/algolia/algoliasearch-client-ruby/compare/3.0.0.beta.6...3.0.0.beta.7)
6
+
7
+ - [95e4c1e17](https://github.com/algolia/api-clients-automation/commit/95e4c1e17) chore(ruby): scope to last commit ([#3266](https://github.com/algolia/api-clients-automation/pull/3266)) by [@shortcuts](https://github.com/shortcuts/)
8
+ - [8e98407c1](https://github.com/algolia/api-clients-automation/commit/8e98407c1) fix(clients): update ingestion transformations description and fix taggroups ([#3265](https://github.com/algolia/api-clients-automation/pull/3265)) by [@shortcuts](https://github.com/shortcuts/)
9
+
1
10
  ## [3.0.0.beta.6](https://github.com/algolia/algoliasearch-client-ruby/compare/3.0.0.beta.5...3.0.0.beta.6)
2
11
 
3
12
  - [e5cfcf0c4](https://github.com/algolia/api-clients-automation/commit/e5cfcf0c4) feat(clients): generate common LICENSE ([#3258](https://github.com/algolia/api-clients-automation/pull/3258)) by [@shortcuts](https://github.com/shortcuts/)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- algolia (3.0.0.beta.6)
4
+ algolia (3.0.0.beta.8)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-net_http_persistent (>= 0.15, < 3)
7
7
  net-http-persistent
@@ -1934,7 +1934,7 @@ module Algolia
1934
1934
  @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Ingestion::SourceWatchResponse')
1935
1935
  end
1936
1936
 
1937
- # Searches for transformations.
1937
+ # Try a transformation.
1938
1938
  #
1939
1939
  # Required API Key ACLs:
1940
1940
  # - addObject
@@ -1968,7 +1968,7 @@ module Algolia
1968
1968
  @api_client.call_api(:POST, path, new_options)
1969
1969
  end
1970
1970
 
1971
- # Searches for transformations.
1971
+ # Try a transformation.
1972
1972
  #
1973
1973
  # Required API Key ACLs:
1974
1974
  # - addObject
@@ -37,13 +37,13 @@ module Algolia
37
37
  #
38
38
  # Required API Key ACLs:
39
39
  # - editSettings
40
- # @param query_suggestions_configuration_with_index [QuerySuggestionsConfigurationWithIndex] (required)
40
+ # @param configuration_with_index [ConfigurationWithIndex] (required)
41
41
  # @param 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)
42
42
  # @return [Http::Response] the response
43
- def create_config_with_http_info(query_suggestions_configuration_with_index, request_options = {})
44
- # verify the required parameter 'query_suggestions_configuration_with_index' is set
45
- if @api_client.config.client_side_validation && query_suggestions_configuration_with_index.nil?
46
- raise ArgumentError, "Parameter `query_suggestions_configuration_with_index` is required when calling `create_config`."
43
+ def create_config_with_http_info(configuration_with_index, request_options = {})
44
+ # verify the required parameter 'configuration_with_index' is set
45
+ if @api_client.config.client_side_validation && configuration_with_index.nil?
46
+ raise ArgumentError, "Parameter `configuration_with_index` is required when calling `create_config`."
47
47
  end
48
48
 
49
49
  path = '/1/configs'
@@ -52,7 +52,7 @@ module Algolia
52
52
  header_params = {}
53
53
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
54
54
 
55
- post_body = request_options[:debug_body] || @api_client.object_to_http_body(query_suggestions_configuration_with_index)
55
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(configuration_with_index)
56
56
 
57
57
  new_options = request_options.merge(
58
58
  :operation => :'QuerySuggestionsClient.create_config',
@@ -69,11 +69,11 @@ module Algolia
69
69
  #
70
70
  # Required API Key ACLs:
71
71
  # - editSettings
72
- # @param query_suggestions_configuration_with_index [QuerySuggestionsConfigurationWithIndex] (required)
72
+ # @param configuration_with_index [ConfigurationWithIndex] (required)
73
73
  # @param 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)
74
74
  # @return [BaseResponse]
75
- def create_config(query_suggestions_configuration_with_index, request_options = {})
76
- response = create_config_with_http_info(query_suggestions_configuration_with_index, request_options)
75
+ def create_config(configuration_with_index, request_options = {})
76
+ response = create_config_with_http_info(configuration_with_index, request_options)
77
77
  @api_client.deserialize(response.body, request_options[:debug_return_type] || 'QuerySuggestions::BaseResponse')
78
78
  end
79
79
 
@@ -328,10 +328,10 @@ module Algolia
328
328
  # Required API Key ACLs:
329
329
  # - settings
330
330
  # @param 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)
331
- # @return [Array<QuerySuggestionsConfigurationResponse>]
331
+ # @return [Array<ConfigurationResponse>]
332
332
  def get_all_configs(request_options = {})
333
333
  response = get_all_configs_with_http_info(request_options)
334
- @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Array<QuerySuggestions::QuerySuggestionsConfigurationResponse>')
334
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'Array<QuerySuggestions::ConfigurationResponse>')
335
335
  end
336
336
 
337
337
  # Retrieves a single Query Suggestions configuration by its index name.
@@ -372,10 +372,10 @@ module Algolia
372
372
  # - settings
373
373
  # @param index_name [String] Query Suggestions index name. (required)
374
374
  # @param 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)
375
- # @return [QuerySuggestionsConfigurationResponse]
375
+ # @return [ConfigurationResponse]
376
376
  def get_config(index_name, request_options = {})
377
377
  response = get_config_with_http_info(index_name, request_options)
378
- @api_client.deserialize(response.body, request_options[:debug_return_type] || 'QuerySuggestions::QuerySuggestionsConfigurationResponse')
378
+ @api_client.deserialize(response.body, request_options[:debug_return_type] || 'QuerySuggestions::ConfigurationResponse')
379
379
  end
380
380
 
381
381
  # Reports the status of a Query Suggestions index.
@@ -471,17 +471,17 @@ module Algolia
471
471
  # Required API Key ACLs:
472
472
  # - editSettings
473
473
  # @param index_name [String] Query Suggestions index name. (required)
474
- # @param query_suggestions_configuration [QuerySuggestionsConfiguration] (required)
474
+ # @param configuration [Configuration] (required)
475
475
  # @param 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)
476
476
  # @return [Http::Response] the response
477
- def update_config_with_http_info(index_name, query_suggestions_configuration, request_options = {})
477
+ def update_config_with_http_info(index_name, configuration, request_options = {})
478
478
  # verify the required parameter 'index_name' is set
479
479
  if @api_client.config.client_side_validation && index_name.nil?
480
480
  raise ArgumentError, "Parameter `index_name` is required when calling `update_config`."
481
481
  end
482
- # verify the required parameter 'query_suggestions_configuration' is set
483
- if @api_client.config.client_side_validation && query_suggestions_configuration.nil?
484
- raise ArgumentError, "Parameter `query_suggestions_configuration` is required when calling `update_config`."
482
+ # verify the required parameter 'configuration' is set
483
+ if @api_client.config.client_side_validation && configuration.nil?
484
+ raise ArgumentError, "Parameter `configuration` is required when calling `update_config`."
485
485
  end
486
486
 
487
487
  path = '/1/configs/{indexName}'.sub('{' + 'indexName' + '}', Transport.encode_uri(index_name.to_s))
@@ -490,7 +490,7 @@ module Algolia
490
490
  header_params = {}
491
491
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
492
492
 
493
- post_body = request_options[:debug_body] || @api_client.object_to_http_body(query_suggestions_configuration)
493
+ post_body = request_options[:debug_body] || @api_client.object_to_http_body(configuration)
494
494
 
495
495
  new_options = request_options.merge(
496
496
  :operation => :'QuerySuggestionsClient.update_config',
@@ -508,11 +508,11 @@ module Algolia
508
508
  # Required API Key ACLs:
509
509
  # - editSettings
510
510
  # @param index_name [String] Query Suggestions index name. (required)
511
- # @param query_suggestions_configuration [QuerySuggestionsConfiguration] (required)
511
+ # @param configuration [Configuration] (required)
512
512
  # @param 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)
513
513
  # @return [BaseResponse]
514
- def update_config(index_name, query_suggestions_configuration, request_options = {})
515
- response = update_config_with_http_info(index_name, query_suggestions_configuration, request_options)
514
+ def update_config(index_name, configuration, request_options = {})
515
+ response = update_config_with_http_info(index_name, configuration, request_options)
516
516
  @api_client.deserialize(response.body, request_options[:debug_return_type] || 'QuerySuggestions::BaseResponse')
517
517
  end
518
518
  end
@@ -0,0 +1,258 @@
1
+ # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
2
+
3
+ require 'date'
4
+ require 'time'
5
+
6
+ module Algolia
7
+ module QuerySuggestions
8
+ # Query Suggestions configuration.
9
+ class Configuration
10
+ # Algolia indices from which to get the popular searches for query suggestions.
11
+ attr_accessor :source_indices
12
+
13
+ attr_accessor :languages
14
+
15
+ attr_accessor :exclude
16
+
17
+ # Whether to turn on personalized query suggestions.
18
+ attr_accessor :enable_personalization
19
+
20
+ # Whether to include suggestions with special characters.
21
+ attr_accessor :allow_special_characters
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :source_indices => :sourceIndices,
27
+ :languages => :languages,
28
+ :exclude => :exclude,
29
+ :enable_personalization => :enablePersonalization,
30
+ :allow_special_characters => :allowSpecialCharacters
31
+ }
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.types_mapping
41
+ {
42
+ :source_indices => :'Array<SourceIndex>',
43
+ :languages => :Languages,
44
+ :exclude => :'Array<String>',
45
+ :enable_personalization => :Boolean,
46
+ :allow_special_characters => :Boolean
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ :exclude
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ unless attributes.is_a?(Hash)
61
+ raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::Configuration` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) do |(k, v), h|
66
+ unless self.class.attribute_map.key?(k.to_sym)
67
+ raise ArgumentError,
68
+ "`#{k}` is not a valid attribute in `Algolia::Configuration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
69
+ end
70
+
71
+ h[k.to_sym] = v
72
+ end
73
+
74
+ if attributes.key?(:source_indices)
75
+ if (value = attributes[:source_indices]).is_a?(Array)
76
+ self.source_indices = value
77
+ end
78
+ else
79
+ self.source_indices = nil
80
+ end
81
+
82
+ if attributes.key?(:languages)
83
+ self.languages = attributes[:languages]
84
+ end
85
+
86
+ if attributes.key?(:exclude)
87
+ if (value = attributes[:exclude]).is_a?(Array)
88
+ self.exclude = value
89
+ end
90
+ end
91
+
92
+ if attributes.key?(:enable_personalization)
93
+ self.enable_personalization = attributes[:enable_personalization]
94
+ end
95
+
96
+ if attributes.key?(:allow_special_characters)
97
+ self.allow_special_characters = attributes[:allow_special_characters]
98
+ end
99
+ end
100
+
101
+ # Custom attribute writer method with validation
102
+ # @param [Object] source_indices Value to be assigned
103
+ def source_indices=(source_indices)
104
+ if source_indices.nil?
105
+ raise ArgumentError, 'source_indices cannot be nil'
106
+ end
107
+
108
+ if source_indices.length < 1
109
+ raise ArgumentError, 'invalid value for "source_indices", number of items must be greater than or equal to 1.'
110
+ end
111
+
112
+ @source_indices = source_indices
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(other)
118
+ return true if equal?(other)
119
+
120
+ self.class == other.class &&
121
+ source_indices == other.source_indices &&
122
+ languages == other.languages &&
123
+ exclude == other.exclude &&
124
+ enable_personalization == other.enable_personalization &&
125
+ allow_special_characters == other.allow_special_characters
126
+ end
127
+
128
+ # @see the `==` method
129
+ # @param [Object] Object to be compared
130
+ def eql?(other)
131
+ self == other
132
+ end
133
+
134
+ # Calculates hash code according to all attributes.
135
+ # @return [Integer] Hash code
136
+ def hash
137
+ [source_indices, languages, exclude, enable_personalization, allow_special_characters].hash
138
+ end
139
+
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
143
+ def self.build_from_hash(attributes)
144
+ return nil unless attributes.is_a?(Hash)
145
+
146
+ attributes = attributes.transform_keys(&:to_sym)
147
+ transformed_hash = {}
148
+ types_mapping.each_pair do |key, type|
149
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
150
+ transformed_hash[key.to_sym] = nil
151
+ elsif type =~ /\AArray<(.*)>/i
152
+ # check to ensure the input is an array given that the attribute
153
+ # is documented as an array but the input is not
154
+ if attributes[attribute_map[key]].is_a?(Array)
155
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
156
+ end
157
+ elsif !attributes[attribute_map[key]].nil?
158
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
159
+ end
160
+ end
161
+ new(transformed_hash)
162
+ end
163
+
164
+ # Deserializes the data based on type
165
+ # @param string type Data type
166
+ # @param string value Value to be deserialized
167
+ # @return [Object] Deserialized data
168
+ def self._deserialize(type, value)
169
+ case type.to_sym
170
+ when :Time
171
+ Time.parse(value)
172
+ when :Date
173
+ Date.parse(value)
174
+ when :String
175
+ value.to_s
176
+ when :Integer
177
+ value.to_i
178
+ when :Float
179
+ value.to_f
180
+ when :Boolean
181
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
182
+ true
183
+ else
184
+ false
185
+ end
186
+ when :Object
187
+ # generic object (usually a Hash), return directly
188
+ value
189
+ when /\AArray<(?<inner_type>.+)>\z/
190
+ inner_type = Regexp.last_match[:inner_type]
191
+ value.map { |v| _deserialize(inner_type, v) }
192
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
193
+ k_type = Regexp.last_match[:k_type]
194
+ v_type = Regexp.last_match[:v_type]
195
+ {}.tap do |hash|
196
+ value.each do |k, v|
197
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
198
+ end
199
+ end
200
+ else # model
201
+ # models (e.g. Pet) or oneOf
202
+ klass = Algolia::QuerySuggestions.const_get(type)
203
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
204
+ end
205
+ end
206
+
207
+ # Returns the string representation of the object
208
+ # @return [String] String presentation of the object
209
+ def to_s
210
+ to_hash.to_s
211
+ end
212
+
213
+ # to_body is an alias to to_hash (backward compatibility)
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_body
216
+ to_hash
217
+ end
218
+
219
+ def to_json(*_args)
220
+ to_hash.to_json
221
+ end
222
+
223
+ # Returns the object in the form of hash
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_hash
226
+ hash = {}
227
+ self.class.attribute_map.each_pair do |attr, param|
228
+ value = send(attr)
229
+ if value.nil?
230
+ is_nullable = self.class.openapi_nullable.include?(attr)
231
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
232
+ end
233
+
234
+ hash[param] = _to_hash(value)
235
+ end
236
+ hash
237
+ end
238
+
239
+ # Outputs non-array value in the form of hash
240
+ # For object, use to_hash. Otherwise, just return the value
241
+ # @param [Object] value Any valid value
242
+ # @return [Hash] Returns the value in the form of hash
243
+ def _to_hash(value)
244
+ if value.is_a?(Array)
245
+ value.compact.map { |v| _to_hash(v) }
246
+ elsif value.is_a?(Hash)
247
+ {}.tap do |hash|
248
+ value.each { |k, v| hash[k] = _to_hash(v) }
249
+ end
250
+ elsif value.respond_to? :to_hash
251
+ value.to_hash
252
+ else
253
+ value
254
+ end
255
+ end
256
+ end
257
+ end
258
+ end