algolia 3.42.3 → 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 (37) 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 +9 -0
  6. data/Gemfile.lock +2 -2
  7. data/lib/algolia/api/analytics_client.rb +221 -0
  8. data/lib/algolia/models/abtesting-v3/ab_test.rb +14 -4
  9. data/lib/algolia/models/abtesting-v3/decision.rb +219 -0
  10. data/lib/algolia/models/analytics/bin_edge.rb +109 -0
  11. data/lib/algolia/models/analytics/catalog.rb +208 -0
  12. data/lib/algolia/models/analytics/catalog_entry.rb +249 -0
  13. data/lib/algolia/models/analytics/distribution_definition.rb +243 -0
  14. data/lib/algolia/models/analytics/distribution_payload.rb +247 -0
  15. data/lib/algolia/models/analytics/domain_catalog.rb +253 -0
  16. data/lib/algolia/models/analytics/field_reference.rb +219 -0
  17. data/lib/algolia/models/analytics/filter_definition.rb +238 -0
  18. data/lib/algolia/models/analytics/order_definition.rb +230 -0
  19. data/lib/algolia/models/analytics/order_direction.rb +34 -0
  20. data/lib/algolia/models/analytics/parameter_definition.rb +230 -0
  21. data/lib/algolia/models/analytics/parameter_reference.rb +219 -0
  22. data/lib/algolia/models/analytics/parameter_value.rb +111 -0
  23. data/lib/algolia/models/analytics/scalar_payload.rb +247 -0
  24. data/lib/algolia/models/analytics/series.rb +234 -0
  25. data/lib/algolia/models/analytics/series_date.rb +223 -0
  26. data/lib/algolia/models/analytics/table_payload.rb +292 -0
  27. data/lib/algolia/models/analytics/table_response.rb +211 -0
  28. data/lib/algolia/models/analytics/timeseries_payload.rb +279 -0
  29. data/lib/algolia/models/analytics/timeseries_response.rb +213 -0
  30. data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +1 -1
  31. data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +1 -1
  32. data/lib/algolia/models/insights/converted_object_ids_after_search.rb +1 -1
  33. data/lib/algolia/models/insights/events_items.rb +1 -0
  34. data/lib/algolia/models/insights/instantsearch.rb +269 -0
  35. data/lib/algolia/models/insights/instantsearch_event.rb +33 -0
  36. data/lib/algolia/version.rb +1 -1
  37. metadata +25 -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).
@@ -20,6 +20,7 @@ module Algolia
20
20
  :"ConvertedFilters",
21
21
  :"ConvertedObjectIDs",
22
22
  :"ConvertedObjectIDsAfterSearch",
23
+ :"Instantsearch",
23
24
  :"PurchasedObjectIDs",
24
25
  :"PurchasedObjectIDsAfterSearch",
25
26
  :"ViewedFilters",
@@ -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
@@ -3,5 +3,5 @@
3
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
4
 
5
5
  module Algolia
6
- VERSION = "3.42.3"
6
+ VERSION = "3.43.0"
7
7
  end
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.42.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
@@ -1015,7 +1038,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1015
1038
  - !ruby/object:Gem::Version
1016
1039
  version: '0'
1017
1040
  requirements: []
1018
- rubygems_version: 4.0.10
1041
+ rubygems_version: 4.0.16
1019
1042
  specification_version: 4
1020
1043
  summary: A simple Ruby client for the algolia.com REST API
1021
1044
  test_files: []