algolia 3.23.0 → 3.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9fff1502a30fce45ad42d7166299524a573e06053f830fa1f18651e541e4dbdb
4
- data.tar.gz: 76b07e570220ca1cb5afd4ce7c82d103f83cc40dbb0a52aeccfdfa341689d4bf
3
+ metadata.gz: 98922e2955f34bbd0985980254a793abbf9d850500ca599bb873cc8527ace278
4
+ data.tar.gz: ffc863df89f0187c6d44fe1528e5d5bed7d1c1aa5b8249b9820a8849eab79579
5
5
  SHA512:
6
- metadata.gz: c423ef6ca5a1b550eb3f54668e42df002f9e4355e0db592274814e21ea1670660c24a64cce4352580877cd0ace43d623aba790efaacec671e4a5ac3ee9abdb83
7
- data.tar.gz: 017a0a4378f8d441486bc6fc9a94b254a0a02d692362bf89c063e4f3f4df1f8e00bf3a4aa4080307477f8444a1760a2d55d65335b8786c2cc80356390f85355d
6
+ metadata.gz: f68ad7647ec8f2b8b07322bf3cd93e561c8f320d22f710885720a5b7d3af911316a37ffbe939632794a7c48a200d5e1a64a3b355be732394a98873424e04f8f5
7
+ data.tar.gz: d520b06148c6b2229d38f1c4c9e2d94e6f5138e19b776e47b55b7eceaf43325262c815ffc54ce15efb44fae83adbdddcf70e169ecc7f917a63422590a9ba6dd6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [3.24.0](https://github.com/algolia/algoliasearch-client-ruby/compare/3.23.0...3.24.0)
2
+
3
+ - [48672036c1](https://github.com/algolia/api-clients-automation/commit/48672036c1) refactor(specs): mutualise code between Search API & Comp API for search query parameters ([#5125](https://github.com/algolia/api-clients-automation/pull/5125)) by [@ClaraMuller](https://github.com/ClaraMuller/)
4
+ - [99f8174c7d](https://github.com/algolia/api-clients-automation/commit/99f8174c7d) feat(specs): add fields for metadata in composition injectedItems ([#5241](https://github.com/algolia/api-clients-automation/pull/5241)) by [@gavinwade12](https://github.com/gavinwade12/)
5
+ - [ff178d8118](https://github.com/algolia/api-clients-automation/commit/ff178d8118) feat(specs): abtests stopped at ([#5275](https://github.com/algolia/api-clients-automation/pull/5275)) by [@stevenMevans](https://github.com/stevenMevans/)
6
+
1
7
  ## [3.23.0](https://github.com/algolia/algoliasearch-client-ruby/compare/3.22.1...3.23.0)
2
8
 
3
9
  - [050aacef17](https://github.com/algolia/api-clients-automation/commit/050aacef17) chore(deps): dependencies 2025-07-28 ([#5161](https://github.com/algolia/api-clients-automation/pull/5161)) by [@algolia-bot](https://github.com/algolia-bot/)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- algolia (3.23.0)
4
+ algolia (3.24.0)
5
5
  base64 (>= 0.2.0, < 1)
6
6
  faraday (>= 1.0.1, < 3.0)
7
7
  faraday-net_http_persistent (>= 0.15, < 3)
@@ -30,6 +30,9 @@ module Algolia
30
30
  # End date and time of the A/B test, in RFC 3339 format.
31
31
  attr_accessor :end_at
32
32
 
33
+ # Date and time when the A/B test was stopped, in RFC 3339 format.
34
+ attr_accessor :stopped_at
35
+
33
36
  # A/B test name.
34
37
  attr_accessor :name
35
38
 
@@ -52,6 +55,7 @@ module Algolia
52
55
  :updated_at => :updatedAt,
53
56
  :created_at => :createdAt,
54
57
  :end_at => :endAt,
58
+ :stopped_at => :stoppedAt,
55
59
  :name => :name,
56
60
  :status => :status,
57
61
  :variants => :variants,
@@ -71,6 +75,7 @@ module Algolia
71
75
  :updated_at => :"String",
72
76
  :created_at => :"String",
73
77
  :end_at => :"String",
78
+ :stopped_at => :"String",
74
79
  :name => :"String",
75
80
  :status => :"Status",
76
81
  :variants => :"Array<Variant>",
@@ -86,7 +91,8 @@ module Algolia
86
91
  :conversion_significance,
87
92
  :add_to_cart_significance,
88
93
  :purchase_significance,
89
- :revenue_significance
94
+ :revenue_significance,
95
+ :stopped_at
90
96
  ]
91
97
  )
92
98
  end
@@ -157,6 +163,10 @@ module Algolia
157
163
  self.end_at = nil
158
164
  end
159
165
 
166
+ if attributes.key?(:stopped_at)
167
+ self.stopped_at = attributes[:stopped_at]
168
+ end
169
+
160
170
  if attributes.key?(:name)
161
171
  self.name = attributes[:name]
162
172
  else
@@ -196,6 +206,7 @@ module Algolia
196
206
  updated_at == other.updated_at &&
197
207
  created_at == other.created_at &&
198
208
  end_at == other.end_at &&
209
+ stopped_at == other.stopped_at &&
199
210
  name == other.name &&
200
211
  status == other.status &&
201
212
  variants == other.variants &&
@@ -221,6 +232,7 @@ module Algolia
221
232
  updated_at,
222
233
  created_at,
223
234
  end_at,
235
+ stopped_at,
224
236
  name,
225
237
  status,
226
238
  variants,
@@ -20,6 +20,9 @@ module Algolia
20
20
  # End date and time of the A/B test, in RFC 3339 format.
21
21
  attr_accessor :end_at
22
22
 
23
+ # Date and time when the A/B test was stopped, in RFC 3339 format.
24
+ attr_accessor :stopped_at
25
+
23
26
  # A/B test name.
24
27
  attr_accessor :name
25
28
 
@@ -40,6 +43,7 @@ module Algolia
40
43
  :updated_at => :updatedAt,
41
44
  :created_at => :createdAt,
42
45
  :end_at => :endAt,
46
+ :stopped_at => :stoppedAt,
43
47
  :name => :name,
44
48
  :status => :status,
45
49
  :variants => :variants,
@@ -55,6 +59,7 @@ module Algolia
55
59
  :updated_at => :"String",
56
60
  :created_at => :"String",
57
61
  :end_at => :"String",
62
+ :stopped_at => :"String",
58
63
  :name => :"String",
59
64
  :status => :"Status",
60
65
  :variants => :"Array<Variant>",
@@ -66,7 +71,9 @@ module Algolia
66
71
  # List of attributes with nullable: true
67
72
  def self.openapi_nullable
68
73
  Set.new(
69
- []
74
+ [
75
+ :stopped_at
76
+ ]
70
77
  )
71
78
  end
72
79
 
@@ -114,6 +121,10 @@ module Algolia
114
121
  self.end_at = nil
115
122
  end
116
123
 
124
+ if attributes.key?(:stopped_at)
125
+ self.stopped_at = attributes[:stopped_at]
126
+ end
127
+
117
128
  if attributes.key?(:name)
118
129
  self.name = attributes[:name]
119
130
  else
@@ -152,6 +163,7 @@ module Algolia
152
163
  updated_at == other.updated_at &&
153
164
  created_at == other.created_at &&
154
165
  end_at == other.end_at &&
166
+ stopped_at == other.stopped_at &&
155
167
  name == other.name &&
156
168
  status == other.status &&
157
169
  variants == other.variants &&
@@ -168,7 +180,18 @@ module Algolia
168
180
  # Calculates hash code according to all attributes.
169
181
  # @return [Integer] Hash code
170
182
  def hash
171
- [ab_test_id, updated_at, created_at, end_at, name, status, variants, configuration, migrated_ab_test_id].hash
183
+ [
184
+ ab_test_id,
185
+ updated_at,
186
+ created_at,
187
+ end_at,
188
+ stopped_at,
189
+ name,
190
+ status,
191
+ variants,
192
+ configuration,
193
+ migrated_ab_test_id
194
+ ].hash
172
195
  end
173
196
 
174
197
  # Builds the object from hash
@@ -22,6 +22,8 @@ module Algolia
22
22
 
23
23
  attr_accessor :_distinct_seq_id
24
24
 
25
+ attr_accessor :_extra
26
+
25
27
  attr_accessor :additional_properties
26
28
 
27
29
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -31,7 +33,8 @@ module Algolia
31
33
  :_highlight_result => :_highlightResult,
32
34
  :_snippet_result => :_snippetResult,
33
35
  :_ranking_info => :_rankingInfo,
34
- :_distinct_seq_id => :_distinctSeqID
36
+ :_distinct_seq_id => :_distinctSeqID,
37
+ :_extra => :_extra
35
38
  }
36
39
  end
37
40
 
@@ -42,7 +45,8 @@ module Algolia
42
45
  :_highlight_result => :"Hash<String, HighlightResult>",
43
46
  :_snippet_result => :"Hash<String, SnippetResult>",
44
47
  :_ranking_info => :"HitRankingInfo",
45
- :_distinct_seq_id => :"Integer"
48
+ :_distinct_seq_id => :"Integer",
49
+ :_extra => :"HitMetadata"
46
50
  }
47
51
  end
48
52
 
@@ -86,6 +90,10 @@ module Algolia
86
90
  self._distinct_seq_id = attributes[:_distinct_seq_id]
87
91
  end
88
92
 
93
+ if attributes.key?(:_extra)
94
+ self._extra = attributes[:_extra]
95
+ end
96
+
89
97
  # add extra attribute to additional_properties
90
98
  self.additional_properties ||= {}
91
99
  self.additional_properties.merge!(attributes.reject { |k, _| self.class.attribute_map.key?(k.to_sym) })
@@ -100,7 +108,8 @@ module Algolia
100
108
  _highlight_result == other._highlight_result &&
101
109
  _snippet_result == other._snippet_result &&
102
110
  _ranking_info == other._ranking_info &&
103
- _distinct_seq_id == other._distinct_seq_id
111
+ _distinct_seq_id == other._distinct_seq_id &&
112
+ _extra == other._extra
104
113
  end
105
114
 
106
115
  # @see the `==` method
@@ -112,7 +121,7 @@ module Algolia
112
121
  # Calculates hash code according to all attributes.
113
122
  # @return [Integer] Hash code
114
123
  def hash
115
- [algolia_object_id, _highlight_result, _snippet_result, _ranking_info, _distinct_seq_id].hash
124
+ [algolia_object_id, _highlight_result, _snippet_result, _ranking_info, _distinct_seq_id, _extra].hash
116
125
  end
117
126
 
118
127
  # Builds the object from hash
@@ -0,0 +1,210 @@
1
+ # frozen_string_literal: true
2
+
3
+ # 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.
4
+
5
+ require "date"
6
+ require "time"
7
+
8
+ module Algolia
9
+ module Composition
10
+ # An object that contains the extra key-value pairs provided in the injectedItem definition.
11
+ class HitMetadata
12
+ # The key of the injectedItem that inserted this metadata.
13
+ attr_accessor :_injected_item_key
14
+
15
+ attr_accessor :additional_properties
16
+
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ :_injected_item_key => :_injectedItemKey
21
+ }
22
+ end
23
+
24
+ # Attribute type mapping.
25
+ def self.types_mapping
26
+ {
27
+ :_injected_item_key => :"String"
28
+ }
29
+ end
30
+
31
+ # List of attributes with nullable: true
32
+ def self.openapi_nullable
33
+ Set.new(
34
+ []
35
+ )
36
+ end
37
+
38
+ # Initializes the object
39
+ # @param [Hash] attributes Model attributes in the form of hash
40
+ def initialize(attributes = {})
41
+ if (!attributes.is_a?(Hash))
42
+ raise(
43
+ ArgumentError,
44
+ "The input argument (attributes) must be a hash in `Algolia::HitMetadata` initialize method"
45
+ )
46
+ end
47
+
48
+ if attributes.key?(:_injected_item_key)
49
+ self._injected_item_key = attributes[:_injected_item_key]
50
+ end
51
+
52
+ # add extra attribute to additional_properties
53
+ self.additional_properties ||= {}
54
+ self.additional_properties.merge!(attributes.reject { |k, _| self.class.attribute_map.key?(k.to_sym) })
55
+ end
56
+
57
+ # Checks equality by comparing each attribute.
58
+ # @param [Object] Object to be compared
59
+ def ==(other)
60
+ return true if self.equal?(other)
61
+ self.class == other.class &&
62
+ _injected_item_key == other._injected_item_key
63
+ end
64
+
65
+ # @see the `==` method
66
+ # @param [Object] Object to be compared
67
+ def eql?(other)
68
+ self == other
69
+ end
70
+
71
+ # Calculates hash code according to all attributes.
72
+ # @return [Integer] Hash code
73
+ def hash
74
+ [_injected_item_key].hash
75
+ end
76
+
77
+ # Builds the object from hash
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ # @return [Object] Returns the model itself
80
+ def self.build_from_hash(attributes)
81
+ return nil unless attributes.is_a?(Hash)
82
+ attributes = attributes.transform_keys(&:to_sym)
83
+ transformed_hash = {}
84
+ types_mapping.each_pair do |key, type|
85
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
86
+ transformed_hash[key.to_sym] = nil
87
+ elsif type =~ /\AArray<(.*)>/i
88
+ # check to ensure the input is an array given that the attribute
89
+ # is documented as an array but the input is not
90
+ if attributes[attribute_map[key]].is_a?(Array)
91
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
92
+ _deserialize(::Regexp.last_match(1), v)
93
+ }
94
+ end
95
+ elsif !attributes[attribute_map[key]].nil?
96
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
97
+ end
98
+ end
99
+
100
+ # add extra attribute to transformed_hash
101
+ transformed_hash.merge!(attributes.reject { |k, _| attribute_map.key?(k.to_sym) })
102
+ new(transformed_hash)
103
+ end
104
+
105
+ # Deserializes the data based on type
106
+ # @param string type Data type
107
+ # @param string value Value to be deserialized
108
+ # @return [Object] Deserialized data
109
+ def self._deserialize(type, value)
110
+ case type.to_sym
111
+ when :Time
112
+ Time.parse(value)
113
+ when :Date
114
+ Date.parse(value)
115
+ when :String
116
+ value.to_s
117
+ when :Integer
118
+ value.to_i
119
+ when :Float
120
+ value.to_f
121
+ when :Boolean
122
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
123
+ true
124
+ else
125
+ false
126
+ end
127
+
128
+ when :Object
129
+ # generic object (usually a Hash), return directly
130
+ value
131
+ when /\AArray<(?<inner_type>.+)>\z/
132
+ inner_type = Regexp.last_match[:inner_type]
133
+ value.map { |v| _deserialize(inner_type, v) }
134
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
135
+ k_type = Regexp.last_match[:k_type]
136
+ v_type = Regexp.last_match[:v_type]
137
+ {}.tap do |hash|
138
+ value.each do |k, v|
139
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
140
+ end
141
+ end
142
+ # model
143
+ else
144
+ # models (e.g. Pet) or oneOf
145
+ klass = Algolia::Composition.const_get(type)
146
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
147
+ .build_from_hash(value)
148
+ end
149
+ end
150
+
151
+ # Returns the string representation of the object
152
+ # @return [String] String presentation of the object
153
+ def to_s
154
+ to_hash.to_s
155
+ end
156
+
157
+ # to_body is an alias to to_hash (backward compatibility)
158
+ # @return [Hash] Returns the object in the form of hash
159
+ def to_body
160
+ to_hash
161
+ end
162
+
163
+ def to_json(*_args)
164
+ to_hash.to_json
165
+ end
166
+
167
+ # Returns the object in the form of hash
168
+ # @return [Hash] Returns the object in the form of hash
169
+ def to_hash
170
+ hash = {}
171
+ self.class.attribute_map.each_pair do |attr, param|
172
+ value = send(attr)
173
+ if value.nil?
174
+ is_nullable = self.class.openapi_nullable.include?(attr)
175
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
176
+ end
177
+
178
+ hash[param] = _to_hash(value)
179
+ end
180
+
181
+ # also add attributes from additional_properties to hash
182
+ self.additional_properties&.each_pair do |k, v|
183
+ hash[k.to_sym] = _to_hash(v)
184
+ end
185
+
186
+ hash
187
+ end
188
+
189
+ # Outputs non-array value in the form of hash
190
+ # For object, use to_hash. Otherwise, just return the value
191
+ # @param [Object] value Any valid value
192
+ # @return [Hash] Returns the value in the form of hash
193
+ def _to_hash(value)
194
+ if value.is_a?(Array)
195
+ value.compact.map { |v| _to_hash(v) }
196
+ elsif value.is_a?(Hash)
197
+ {}.tap do |hash|
198
+ value.each { |k, v| hash[k] = _to_hash(v) }
199
+ end
200
+ elsif value.respond_to?(:to_hash)
201
+ value.to_hash
202
+ else
203
+ value
204
+ end
205
+ end
206
+
207
+ end
208
+
209
+ end
210
+ end
@@ -20,6 +20,7 @@ module Algolia
20
20
  # Whether the run response should include detailed ranking information.
21
21
  attr_accessor :get_ranking_info
22
22
 
23
+ # Relevancy threshold below which less relevant results aren't included in the results You can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#what-are-virtual-replicas). Use this setting to strike a balance between the relevance and number of returned results.
23
24
  attr_accessor :relevancy_strictness
24
25
 
25
26
  attr_accessor :facet_filters
@@ -49,7 +50,7 @@ module Algolia
49
50
  # Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`.
50
51
  attr_accessor :inside_polygon
51
52
 
52
- # Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings. This setting also sets a dictionary for word detection in the logogram-based [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) languages. To support this, you must place the CJK language **first** **You should always specify a query language.** If you don't specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages/), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/).
53
+ # Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings. This setting also sets a dictionary for word detection in the logogram-based [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) languages. To support this, you must place the CJK language **first** **You should always specify a query language.** If you don't specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages/), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/).
53
54
  attr_accessor :query_languages
54
55
 
55
56
  # ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches) - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`.