algolia 3.42.2 → 3.43.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 +4 -4
- data/.github/workflows/do-not-edit-this-repository.yml +1 -1
- data/.github/workflows/issue.yml +1 -1
- data/.github/workflows/release.yml +4 -4
- data/CHANGELOG.md +14 -0
- data/Gemfile.lock +2 -2
- data/lib/algolia/api/analytics_client.rb +221 -0
- data/lib/algolia/api/search_client.rb +16 -0
- data/lib/algolia/api_client.rb +4 -0
- data/lib/algolia/models/abtesting-v3/ab_test.rb +14 -4
- data/lib/algolia/models/abtesting-v3/decision.rb +219 -0
- data/lib/algolia/models/analytics/bin_edge.rb +109 -0
- data/lib/algolia/models/analytics/catalog.rb +208 -0
- data/lib/algolia/models/analytics/catalog_entry.rb +249 -0
- data/lib/algolia/models/analytics/distribution_definition.rb +243 -0
- data/lib/algolia/models/analytics/distribution_payload.rb +247 -0
- data/lib/algolia/models/analytics/domain_catalog.rb +253 -0
- data/lib/algolia/models/analytics/field_reference.rb +219 -0
- data/lib/algolia/models/analytics/filter_definition.rb +238 -0
- data/lib/algolia/models/analytics/order_definition.rb +230 -0
- data/lib/algolia/models/analytics/order_direction.rb +34 -0
- data/lib/algolia/models/analytics/parameter_definition.rb +230 -0
- data/lib/algolia/models/analytics/parameter_reference.rb +219 -0
- data/lib/algolia/models/analytics/parameter_value.rb +111 -0
- data/lib/algolia/models/analytics/scalar_payload.rb +247 -0
- data/lib/algolia/models/analytics/series.rb +234 -0
- data/lib/algolia/models/analytics/series_date.rb +223 -0
- data/lib/algolia/models/analytics/table_payload.rb +292 -0
- data/lib/algolia/models/analytics/table_response.rb +211 -0
- data/lib/algolia/models/analytics/timeseries_payload.rb +279 -0
- data/lib/algolia/models/analytics/timeseries_response.rb +213 -0
- data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/converted_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/events_items.rb +1 -0
- data/lib/algolia/models/insights/instantsearch.rb +269 -0
- data/lib/algolia/models/insights/instantsearch_event.rb +33 -0
- data/lib/algolia/models/recommend/facet_filters.rb +109 -0
- data/lib/algolia/models/recommend/fallback_params.rb +14 -4
- data/lib/algolia/version.rb +1 -1
- metadata +26 -2
|
@@ -23,7 +23,7 @@ module Algolia
|
|
|
23
23
|
# Position of the clicked item the search results. You must provide 1 `position` for each `objectID`.
|
|
24
24
|
attr_accessor :positions
|
|
25
25
|
|
|
26
|
-
# Unique identifier for a search query. The query ID is required for events related to search or browse requests. If you add `clickAnalytics: true` as a search request parameter, the query ID is included in the API response.
|
|
26
|
+
# Unique identifier for a search query. The query ID is required for events related to search or browse requests. If you add `clickAnalytics: true` as a search request parameter, the query ID is included in the API response. For agentic analytics events, the query ID may be prefixed with `message_` followed by any printable string.
|
|
27
27
|
attr_accessor :query_id
|
|
28
28
|
|
|
29
29
|
# Anonymous or pseudonymous user identifier. Don't use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken).
|
|
@@ -20,7 +20,7 @@ module Algolia
|
|
|
20
20
|
# Object IDs of the records that are part of the event.
|
|
21
21
|
attr_accessor :object_ids
|
|
22
22
|
|
|
23
|
-
# Unique identifier for a search query. The query ID is required for events related to search or browse requests. If you add `clickAnalytics: true` as a search request parameter, the query ID is included in the API response.
|
|
23
|
+
# Unique identifier for a search query. The query ID is required for events related to search or browse requests. If you add `clickAnalytics: true` as a search request parameter, the query ID is included in the API response. For agentic analytics events, the query ID may be prefixed with `message_` followed by any printable string.
|
|
24
24
|
attr_accessor :query_id
|
|
25
25
|
|
|
26
26
|
# Anonymous or pseudonymous user identifier. Don't use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken).
|
|
@@ -0,0 +1,269 @@
|
|
|
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 Insights
|
|
10
|
+
class Instantsearch
|
|
11
|
+
# Event name, up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment's [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
12
|
+
attr_accessor :event_name
|
|
13
|
+
|
|
14
|
+
attr_accessor :event_type
|
|
15
|
+
|
|
16
|
+
# Anonymous or pseudonymous user identifier. Don't use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken).
|
|
17
|
+
attr_accessor :user_token
|
|
18
|
+
|
|
19
|
+
# Identifier for authenticated users. When the user signs in, you can get an identifier from your system and send it as `authenticatedUserToken`. This lets you keep using the `userToken` from before the user signed in, while providing a reliable way to identify users across sessions. Don't use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken).
|
|
20
|
+
attr_accessor :authenticated_user_token
|
|
21
|
+
|
|
22
|
+
# Timestamp of the event, measured in milliseconds since the Unix epoch. Must be no older than 30 days. If not provided, we use the time at which the request was received.
|
|
23
|
+
attr_accessor :timestamp
|
|
24
|
+
|
|
25
|
+
# Unique identifier for an agent session. Used to correlate instantsearch events with a specific agent interaction.
|
|
26
|
+
attr_accessor :agent_id
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:event_name => :eventName,
|
|
32
|
+
:event_type => :eventType,
|
|
33
|
+
:user_token => :userToken,
|
|
34
|
+
:authenticated_user_token => :authenticatedUserToken,
|
|
35
|
+
:timestamp => :timestamp,
|
|
36
|
+
:agent_id => :agentID
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Returns the keys that uniquely identify this oneOf variant when present
|
|
41
|
+
def self.discriminator_attributes
|
|
42
|
+
[
|
|
43
|
+
:eventType
|
|
44
|
+
]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Attribute type mapping.
|
|
48
|
+
def self.types_mapping
|
|
49
|
+
{
|
|
50
|
+
:event_name => :"String",
|
|
51
|
+
:event_type => :"InstantsearchEvent",
|
|
52
|
+
:user_token => :"String",
|
|
53
|
+
:authenticated_user_token => :"String",
|
|
54
|
+
:timestamp => :"Integer",
|
|
55
|
+
:agent_id => :"String"
|
|
56
|
+
}
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# List of attributes with nullable: true
|
|
60
|
+
def self.openapi_nullable
|
|
61
|
+
Set.new(
|
|
62
|
+
[]
|
|
63
|
+
)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Initializes the object
|
|
67
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
68
|
+
def initialize(attributes = {})
|
|
69
|
+
if (!attributes.is_a?(Hash))
|
|
70
|
+
raise(
|
|
71
|
+
ArgumentError,
|
|
72
|
+
"The input argument (attributes) must be a hash in `Algolia::Instantsearch` initialize method"
|
|
73
|
+
)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
77
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
78
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
79
|
+
raise(
|
|
80
|
+
ArgumentError,
|
|
81
|
+
"`#{k}` is not a valid attribute in `Algolia::Instantsearch`. Please check the name to make sure it's valid. List of attributes: " +
|
|
82
|
+
self.class.attribute_map.keys.inspect
|
|
83
|
+
)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
h[k.to_sym] = v
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:event_name)
|
|
90
|
+
self.event_name = attributes[:event_name]
|
|
91
|
+
else
|
|
92
|
+
self.event_name = nil
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:event_type)
|
|
96
|
+
self.event_type = attributes[:event_type]
|
|
97
|
+
else
|
|
98
|
+
self.event_type = nil
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if attributes.key?(:user_token)
|
|
102
|
+
self.user_token = attributes[:user_token]
|
|
103
|
+
else
|
|
104
|
+
self.user_token = nil
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:authenticated_user_token)
|
|
108
|
+
self.authenticated_user_token = attributes[:authenticated_user_token]
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:timestamp)
|
|
112
|
+
self.timestamp = attributes[:timestamp]
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:agent_id)
|
|
116
|
+
self.agent_id = attributes[:agent_id]
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Checks equality by comparing each attribute.
|
|
121
|
+
# @param [Object] Object to be compared
|
|
122
|
+
def ==(other)
|
|
123
|
+
return true if self.equal?(other)
|
|
124
|
+
self.class == other.class &&
|
|
125
|
+
event_name == other.event_name &&
|
|
126
|
+
event_type == other.event_type &&
|
|
127
|
+
user_token == other.user_token &&
|
|
128
|
+
authenticated_user_token == other.authenticated_user_token &&
|
|
129
|
+
timestamp == other.timestamp &&
|
|
130
|
+
agent_id == other.agent_id
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# @see the `==` method
|
|
134
|
+
# @param [Object] Object to be compared
|
|
135
|
+
def eql?(other)
|
|
136
|
+
self == other
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Calculates hash code according to all attributes.
|
|
140
|
+
# @return [Integer] Hash code
|
|
141
|
+
def hash
|
|
142
|
+
[event_name, event_type, user_token, authenticated_user_token, timestamp, agent_id].hash
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Builds the object from hash
|
|
146
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
147
|
+
# @return [Object] Returns the model itself
|
|
148
|
+
def self.build_from_hash(attributes)
|
|
149
|
+
return nil unless attributes.is_a?(Hash)
|
|
150
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
151
|
+
transformed_hash = {}
|
|
152
|
+
types_mapping.each_pair do |key, type|
|
|
153
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
154
|
+
transformed_hash[key.to_sym] = nil
|
|
155
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
156
|
+
# check to ensure the input is an array given that the attribute
|
|
157
|
+
# is documented as an array but the input is not
|
|
158
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
159
|
+
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
|
|
160
|
+
_deserialize(::Regexp.last_match(1), v)
|
|
161
|
+
}
|
|
162
|
+
end
|
|
163
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
164
|
+
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
new(transformed_hash)
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Deserializes the data based on type
|
|
172
|
+
# @param string type Data type
|
|
173
|
+
# @param string value Value to be deserialized
|
|
174
|
+
# @return [Object] Deserialized data
|
|
175
|
+
def self._deserialize(type, value)
|
|
176
|
+
case type.to_sym
|
|
177
|
+
when :Time
|
|
178
|
+
Time.parse(value)
|
|
179
|
+
when :Date
|
|
180
|
+
Date.parse(value)
|
|
181
|
+
when :String
|
|
182
|
+
value.to_s
|
|
183
|
+
when :Integer
|
|
184
|
+
value.to_i
|
|
185
|
+
when :Float
|
|
186
|
+
value.to_f
|
|
187
|
+
when :Boolean
|
|
188
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
189
|
+
true
|
|
190
|
+
else
|
|
191
|
+
false
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
when :Object
|
|
195
|
+
# generic object (usually a Hash), return directly
|
|
196
|
+
value
|
|
197
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
198
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
199
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
200
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
201
|
+
k_type = Regexp.last_match[:k_type]
|
|
202
|
+
v_type = Regexp.last_match[:v_type]
|
|
203
|
+
{}.tap do |hash|
|
|
204
|
+
value.each do |k, v|
|
|
205
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
# model
|
|
209
|
+
else
|
|
210
|
+
# models (e.g. Pet) or oneOf
|
|
211
|
+
klass = Algolia::Insights.const_get(type)
|
|
212
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
|
|
213
|
+
.build_from_hash(value)
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Returns the string representation of the object
|
|
218
|
+
# @return [String] String presentation of the object
|
|
219
|
+
def to_s
|
|
220
|
+
to_hash.to_s
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
224
|
+
# @return [Hash] Returns the object in the form of hash
|
|
225
|
+
def to_body
|
|
226
|
+
to_hash
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
def to_json(*_args)
|
|
230
|
+
to_hash.to_json
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
# Returns the object in the form of hash
|
|
234
|
+
# @return [Hash] Returns the object in the form of hash
|
|
235
|
+
def to_hash
|
|
236
|
+
hash = {}
|
|
237
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
238
|
+
value = send(attr)
|
|
239
|
+
if value.nil?
|
|
240
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
241
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
hash[param] = _to_hash(value)
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
hash
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Outputs non-array value in the form of hash
|
|
251
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
252
|
+
# @param [Object] value Any valid value
|
|
253
|
+
# @return [Hash] Returns the value in the form of hash
|
|
254
|
+
def _to_hash(value)
|
|
255
|
+
if value.is_a?(Array)
|
|
256
|
+
value.map { |v| _to_hash(v) }
|
|
257
|
+
elsif value.is_a?(Hash)
|
|
258
|
+
{}.tap do |hash|
|
|
259
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
260
|
+
end
|
|
261
|
+
elsif value.respond_to?(:to_hash)
|
|
262
|
+
value.to_hash
|
|
263
|
+
else
|
|
264
|
+
value
|
|
265
|
+
end
|
|
266
|
+
end
|
|
267
|
+
end
|
|
268
|
+
end
|
|
269
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
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 Insights
|
|
10
|
+
class InstantsearchEvent
|
|
11
|
+
INSTANTSEARCH = "instantsearch".freeze
|
|
12
|
+
|
|
13
|
+
def self.all_vars
|
|
14
|
+
@all_vars ||= [INSTANTSEARCH].freeze
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Builds the enum from string
|
|
18
|
+
# @param [String] The enum value in the form of the string
|
|
19
|
+
# @return [String] The enum value
|
|
20
|
+
def self.build_from_hash(value)
|
|
21
|
+
new.build_from_hash(value)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Builds the enum from string
|
|
25
|
+
# @param [String] The enum value in the form of the string
|
|
26
|
+
# @return [String] The enum value
|
|
27
|
+
def build_from_hash(value)
|
|
28
|
+
return value if InstantsearchEvent.all_vars.include?(value)
|
|
29
|
+
raise "Invalid ENUM value #{value} for class #InstantsearchEvent"
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,109 @@
|
|
|
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 Recommend
|
|
10
|
+
# Filter the search by facet values, so that only records with the same facet values are retrieved. **Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.** - `[filter1, filter2]` is interpreted as `filter1 AND filter2`. - `[[filter1, filter2], filter3]` is interpreted as `filter1 OR filter2 AND filter3`. - `facet:-value` is interpreted as `NOT facet:value`. While it's best to avoid attributes that start with a `-`, you can still filter them by escaping with a backslash: `facet:\\-value`.
|
|
11
|
+
module FacetFilters
|
|
12
|
+
class << self
|
|
13
|
+
# List of class defined in oneOf (OpenAPI v3)
|
|
14
|
+
def openapi_one_of
|
|
15
|
+
[
|
|
16
|
+
:"Array<FacetFilters>",
|
|
17
|
+
:"String"
|
|
18
|
+
]
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Builds the object
|
|
22
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
|
23
|
+
# @return [Object] Returns the model or the data itself
|
|
24
|
+
def build(data)
|
|
25
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
|
26
|
+
# Note:
|
|
27
|
+
# - We do not attempt to check whether exactly one item matches.
|
|
28
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
29
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
30
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
31
|
+
# - TODO: logging when debugging is set.
|
|
32
|
+
openapi_one_of.each do |klass|
|
|
33
|
+
begin
|
|
34
|
+
# "nullable: true"
|
|
35
|
+
next if klass == :AnyType
|
|
36
|
+
typed_data = find_and_cast_into_type(klass, data)
|
|
37
|
+
return typed_data if typed_data
|
|
38
|
+
# rescue all errors so we keep iterating even if the current item lookup raises
|
|
39
|
+
rescue
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
private
|
|
47
|
+
|
|
48
|
+
SchemaMismatchError = Class.new(StandardError)
|
|
49
|
+
|
|
50
|
+
def find_and_cast_into_type(klass, data)
|
|
51
|
+
return if data.nil?
|
|
52
|
+
|
|
53
|
+
case klass.to_s
|
|
54
|
+
when "Boolean"
|
|
55
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
56
|
+
when "Float"
|
|
57
|
+
return data if data.instance_of?(Float)
|
|
58
|
+
when "Integer"
|
|
59
|
+
return data if data.instance_of?(Integer)
|
|
60
|
+
when "Time"
|
|
61
|
+
return Time.parse(data)
|
|
62
|
+
when "Date"
|
|
63
|
+
return Date.parse(data)
|
|
64
|
+
when "String"
|
|
65
|
+
return data if data.instance_of?(String)
|
|
66
|
+
# "type: object"
|
|
67
|
+
when "Object"
|
|
68
|
+
return data if data.instance_of?(Hash)
|
|
69
|
+
# "type: array"
|
|
70
|
+
when /\AArray<(?<sub_type>.+)>\z/
|
|
71
|
+
if data.instance_of?(Array)
|
|
72
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
73
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
74
|
+
end
|
|
75
|
+
# "type: object" with "additionalProperties: { ... }"
|
|
76
|
+
when /\AHash<String, (?<sub_type>.+)>\z/
|
|
77
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
78
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
79
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
80
|
+
end
|
|
81
|
+
# model
|
|
82
|
+
else
|
|
83
|
+
const = Algolia::Recommend.const_get(klass)
|
|
84
|
+
if const
|
|
85
|
+
if const.respond_to?(:openapi_one_of)
|
|
86
|
+
# nested oneOf model
|
|
87
|
+
model = const.build(data)
|
|
88
|
+
elsif const.respond_to?(:discriminator_attributes)
|
|
89
|
+
if const.discriminator_attributes.all? { |attr| data.key?(attr) }
|
|
90
|
+
model = const.build_from_hash(data)
|
|
91
|
+
end
|
|
92
|
+
else
|
|
93
|
+
# maybe it's an enum, or doens't have discriminators
|
|
94
|
+
model = const.build_from_hash(data)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
return model if model
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# if no match by now, raise
|
|
102
|
+
raise
|
|
103
|
+
rescue
|
|
104
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|
|
@@ -242,6 +242,8 @@ module Algolia
|
|
|
242
242
|
|
|
243
243
|
attr_accessor :re_ranking_apply_filter
|
|
244
244
|
|
|
245
|
+
attr_accessor :facet_filters
|
|
246
|
+
|
|
245
247
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
246
248
|
def self.attribute_map
|
|
247
249
|
{
|
|
@@ -327,7 +329,8 @@ module Algolia
|
|
|
327
329
|
:attribute_criteria_computed_by_min_proximity => :attributeCriteriaComputedByMinProximity,
|
|
328
330
|
:rendering_content => :renderingContent,
|
|
329
331
|
:enable_re_ranking => :enableReRanking,
|
|
330
|
-
:re_ranking_apply_filter => :reRankingApplyFilter
|
|
332
|
+
:re_ranking_apply_filter => :reRankingApplyFilter,
|
|
333
|
+
:facet_filters => :facetFilters
|
|
331
334
|
}
|
|
332
335
|
end
|
|
333
336
|
|
|
@@ -416,7 +419,8 @@ module Algolia
|
|
|
416
419
|
:attribute_criteria_computed_by_min_proximity => :"Boolean",
|
|
417
420
|
:rendering_content => :"RenderingContent",
|
|
418
421
|
:enable_re_ranking => :"Boolean",
|
|
419
|
-
:re_ranking_apply_filter => :"ReRankingApplyFilter"
|
|
422
|
+
:re_ranking_apply_filter => :"ReRankingApplyFilter",
|
|
423
|
+
:facet_filters => :"FacetFilters"
|
|
420
424
|
}
|
|
421
425
|
end
|
|
422
426
|
|
|
@@ -849,6 +853,10 @@ module Algolia
|
|
|
849
853
|
if attributes.key?(:re_ranking_apply_filter)
|
|
850
854
|
self.re_ranking_apply_filter = attributes[:re_ranking_apply_filter]
|
|
851
855
|
end
|
|
856
|
+
|
|
857
|
+
if attributes.key?(:facet_filters)
|
|
858
|
+
self.facet_filters = attributes[:facet_filters]
|
|
859
|
+
end
|
|
852
860
|
end
|
|
853
861
|
|
|
854
862
|
# Checks equality by comparing each attribute.
|
|
@@ -938,7 +946,8 @@ module Algolia
|
|
|
938
946
|
attribute_criteria_computed_by_min_proximity == other.attribute_criteria_computed_by_min_proximity &&
|
|
939
947
|
rendering_content == other.rendering_content &&
|
|
940
948
|
enable_re_ranking == other.enable_re_ranking &&
|
|
941
|
-
re_ranking_apply_filter == other.re_ranking_apply_filter
|
|
949
|
+
re_ranking_apply_filter == other.re_ranking_apply_filter &&
|
|
950
|
+
facet_filters == other.facet_filters
|
|
942
951
|
end
|
|
943
952
|
|
|
944
953
|
# @see the `==` method
|
|
@@ -1033,7 +1042,8 @@ module Algolia
|
|
|
1033
1042
|
attribute_criteria_computed_by_min_proximity,
|
|
1034
1043
|
rendering_content,
|
|
1035
1044
|
enable_re_ranking,
|
|
1036
|
-
re_ranking_apply_filter
|
|
1045
|
+
re_ranking_apply_filter,
|
|
1046
|
+
facet_filters
|
|
1037
1047
|
].hash
|
|
1038
1048
|
end
|
|
1039
1049
|
|
data/lib/algolia/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: algolia
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.43.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- https://alg.li/support
|
|
@@ -157,6 +157,7 @@ files:
|
|
|
157
157
|
- lib/algolia/models/abtesting-v3/add_ab_tests_request.rb
|
|
158
158
|
- lib/algolia/models/abtesting-v3/add_ab_tests_variant.rb
|
|
159
159
|
- lib/algolia/models/abtesting-v3/create_metric.rb
|
|
160
|
+
- lib/algolia/models/abtesting-v3/decision.rb
|
|
160
161
|
- lib/algolia/models/abtesting-v3/direction.rb
|
|
161
162
|
- lib/algolia/models/abtesting-v3/effect_metric.rb
|
|
162
163
|
- lib/algolia/models/abtesting-v3/empty_search_filter.rb
|
|
@@ -325,6 +326,9 @@ files:
|
|
|
325
326
|
- lib/algolia/models/agent-studio/user_message_v5.rb
|
|
326
327
|
- lib/algolia/models/agent-studio/validation_error.rb
|
|
327
328
|
- lib/algolia/models/agent-studio/vote_enum.rb
|
|
329
|
+
- lib/algolia/models/analytics/bin_edge.rb
|
|
330
|
+
- lib/algolia/models/analytics/catalog.rb
|
|
331
|
+
- lib/algolia/models/analytics/catalog_entry.rb
|
|
328
332
|
- lib/algolia/models/analytics/click_position.rb
|
|
329
333
|
- lib/algolia/models/analytics/currency_code.rb
|
|
330
334
|
- lib/algolia/models/analytics/daily_add_to_cart_rates.rb
|
|
@@ -340,7 +344,12 @@ files:
|
|
|
340
344
|
- lib/algolia/models/analytics/daily_searches_no_results.rb
|
|
341
345
|
- lib/algolia/models/analytics/daily_users.rb
|
|
342
346
|
- lib/algolia/models/analytics/direction.rb
|
|
347
|
+
- lib/algolia/models/analytics/distribution_definition.rb
|
|
348
|
+
- lib/algolia/models/analytics/distribution_payload.rb
|
|
349
|
+
- lib/algolia/models/analytics/domain_catalog.rb
|
|
343
350
|
- lib/algolia/models/analytics/error_base.rb
|
|
351
|
+
- lib/algolia/models/analytics/field_reference.rb
|
|
352
|
+
- lib/algolia/models/analytics/filter_definition.rb
|
|
344
353
|
- lib/algolia/models/analytics/get_add_to_cart_rate_response.rb
|
|
345
354
|
- lib/algolia/models/analytics/get_average_click_position_response.rb
|
|
346
355
|
- lib/algolia/models/analytics/get_click_positions_response.rb
|
|
@@ -367,6 +376,18 @@ files:
|
|
|
367
376
|
- lib/algolia/models/analytics/get_users_count_response.rb
|
|
368
377
|
- lib/algolia/models/analytics/operator.rb
|
|
369
378
|
- lib/algolia/models/analytics/order_by.rb
|
|
379
|
+
- lib/algolia/models/analytics/order_definition.rb
|
|
380
|
+
- lib/algolia/models/analytics/order_direction.rb
|
|
381
|
+
- lib/algolia/models/analytics/parameter_definition.rb
|
|
382
|
+
- lib/algolia/models/analytics/parameter_reference.rb
|
|
383
|
+
- lib/algolia/models/analytics/parameter_value.rb
|
|
384
|
+
- lib/algolia/models/analytics/scalar_payload.rb
|
|
385
|
+
- lib/algolia/models/analytics/series.rb
|
|
386
|
+
- lib/algolia/models/analytics/series_date.rb
|
|
387
|
+
- lib/algolia/models/analytics/table_payload.rb
|
|
388
|
+
- lib/algolia/models/analytics/table_response.rb
|
|
389
|
+
- lib/algolia/models/analytics/timeseries_payload.rb
|
|
390
|
+
- lib/algolia/models/analytics/timeseries_response.rb
|
|
370
391
|
- lib/algolia/models/analytics/top_country.rb
|
|
371
392
|
- lib/algolia/models/analytics/top_hit.rb
|
|
372
393
|
- lib/algolia/models/analytics/top_hit_with_analytics.rb
|
|
@@ -665,6 +686,8 @@ files:
|
|
|
665
686
|
- lib/algolia/models/insights/events_items.rb
|
|
666
687
|
- lib/algolia/models/insights/events_response.rb
|
|
667
688
|
- lib/algolia/models/insights/insights_events.rb
|
|
689
|
+
- lib/algolia/models/insights/instantsearch.rb
|
|
690
|
+
- lib/algolia/models/insights/instantsearch_event.rb
|
|
668
691
|
- lib/algolia/models/insights/object_data.rb
|
|
669
692
|
- lib/algolia/models/insights/object_data_after_search.rb
|
|
670
693
|
- lib/algolia/models/insights/price.rb
|
|
@@ -734,6 +757,7 @@ files:
|
|
|
734
757
|
- lib/algolia/models/recommend/error_base.rb
|
|
735
758
|
- lib/algolia/models/recommend/exact_on_single_word_query.rb
|
|
736
759
|
- lib/algolia/models/recommend/exhaustive.rb
|
|
760
|
+
- lib/algolia/models/recommend/facet_filters.rb
|
|
737
761
|
- lib/algolia/models/recommend/facet_ordering.rb
|
|
738
762
|
- lib/algolia/models/recommend/facet_stats.rb
|
|
739
763
|
- lib/algolia/models/recommend/fallback_params.rb
|
|
@@ -1014,7 +1038,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
1014
1038
|
- !ruby/object:Gem::Version
|
|
1015
1039
|
version: '0'
|
|
1016
1040
|
requirements: []
|
|
1017
|
-
rubygems_version: 4.0.
|
|
1041
|
+
rubygems_version: 4.0.16
|
|
1018
1042
|
specification_version: 4
|
|
1019
1043
|
summary: A simple Ruby client for the algolia.com REST API
|
|
1020
1044
|
test_files: []
|