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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/do-not-edit-this-repository.yml +1 -1
  3. data/.github/workflows/issue.yml +1 -1
  4. data/.github/workflows/release.yml +4 -4
  5. data/CHANGELOG.md +14 -0
  6. data/Gemfile.lock +2 -2
  7. data/lib/algolia/api/analytics_client.rb +221 -0
  8. data/lib/algolia/api/search_client.rb +16 -0
  9. data/lib/algolia/api_client.rb +4 -0
  10. data/lib/algolia/models/abtesting-v3/ab_test.rb +14 -4
  11. data/lib/algolia/models/abtesting-v3/decision.rb +219 -0
  12. data/lib/algolia/models/analytics/bin_edge.rb +109 -0
  13. data/lib/algolia/models/analytics/catalog.rb +208 -0
  14. data/lib/algolia/models/analytics/catalog_entry.rb +249 -0
  15. data/lib/algolia/models/analytics/distribution_definition.rb +243 -0
  16. data/lib/algolia/models/analytics/distribution_payload.rb +247 -0
  17. data/lib/algolia/models/analytics/domain_catalog.rb +253 -0
  18. data/lib/algolia/models/analytics/field_reference.rb +219 -0
  19. data/lib/algolia/models/analytics/filter_definition.rb +238 -0
  20. data/lib/algolia/models/analytics/order_definition.rb +230 -0
  21. data/lib/algolia/models/analytics/order_direction.rb +34 -0
  22. data/lib/algolia/models/analytics/parameter_definition.rb +230 -0
  23. data/lib/algolia/models/analytics/parameter_reference.rb +219 -0
  24. data/lib/algolia/models/analytics/parameter_value.rb +111 -0
  25. data/lib/algolia/models/analytics/scalar_payload.rb +247 -0
  26. data/lib/algolia/models/analytics/series.rb +234 -0
  27. data/lib/algolia/models/analytics/series_date.rb +223 -0
  28. data/lib/algolia/models/analytics/table_payload.rb +292 -0
  29. data/lib/algolia/models/analytics/table_response.rb +211 -0
  30. data/lib/algolia/models/analytics/timeseries_payload.rb +279 -0
  31. data/lib/algolia/models/analytics/timeseries_response.rb +213 -0
  32. data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +1 -1
  33. data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +1 -1
  34. data/lib/algolia/models/insights/converted_object_ids_after_search.rb +1 -1
  35. data/lib/algolia/models/insights/events_items.rb +1 -0
  36. data/lib/algolia/models/insights/instantsearch.rb +269 -0
  37. data/lib/algolia/models/insights/instantsearch_event.rb +33 -0
  38. data/lib/algolia/models/recommend/facet_filters.rb +109 -0
  39. data/lib/algolia/models/recommend/fallback_params.rb +14 -4
  40. data/lib/algolia/version.rb +1 -1
  41. metadata +26 -2
@@ -0,0 +1,211 @@
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 Analytics
10
+ class TableResponse
11
+ # Result rows. Each row is a flat object of the requested fields.
12
+ attr_accessor :rows
13
+
14
+ # Attribute mapping from ruby-style variable name to JSON key.
15
+ def self.attribute_map
16
+ {
17
+ :rows => :rows
18
+ }
19
+ end
20
+
21
+ # Attribute type mapping.
22
+ def self.types_mapping
23
+ {
24
+ :rows => :"Array<Hash<String, Object>>"
25
+ }
26
+ end
27
+
28
+ # List of attributes with nullable: true
29
+ def self.openapi_nullable
30
+ Set.new(
31
+ []
32
+ )
33
+ end
34
+
35
+ # Initializes the object
36
+ # @param [Hash] attributes Model attributes in the form of hash
37
+ def initialize(attributes = {})
38
+ if (!attributes.is_a?(Hash))
39
+ raise(
40
+ ArgumentError,
41
+ "The input argument (attributes) must be a hash in `Algolia::TableResponse` initialize method"
42
+ )
43
+ end
44
+
45
+ # check to see if the attribute exists and convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}) { |(k, v), h|
47
+ if (!self.class.attribute_map.key?(k.to_sym))
48
+ raise(
49
+ ArgumentError,
50
+ "`#{k}` is not a valid attribute in `Algolia::TableResponse`. Please check the name to make sure it's valid. List of attributes: " +
51
+ self.class.attribute_map.keys.inspect
52
+ )
53
+ end
54
+
55
+ h[k.to_sym] = v
56
+ }
57
+
58
+ if attributes.key?(:rows)
59
+ if (value = attributes[:rows]).is_a?(Array)
60
+ self.rows = value
61
+ end
62
+ else
63
+ self.rows = nil
64
+ end
65
+ end
66
+
67
+ # Checks equality by comparing each attribute.
68
+ # @param [Object] Object to be compared
69
+ def ==(other)
70
+ return true if self.equal?(other)
71
+ self.class == other.class &&
72
+ rows == other.rows
73
+ end
74
+
75
+ # @see the `==` method
76
+ # @param [Object] Object to be compared
77
+ def eql?(other)
78
+ self == other
79
+ end
80
+
81
+ # Calculates hash code according to all attributes.
82
+ # @return [Integer] Hash code
83
+ def hash
84
+ [rows].hash
85
+ end
86
+
87
+ # Builds the object from hash
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ # @return [Object] Returns the model itself
90
+ def self.build_from_hash(attributes)
91
+ return nil unless attributes.is_a?(Hash)
92
+ attributes = attributes.transform_keys(&:to_sym)
93
+ transformed_hash = {}
94
+ types_mapping.each_pair do |key, type|
95
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
96
+ transformed_hash[key.to_sym] = nil
97
+ elsif type =~ /\AArray<(.*)>/i
98
+ # check to ensure the input is an array given that the attribute
99
+ # is documented as an array but the input is not
100
+ if attributes[attribute_map[key]].is_a?(Array)
101
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
102
+ _deserialize(::Regexp.last_match(1), v)
103
+ }
104
+ end
105
+ elsif !attributes[attribute_map[key]].nil?
106
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
107
+ end
108
+ end
109
+
110
+ new(transformed_hash)
111
+ end
112
+
113
+ # Deserializes the data based on type
114
+ # @param string type Data type
115
+ # @param string value Value to be deserialized
116
+ # @return [Object] Deserialized data
117
+ def self._deserialize(type, value)
118
+ case type.to_sym
119
+ when :Time
120
+ Time.parse(value)
121
+ when :Date
122
+ Date.parse(value)
123
+ when :String
124
+ value.to_s
125
+ when :Integer
126
+ value.to_i
127
+ when :Float
128
+ value.to_f
129
+ when :Boolean
130
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
131
+ true
132
+ else
133
+ false
134
+ end
135
+
136
+ when :Object
137
+ # generic object (usually a Hash), return directly
138
+ value
139
+ when /\AArray<(?<inner_type>.+)>\z/
140
+ inner_type = Regexp.last_match[:inner_type]
141
+ value.map { |v| _deserialize(inner_type, v) }
142
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
143
+ k_type = Regexp.last_match[:k_type]
144
+ v_type = Regexp.last_match[:v_type]
145
+ {}.tap do |hash|
146
+ value.each do |k, v|
147
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
148
+ end
149
+ end
150
+ # model
151
+ else
152
+ # models (e.g. Pet) or oneOf
153
+ klass = Algolia::Analytics.const_get(type)
154
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
155
+ .build_from_hash(value)
156
+ end
157
+ end
158
+
159
+ # Returns the string representation of the object
160
+ # @return [String] String presentation of the object
161
+ def to_s
162
+ to_hash.to_s
163
+ end
164
+
165
+ # to_body is an alias to to_hash (backward compatibility)
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_body
168
+ to_hash
169
+ end
170
+
171
+ def to_json(*_args)
172
+ to_hash.to_json
173
+ end
174
+
175
+ # Returns the object in the form of hash
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_hash
178
+ hash = {}
179
+ self.class.attribute_map.each_pair do |attr, param|
180
+ value = send(attr)
181
+ if value.nil?
182
+ is_nullable = self.class.openapi_nullable.include?(attr)
183
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
184
+ end
185
+
186
+ hash[param] = _to_hash(value)
187
+ end
188
+
189
+ hash
190
+ end
191
+
192
+ # Outputs non-array value in the form of hash
193
+ # For object, use to_hash. Otherwise, just return the value
194
+ # @param [Object] value Any valid value
195
+ # @return [Hash] Returns the value in the form of hash
196
+ def _to_hash(value)
197
+ if value.is_a?(Array)
198
+ value.map { |v| _to_hash(v) }
199
+ elsif value.is_a?(Hash)
200
+ {}.tap do |hash|
201
+ value.each { |k, v| hash[k] = _to_hash(v) }
202
+ end
203
+ elsif value.respond_to?(:to_hash)
204
+ value.to_hash
205
+ else
206
+ value
207
+ end
208
+ end
209
+ end
210
+ end
211
+ end
@@ -0,0 +1,279 @@
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 Analytics
10
+ class TimeseriesPayload
11
+ # Default domain propagated to entries that omit their own.
12
+ attr_accessor :domain
13
+
14
+ # Fields to aggregate.
15
+ attr_accessor :metrics
16
+
17
+ # Fields to split the series by.
18
+ attr_accessor :group_by
19
+
20
+ # Filter conditions.
21
+ attr_accessor :filters
22
+
23
+ # Literal values referenced by the query.
24
+ attr_accessor :parameters
25
+
26
+ # Maximum number of series (groupBy values) to return.
27
+ attr_accessor :limit
28
+
29
+ # Number of series to skip.
30
+ attr_accessor :offset
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :domain => :domain,
36
+ :metrics => :metrics,
37
+ :group_by => :groupBy,
38
+ :filters => :filters,
39
+ :parameters => :parameters,
40
+ :limit => :limit,
41
+ :offset => :offset
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.types_mapping
47
+ {
48
+ :domain => :"String",
49
+ :metrics => :"Array<FieldReference>",
50
+ :group_by => :"Array<FieldReference>",
51
+ :filters => :"Array<FilterDefinition>",
52
+ :parameters => :"Array<ParameterDefinition>",
53
+ :limit => :"Integer",
54
+ :offset => :"Integer"
55
+ }
56
+ end
57
+
58
+ # List of attributes with nullable: true
59
+ def self.openapi_nullable
60
+ Set.new(
61
+ []
62
+ )
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ raise(
70
+ ArgumentError,
71
+ "The input argument (attributes) must be a hash in `Algolia::TimeseriesPayload` initialize method"
72
+ )
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!self.class.attribute_map.key?(k.to_sym))
78
+ raise(
79
+ ArgumentError,
80
+ "`#{k}` is not a valid attribute in `Algolia::TimeseriesPayload`. Please check the name to make sure it's valid. List of attributes: " +
81
+ self.class.attribute_map.keys.inspect
82
+ )
83
+ end
84
+
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:domain)
89
+ self.domain = attributes[:domain]
90
+ end
91
+
92
+ if attributes.key?(:metrics)
93
+ if (value = attributes[:metrics]).is_a?(Array)
94
+ self.metrics = value
95
+ end
96
+ else
97
+ self.metrics = nil
98
+ end
99
+
100
+ if attributes.key?(:group_by)
101
+ if (value = attributes[:group_by]).is_a?(Array)
102
+ self.group_by = value
103
+ end
104
+ end
105
+
106
+ if attributes.key?(:filters)
107
+ if (value = attributes[:filters]).is_a?(Array)
108
+ self.filters = value
109
+ end
110
+ end
111
+
112
+ if attributes.key?(:parameters)
113
+ if (value = attributes[:parameters]).is_a?(Array)
114
+ self.parameters = value
115
+ end
116
+ else
117
+ self.parameters = nil
118
+ end
119
+
120
+ if attributes.key?(:limit)
121
+ self.limit = attributes[:limit]
122
+ end
123
+
124
+ if attributes.key?(:offset)
125
+ self.offset = attributes[:offset]
126
+ end
127
+ end
128
+
129
+ # Checks equality by comparing each attribute.
130
+ # @param [Object] Object to be compared
131
+ def ==(other)
132
+ return true if self.equal?(other)
133
+ self.class == other.class &&
134
+ domain == other.domain &&
135
+ metrics == other.metrics &&
136
+ group_by == other.group_by &&
137
+ filters == other.filters &&
138
+ parameters == other.parameters &&
139
+ limit == other.limit &&
140
+ offset == other.offset
141
+ end
142
+
143
+ # @see the `==` method
144
+ # @param [Object] Object to be compared
145
+ def eql?(other)
146
+ self == other
147
+ end
148
+
149
+ # Calculates hash code according to all attributes.
150
+ # @return [Integer] Hash code
151
+ def hash
152
+ [domain, metrics, group_by, filters, parameters, limit, offset].hash
153
+ end
154
+
155
+ # Builds the object from hash
156
+ # @param [Hash] attributes Model attributes in the form of hash
157
+ # @return [Object] Returns the model itself
158
+ def self.build_from_hash(attributes)
159
+ return nil unless attributes.is_a?(Hash)
160
+ attributes = attributes.transform_keys(&:to_sym)
161
+ transformed_hash = {}
162
+ types_mapping.each_pair do |key, type|
163
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
164
+ transformed_hash[key.to_sym] = nil
165
+ elsif type =~ /\AArray<(.*)>/i
166
+ # check to ensure the input is an array given that the attribute
167
+ # is documented as an array but the input is not
168
+ if attributes[attribute_map[key]].is_a?(Array)
169
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
170
+ _deserialize(::Regexp.last_match(1), v)
171
+ }
172
+ end
173
+ elsif !attributes[attribute_map[key]].nil?
174
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
175
+ end
176
+ end
177
+
178
+ new(transformed_hash)
179
+ end
180
+
181
+ # Deserializes the data based on type
182
+ # @param string type Data type
183
+ # @param string value Value to be deserialized
184
+ # @return [Object] Deserialized data
185
+ def self._deserialize(type, value)
186
+ case type.to_sym
187
+ when :Time
188
+ Time.parse(value)
189
+ when :Date
190
+ Date.parse(value)
191
+ when :String
192
+ value.to_s
193
+ when :Integer
194
+ value.to_i
195
+ when :Float
196
+ value.to_f
197
+ when :Boolean
198
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
199
+ true
200
+ else
201
+ false
202
+ end
203
+
204
+ when :Object
205
+ # generic object (usually a Hash), return directly
206
+ value
207
+ when /\AArray<(?<inner_type>.+)>\z/
208
+ inner_type = Regexp.last_match[:inner_type]
209
+ value.map { |v| _deserialize(inner_type, v) }
210
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
211
+ k_type = Regexp.last_match[:k_type]
212
+ v_type = Regexp.last_match[:v_type]
213
+ {}.tap do |hash|
214
+ value.each do |k, v|
215
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
216
+ end
217
+ end
218
+ # model
219
+ else
220
+ # models (e.g. Pet) or oneOf
221
+ klass = Algolia::Analytics.const_get(type)
222
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
223
+ .build_from_hash(value)
224
+ end
225
+ end
226
+
227
+ # Returns the string representation of the object
228
+ # @return [String] String presentation of the object
229
+ def to_s
230
+ to_hash.to_s
231
+ end
232
+
233
+ # to_body is an alias to to_hash (backward compatibility)
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_body
236
+ to_hash
237
+ end
238
+
239
+ def to_json(*_args)
240
+ to_hash.to_json
241
+ end
242
+
243
+ # Returns the object in the form of hash
244
+ # @return [Hash] Returns the object in the form of hash
245
+ def to_hash
246
+ hash = {}
247
+ self.class.attribute_map.each_pair do |attr, param|
248
+ value = send(attr)
249
+ if value.nil?
250
+ is_nullable = self.class.openapi_nullable.include?(attr)
251
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
252
+ end
253
+
254
+ hash[param] = _to_hash(value)
255
+ end
256
+
257
+ hash
258
+ end
259
+
260
+ # Outputs non-array value in the form of hash
261
+ # For object, use to_hash. Otherwise, just return the value
262
+ # @param [Object] value Any valid value
263
+ # @return [Hash] Returns the value in the form of hash
264
+ def _to_hash(value)
265
+ if value.is_a?(Array)
266
+ value.map { |v| _to_hash(v) }
267
+ elsif value.is_a?(Hash)
268
+ {}.tap do |hash|
269
+ value.each { |k, v| hash[k] = _to_hash(v) }
270
+ end
271
+ elsif value.respond_to?(:to_hash)
272
+ value.to_hash
273
+ else
274
+ value
275
+ end
276
+ end
277
+ end
278
+ end
279
+ end
@@ -0,0 +1,213 @@
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 Analytics
10
+ class TimeseriesResponse
11
+ # One entry per `groupBy` combination. `null` when the query matched no data.
12
+ attr_accessor :series
13
+
14
+ # Attribute mapping from ruby-style variable name to JSON key.
15
+ def self.attribute_map
16
+ {
17
+ :series => :series
18
+ }
19
+ end
20
+
21
+ # Attribute type mapping.
22
+ def self.types_mapping
23
+ {
24
+ :series => :"Array<Series>"
25
+ }
26
+ end
27
+
28
+ # List of attributes with nullable: true
29
+ def self.openapi_nullable
30
+ Set.new(
31
+ [
32
+ :series
33
+ ]
34
+ )
35
+ end
36
+
37
+ # Initializes the object
38
+ # @param [Hash] attributes Model attributes in the form of hash
39
+ def initialize(attributes = {})
40
+ if (!attributes.is_a?(Hash))
41
+ raise(
42
+ ArgumentError,
43
+ "The input argument (attributes) must be a hash in `Algolia::TimeseriesResponse` initialize method"
44
+ )
45
+ end
46
+
47
+ # check to see if the attribute exists and convert string to symbol for hash key
48
+ attributes = attributes.each_with_object({}) { |(k, v), h|
49
+ if (!self.class.attribute_map.key?(k.to_sym))
50
+ raise(
51
+ ArgumentError,
52
+ "`#{k}` is not a valid attribute in `Algolia::TimeseriesResponse`. Please check the name to make sure it's valid. List of attributes: " +
53
+ self.class.attribute_map.keys.inspect
54
+ )
55
+ end
56
+
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:series)
61
+ if (value = attributes[:series]).is_a?(Array)
62
+ self.series = value
63
+ end
64
+ else
65
+ self.series = nil
66
+ end
67
+ end
68
+
69
+ # Checks equality by comparing each attribute.
70
+ # @param [Object] Object to be compared
71
+ def ==(other)
72
+ return true if self.equal?(other)
73
+ self.class == other.class &&
74
+ series == other.series
75
+ end
76
+
77
+ # @see the `==` method
78
+ # @param [Object] Object to be compared
79
+ def eql?(other)
80
+ self == other
81
+ end
82
+
83
+ # Calculates hash code according to all attributes.
84
+ # @return [Integer] Hash code
85
+ def hash
86
+ [series].hash
87
+ end
88
+
89
+ # Builds the object from hash
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ # @return [Object] Returns the model itself
92
+ def self.build_from_hash(attributes)
93
+ return nil unless attributes.is_a?(Hash)
94
+ attributes = attributes.transform_keys(&:to_sym)
95
+ transformed_hash = {}
96
+ types_mapping.each_pair do |key, type|
97
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
98
+ transformed_hash[key.to_sym] = nil
99
+ elsif type =~ /\AArray<(.*)>/i
100
+ # check to ensure the input is an array given that the attribute
101
+ # is documented as an array but the input is not
102
+ if attributes[attribute_map[key]].is_a?(Array)
103
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
104
+ _deserialize(::Regexp.last_match(1), v)
105
+ }
106
+ end
107
+ elsif !attributes[attribute_map[key]].nil?
108
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
109
+ end
110
+ end
111
+
112
+ new(transformed_hash)
113
+ end
114
+
115
+ # Deserializes the data based on type
116
+ # @param string type Data type
117
+ # @param string value Value to be deserialized
118
+ # @return [Object] Deserialized data
119
+ def self._deserialize(type, value)
120
+ case type.to_sym
121
+ when :Time
122
+ Time.parse(value)
123
+ when :Date
124
+ Date.parse(value)
125
+ when :String
126
+ value.to_s
127
+ when :Integer
128
+ value.to_i
129
+ when :Float
130
+ value.to_f
131
+ when :Boolean
132
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
133
+ true
134
+ else
135
+ false
136
+ end
137
+
138
+ when :Object
139
+ # generic object (usually a Hash), return directly
140
+ value
141
+ when /\AArray<(?<inner_type>.+)>\z/
142
+ inner_type = Regexp.last_match[:inner_type]
143
+ value.map { |v| _deserialize(inner_type, v) }
144
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
145
+ k_type = Regexp.last_match[:k_type]
146
+ v_type = Regexp.last_match[:v_type]
147
+ {}.tap do |hash|
148
+ value.each do |k, v|
149
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
150
+ end
151
+ end
152
+ # model
153
+ else
154
+ # models (e.g. Pet) or oneOf
155
+ klass = Algolia::Analytics.const_get(type)
156
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
157
+ .build_from_hash(value)
158
+ end
159
+ end
160
+
161
+ # Returns the string representation of the object
162
+ # @return [String] String presentation of the object
163
+ def to_s
164
+ to_hash.to_s
165
+ end
166
+
167
+ # to_body is an alias to to_hash (backward compatibility)
168
+ # @return [Hash] Returns the object in the form of hash
169
+ def to_body
170
+ to_hash
171
+ end
172
+
173
+ def to_json(*_args)
174
+ to_hash.to_json
175
+ end
176
+
177
+ # Returns the object in the form of hash
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_hash
180
+ hash = {}
181
+ self.class.attribute_map.each_pair do |attr, param|
182
+ value = send(attr)
183
+ if value.nil?
184
+ is_nullable = self.class.openapi_nullable.include?(attr)
185
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
186
+ end
187
+
188
+ hash[param] = _to_hash(value)
189
+ end
190
+
191
+ hash
192
+ end
193
+
194
+ # Outputs non-array value in the form of hash
195
+ # For object, use to_hash. Otherwise, just return the value
196
+ # @param [Object] value Any valid value
197
+ # @return [Hash] Returns the value in the form of hash
198
+ def _to_hash(value)
199
+ if value.is_a?(Array)
200
+ value.map { |v| _to_hash(v) }
201
+ elsif value.is_a?(Hash)
202
+ {}.tap do |hash|
203
+ value.each { |k, v| hash[k] = _to_hash(v) }
204
+ end
205
+ elsif value.respond_to?(:to_hash)
206
+ value.to_hash
207
+ else
208
+ value
209
+ end
210
+ end
211
+ end
212
+ end
213
+ end
@@ -19,7 +19,7 @@ module Algolia
19
19
  # Index name (case-sensitive) to which the event's items belong.
20
20
  attr_accessor :index
21
21
 
22
- # 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.
22
+ # 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.
23
23
  attr_accessor :query_id
24
24
 
25
25
  # Object IDs of the records that are part of the event.