algolia 3.0.0.alpha.2 → 3.0.0.alpha.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +27 -0
  3. data/.gitignore +39 -0
  4. data/.openapi-generator/FILES +164 -0
  5. data/.openapi-generator/VERSION +1 -0
  6. data/.openapi-generator-ignore +23 -0
  7. data/.rubocop.yml +99 -0
  8. data/CHANGELOG.md +16 -0
  9. data/Gemfile.lock +1 -1
  10. data/algolia.gemspec +1 -1
  11. data/lib/algolia/api/insights_client.rb +52 -0
  12. data/lib/algolia/models/insights/added_to_cart_object_ids.rb +81 -31
  13. data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +81 -31
  14. data/lib/algolia/models/insights/clicked_filters.rb +41 -18
  15. data/lib/algolia/models/insights/clicked_object_ids.rb +39 -6
  16. data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +43 -20
  17. data/lib/algolia/models/insights/converted_filters.rb +41 -18
  18. data/lib/algolia/models/insights/converted_object_ids.rb +42 -19
  19. data/lib/algolia/models/insights/converted_object_ids_after_search.rb +42 -19
  20. data/lib/algolia/models/insights/discount.rb +1 -1
  21. data/lib/algolia/models/insights/insights_events.rb +1 -1
  22. data/lib/algolia/models/insights/object_data.rb +1 -1
  23. data/lib/algolia/models/insights/object_data_after_search.rb +25 -2
  24. data/lib/algolia/models/insights/price.rb +1 -1
  25. data/lib/algolia/models/insights/purchased_object_ids.rb +81 -31
  26. data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +81 -66
  27. data/lib/algolia/models/insights/value.rb +97 -0
  28. data/lib/algolia/models/insights/viewed_filters.rb +41 -18
  29. data/lib/algolia/models/insights/viewed_object_ids.rb +42 -19
  30. data/lib/algolia/version.rb +1 -1
  31. metadata +10 -3
@@ -7,36 +7,35 @@ module Algolia
7
7
  module Insights
8
8
  # Use this event to track when users make a purchase after a previous Algolia request. If you're building your category pages with Algolia, you'll also use this event.
9
9
  class PurchasedObjectIDsAfterSearch
10
- # Can contain 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.
10
+ # The name of the event, 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.
11
11
  attr_accessor :event_name
12
12
 
13
13
  attr_accessor :event_type
14
14
 
15
15
  attr_accessor :event_subtype
16
16
 
17
- # Name of the Algolia index.
17
+ # The name of an Algolia index.
18
18
  attr_accessor :index
19
19
 
20
- # 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.
21
- attr_accessor :query_id
22
-
23
- # List of object identifiers for items of an Algolia index.
20
+ # The object IDs of the records that are part of the event.
24
21
  attr_accessor :object_ids
25
22
 
26
- # Extra information about the records involved in the event—for example, to add price and quantities of purchased products. If provided, must be the same length as `objectIDs`.
27
- attr_accessor :object_data
23
+ # An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
24
+ attr_accessor :user_token
25
+
26
+ # An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
27
+ attr_accessor :authenticated_user_token
28
28
 
29
- # If you include pricing information in the `objectData` parameter, you must also specify the currency as ISO-4217 currency code, such as USD or EUR.
29
+ # Three-letter [currency code](https://www.iso.org/iso-4217-currency-codes.html).
30
30
  attr_accessor :currency
31
31
 
32
- # Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
33
- attr_accessor :user_token
32
+ # Extra information about the records involved in a purchase or add-to-cart events. If provided, it must be the same length as `objectIDs`.
33
+ attr_accessor :object_data
34
34
 
35
- # Time of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
35
+ # The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
36
36
  attr_accessor :timestamp
37
37
 
38
- # User token for authenticated users.
39
- attr_accessor :authenticated_user_token
38
+ attr_accessor :value
40
39
 
41
40
  class EnumAttributeValidator
42
41
  attr_reader :datatype
@@ -67,13 +66,13 @@ module Algolia
67
66
  :event_type => :eventType,
68
67
  :event_subtype => :eventSubtype,
69
68
  :index => :index,
70
- :query_id => :queryID,
71
69
  :object_ids => :objectIDs,
72
- :object_data => :objectData,
73
- :currency => :currency,
74
70
  :user_token => :userToken,
71
+ :authenticated_user_token => :authenticatedUserToken,
72
+ :currency => :currency,
73
+ :object_data => :objectData,
75
74
  :timestamp => :timestamp,
76
- :authenticated_user_token => :authenticatedUserToken
75
+ :value => :value
77
76
  }
78
77
  end
79
78
 
@@ -89,13 +88,13 @@ module Algolia
89
88
  :event_type => :ConversionEvent,
90
89
  :event_subtype => :PurchaseEvent,
91
90
  :index => :String,
92
- :query_id => :String,
93
91
  :object_ids => :'Array<String>',
94
- :object_data => :'Array<ObjectDataAfterSearch>',
95
- :currency => :String,
96
92
  :user_token => :String,
93
+ :authenticated_user_token => :String,
94
+ :currency => :String,
95
+ :object_data => :'Array<ObjectDataAfterSearch>',
97
96
  :timestamp => :Integer,
98
- :authenticated_user_token => :String
97
+ :value => :Value
99
98
  }
100
99
  end
101
100
 
@@ -145,12 +144,6 @@ module Algolia
145
144
  self.index = nil
146
145
  end
147
146
 
148
- if attributes.key?(:query_id)
149
- self.query_id = attributes[:query_id]
150
- else
151
- self.query_id = nil
152
- end
153
-
154
147
  if attributes.key?(:object_ids)
155
148
  if (value = attributes[:object_ids]).is_a?(Array)
156
149
  self.object_ids = value
@@ -159,28 +152,32 @@ module Algolia
159
152
  self.object_ids = nil
160
153
  end
161
154
 
162
- if attributes.key?(:object_data)
163
- if (value = attributes[:object_data]).is_a?(Array)
164
- self.object_data = value
165
- end
155
+ if attributes.key?(:user_token)
156
+ self.user_token = attributes[:user_token]
157
+ else
158
+ self.user_token = nil
159
+ end
160
+
161
+ if attributes.key?(:authenticated_user_token)
162
+ self.authenticated_user_token = attributes[:authenticated_user_token]
166
163
  end
167
164
 
168
165
  if attributes.key?(:currency)
169
166
  self.currency = attributes[:currency]
170
167
  end
171
168
 
172
- if attributes.key?(:user_token)
173
- self.user_token = attributes[:user_token]
174
- else
175
- self.user_token = nil
169
+ if attributes.key?(:object_data)
170
+ if (value = attributes[:object_data]).is_a?(Array)
171
+ self.object_data = value
172
+ end
176
173
  end
177
174
 
178
175
  if attributes.key?(:timestamp)
179
176
  self.timestamp = attributes[:timestamp]
180
177
  end
181
178
 
182
- if attributes.key?(:authenticated_user_token)
183
- self.authenticated_user_token = attributes[:authenticated_user_token]
179
+ if attributes.key?(:value)
180
+ self.value = attributes[:value]
184
181
  end
185
182
  end
186
183
 
@@ -207,29 +204,6 @@ module Algolia
207
204
  @event_name = event_name
208
205
  end
209
206
 
210
- # Custom attribute writer method with validation
211
- # @param [Object] query_id Value to be assigned
212
- def query_id=(query_id)
213
- if query_id.nil?
214
- raise ArgumentError, 'query_id cannot be nil'
215
- end
216
-
217
- if query_id.to_s.length > 32
218
- raise ArgumentError, 'invalid value for "query_id", the character length must be smaller than or equal to 32.'
219
- end
220
-
221
- if query_id.to_s.length < 32
222
- raise ArgumentError, 'invalid value for "query_id", the character length must be great than or equal to 32.'
223
- end
224
-
225
- pattern = /[0-9a-f]{32}/
226
- if query_id !~ pattern
227
- raise ArgumentError, "invalid value for \"query_id\", must conform to the pattern #{pattern}."
228
- end
229
-
230
- @query_id = query_id
231
- end
232
-
233
207
  # Custom attribute writer method with validation
234
208
  # @param [Object] object_ids Value to be assigned
235
209
  def object_ids=(object_ids)
@@ -271,6 +245,47 @@ module Algolia
271
245
  @user_token = user_token
272
246
  end
273
247
 
248
+ # Custom attribute writer method with validation
249
+ # @param [Object] authenticated_user_token Value to be assigned
250
+ def authenticated_user_token=(authenticated_user_token)
251
+ if authenticated_user_token.nil?
252
+ raise ArgumentError, 'authenticated_user_token cannot be nil'
253
+ end
254
+
255
+ if authenticated_user_token.to_s.length > 129
256
+ raise ArgumentError, 'invalid value for "authenticated_user_token", the character length must be smaller than or equal to 129.'
257
+ end
258
+
259
+ if authenticated_user_token.to_s.length < 1
260
+ raise ArgumentError, 'invalid value for "authenticated_user_token", the character length must be great than or equal to 1.'
261
+ end
262
+
263
+ pattern = %r{[a-zA-Z0-9_=/+-]{1,129}}
264
+ if authenticated_user_token !~ pattern
265
+ raise ArgumentError, "invalid value for \"authenticated_user_token\", must conform to the pattern #{pattern}."
266
+ end
267
+
268
+ @authenticated_user_token = authenticated_user_token
269
+ end
270
+
271
+ # Custom attribute writer method with validation
272
+ # @param [Object] object_data Value to be assigned
273
+ def object_data=(object_data)
274
+ if object_data.nil?
275
+ raise ArgumentError, 'object_data cannot be nil'
276
+ end
277
+
278
+ if object_data.length > 20
279
+ raise ArgumentError, 'invalid value for "object_data", number of items must be less than or equal to 20.'
280
+ end
281
+
282
+ if object_data.length < 1
283
+ raise ArgumentError, 'invalid value for "object_data", number of items must be greater than or equal to 1.'
284
+ end
285
+
286
+ @object_data = object_data
287
+ end
288
+
274
289
  # Checks equality by comparing each attribute.
275
290
  # @param [Object] Object to be compared
276
291
  def ==(other)
@@ -281,13 +296,13 @@ module Algolia
281
296
  event_type == other.event_type &&
282
297
  event_subtype == other.event_subtype &&
283
298
  index == other.index &&
284
- query_id == other.query_id &&
285
299
  object_ids == other.object_ids &&
286
- object_data == other.object_data &&
287
- currency == other.currency &&
288
300
  user_token == other.user_token &&
301
+ authenticated_user_token == other.authenticated_user_token &&
302
+ currency == other.currency &&
303
+ object_data == other.object_data &&
289
304
  timestamp == other.timestamp &&
290
- authenticated_user_token == other.authenticated_user_token
305
+ value == other.value
291
306
  end
292
307
 
293
308
  # @see the `==` method
@@ -299,7 +314,7 @@ module Algolia
299
314
  # Calculates hash code according to all attributes.
300
315
  # @return [Integer] Hash code
301
316
  def hash
302
- [event_name, event_type, event_subtype, index, query_id, object_ids, object_data, currency, user_token, timestamp, authenticated_user_token].hash
317
+ [event_name, event_type, event_subtype, index, object_ids, user_token, authenticated_user_token, currency, object_data, timestamp, value].hash
303
318
  end
304
319
 
305
320
  # Builds the object from hash
@@ -0,0 +1,97 @@
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 Insights
8
+ # Total monetary value of this event in units of `currency`.
9
+ module Value
10
+ class << self
11
+ # List of class defined in oneOf (OpenAPI v3)
12
+ def openapi_one_of
13
+ [
14
+ :Float,
15
+ :String
16
+ ]
17
+ end
18
+
19
+ # Builds the object
20
+ # @param [Mixed] Data to be matched against the list of oneOf items
21
+ # @return [Object] Returns the model or the data itself
22
+ def build(data)
23
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
24
+ # Note:
25
+ # - We do not attempt to check whether exactly one item matches.
26
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
27
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
28
+ # - TODO: scalar values are de facto behaving as if they were nullable.
29
+ # - TODO: logging when debugging is set.
30
+ openapi_one_of.each do |klass|
31
+ next if klass == :AnyType # "nullable: true"
32
+
33
+ typed_data = find_and_cast_into_type(klass, data)
34
+ return typed_data if typed_data
35
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
36
+ end
37
+
38
+ openapi_one_of.include?(:AnyType) ? data : nil
39
+ end
40
+
41
+ private
42
+
43
+ SchemaMismatchError = Class.new(StandardError)
44
+
45
+ # NOTE: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
46
+ def find_and_cast_into_type(klass, data)
47
+ return if data.nil?
48
+
49
+ case klass.to_s
50
+ when 'Boolean'
51
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
52
+ when 'Float'
53
+ return data if data.instance_of?(Float)
54
+ when 'Integer'
55
+ return data if data.instance_of?(Integer)
56
+ when 'Time'
57
+ return Time.parse(data)
58
+ when 'Date'
59
+ return Date.parse(data)
60
+ when 'String'
61
+ return data if data.instance_of?(String)
62
+ when 'Object' # "type: object"
63
+ return data if data.instance_of?(Hash)
64
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
65
+ if data.instance_of?(Array)
66
+ sub_type = Regexp.last_match[:sub_type]
67
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
68
+ end
69
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
70
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
71
+ sub_type = Regexp.last_match[:sub_type]
72
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
73
+ end
74
+ else # model
75
+ const = Algolia.const_get(klass)
76
+ if const
77
+ if const.respond_to?(:openapi_one_of) # nested oneOf model
78
+ model = const.build(data)
79
+ else
80
+ # raise if data contains keys that are not known to the model
81
+ raise unless (data.keys - const.acceptable_attributes).empty?
82
+
83
+ model = const.build_from_hash(data)
84
+ end
85
+
86
+ return model if model
87
+ end
88
+ end
89
+
90
+ raise # if no match by now, raise
91
+ rescue
92
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
93
+ end
94
+ end
95
+ end
96
+ end
97
+ end
@@ -7,26 +7,26 @@ module Algolia
7
7
  module Insights
8
8
  # Use this method to capture active filters. For example, when browsing a category page, users see content filtered on that specific category.
9
9
  class ViewedFilters
10
- # Can contain 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.
10
+ # The name of the event, 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.
11
11
  attr_accessor :event_name
12
12
 
13
13
  attr_accessor :event_type
14
14
 
15
- # Name of the Algolia index.
15
+ # The name of an Algolia index.
16
16
  attr_accessor :index
17
17
 
18
18
  # Facet filters. Each facet filter string must be URL-encoded, such as, `discount:10%25`.
19
19
  attr_accessor :filters
20
20
 
21
- # Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
21
+ # An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
22
22
  attr_accessor :user_token
23
23
 
24
- # Time of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
25
- attr_accessor :timestamp
26
-
27
- # User token for authenticated users.
24
+ # An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
28
25
  attr_accessor :authenticated_user_token
29
26
 
27
+ # The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
28
+ attr_accessor :timestamp
29
+
30
30
  class EnumAttributeValidator
31
31
  attr_reader :datatype
32
32
  attr_reader :allowable_values
@@ -57,8 +57,8 @@ module Algolia
57
57
  :index => :index,
58
58
  :filters => :filters,
59
59
  :user_token => :userToken,
60
- :timestamp => :timestamp,
61
- :authenticated_user_token => :authenticatedUserToken
60
+ :authenticated_user_token => :authenticatedUserToken,
61
+ :timestamp => :timestamp
62
62
  }
63
63
  end
64
64
 
@@ -75,8 +75,8 @@ module Algolia
75
75
  :index => :String,
76
76
  :filters => :'Array<String>',
77
77
  :user_token => :String,
78
- :timestamp => :Integer,
79
- :authenticated_user_token => :String
78
+ :authenticated_user_token => :String,
79
+ :timestamp => :Integer
80
80
  }
81
81
  end
82
82
 
@@ -134,13 +134,13 @@ module Algolia
134
134
  self.user_token = nil
135
135
  end
136
136
 
137
- if attributes.key?(:timestamp)
138
- self.timestamp = attributes[:timestamp]
139
- end
140
-
141
137
  if attributes.key?(:authenticated_user_token)
142
138
  self.authenticated_user_token = attributes[:authenticated_user_token]
143
139
  end
140
+
141
+ if attributes.key?(:timestamp)
142
+ self.timestamp = attributes[:timestamp]
143
+ end
144
144
  end
145
145
 
146
146
  # Custom attribute writer method with validation
@@ -207,6 +207,29 @@ module Algolia
207
207
  @user_token = user_token
208
208
  end
209
209
 
210
+ # Custom attribute writer method with validation
211
+ # @param [Object] authenticated_user_token Value to be assigned
212
+ def authenticated_user_token=(authenticated_user_token)
213
+ if authenticated_user_token.nil?
214
+ raise ArgumentError, 'authenticated_user_token cannot be nil'
215
+ end
216
+
217
+ if authenticated_user_token.to_s.length > 129
218
+ raise ArgumentError, 'invalid value for "authenticated_user_token", the character length must be smaller than or equal to 129.'
219
+ end
220
+
221
+ if authenticated_user_token.to_s.length < 1
222
+ raise ArgumentError, 'invalid value for "authenticated_user_token", the character length must be great than or equal to 1.'
223
+ end
224
+
225
+ pattern = %r{[a-zA-Z0-9_=/+-]{1,129}}
226
+ if authenticated_user_token !~ pattern
227
+ raise ArgumentError, "invalid value for \"authenticated_user_token\", must conform to the pattern #{pattern}."
228
+ end
229
+
230
+ @authenticated_user_token = authenticated_user_token
231
+ end
232
+
210
233
  # Checks equality by comparing each attribute.
211
234
  # @param [Object] Object to be compared
212
235
  def ==(other)
@@ -218,8 +241,8 @@ module Algolia
218
241
  index == other.index &&
219
242
  filters == other.filters &&
220
243
  user_token == other.user_token &&
221
- timestamp == other.timestamp &&
222
- authenticated_user_token == other.authenticated_user_token
244
+ authenticated_user_token == other.authenticated_user_token &&
245
+ timestamp == other.timestamp
223
246
  end
224
247
 
225
248
  # @see the `==` method
@@ -231,7 +254,7 @@ module Algolia
231
254
  # Calculates hash code according to all attributes.
232
255
  # @return [Integer] Hash code
233
256
  def hash
234
- [event_name, event_type, index, filters, user_token, timestamp, authenticated_user_token].hash
257
+ [event_name, event_type, index, filters, user_token, authenticated_user_token, timestamp].hash
235
258
  end
236
259
 
237
260
  # Builds the object from hash
@@ -7,26 +7,26 @@ module Algolia
7
7
  module Insights
8
8
  # Use this event to track when users viewed items in the search results.
9
9
  class ViewedObjectIDs
10
- # Can contain 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.
10
+ # The name of the event, 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.
11
11
  attr_accessor :event_name
12
12
 
13
13
  attr_accessor :event_type
14
14
 
15
- # Name of the Algolia index.
15
+ # The name of an Algolia index.
16
16
  attr_accessor :index
17
17
 
18
- # List of object identifiers for items of an Algolia index.
18
+ # The object IDs of the records that are part of the event.
19
19
  attr_accessor :object_ids
20
20
 
21
- # Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
21
+ # An anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
22
22
  attr_accessor :user_token
23
23
 
24
- # Time of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
25
- attr_accessor :timestamp
26
-
27
- # User token for authenticated users.
24
+ # An identifier for authenticated users. > **Note**: Never include personally identifiable information in user tokens.
28
25
  attr_accessor :authenticated_user_token
29
26
 
27
+ # The timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
28
+ attr_accessor :timestamp
29
+
30
30
  class EnumAttributeValidator
31
31
  attr_reader :datatype
32
32
  attr_reader :allowable_values
@@ -57,8 +57,8 @@ module Algolia
57
57
  :index => :index,
58
58
  :object_ids => :objectIDs,
59
59
  :user_token => :userToken,
60
- :timestamp => :timestamp,
61
- :authenticated_user_token => :authenticatedUserToken
60
+ :authenticated_user_token => :authenticatedUserToken,
61
+ :timestamp => :timestamp
62
62
  }
63
63
  end
64
64
 
@@ -75,8 +75,8 @@ module Algolia
75
75
  :index => :String,
76
76
  :object_ids => :'Array<String>',
77
77
  :user_token => :String,
78
- :timestamp => :Integer,
79
- :authenticated_user_token => :String
78
+ :authenticated_user_token => :String,
79
+ :timestamp => :Integer
80
80
  }
81
81
  end
82
82
 
@@ -134,13 +134,13 @@ module Algolia
134
134
  self.user_token = nil
135
135
  end
136
136
 
137
- if attributes.key?(:timestamp)
138
- self.timestamp = attributes[:timestamp]
139
- end
140
-
141
137
  if attributes.key?(:authenticated_user_token)
142
138
  self.authenticated_user_token = attributes[:authenticated_user_token]
143
139
  end
140
+
141
+ if attributes.key?(:timestamp)
142
+ self.timestamp = attributes[:timestamp]
143
+ end
144
144
  end
145
145
 
146
146
  # Custom attribute writer method with validation
@@ -207,6 +207,29 @@ module Algolia
207
207
  @user_token = user_token
208
208
  end
209
209
 
210
+ # Custom attribute writer method with validation
211
+ # @param [Object] authenticated_user_token Value to be assigned
212
+ def authenticated_user_token=(authenticated_user_token)
213
+ if authenticated_user_token.nil?
214
+ raise ArgumentError, 'authenticated_user_token cannot be nil'
215
+ end
216
+
217
+ if authenticated_user_token.to_s.length > 129
218
+ raise ArgumentError, 'invalid value for "authenticated_user_token", the character length must be smaller than or equal to 129.'
219
+ end
220
+
221
+ if authenticated_user_token.to_s.length < 1
222
+ raise ArgumentError, 'invalid value for "authenticated_user_token", the character length must be great than or equal to 1.'
223
+ end
224
+
225
+ pattern = %r{[a-zA-Z0-9_=/+-]{1,129}}
226
+ if authenticated_user_token !~ pattern
227
+ raise ArgumentError, "invalid value for \"authenticated_user_token\", must conform to the pattern #{pattern}."
228
+ end
229
+
230
+ @authenticated_user_token = authenticated_user_token
231
+ end
232
+
210
233
  # Checks equality by comparing each attribute.
211
234
  # @param [Object] Object to be compared
212
235
  def ==(other)
@@ -218,8 +241,8 @@ module Algolia
218
241
  index == other.index &&
219
242
  object_ids == other.object_ids &&
220
243
  user_token == other.user_token &&
221
- timestamp == other.timestamp &&
222
- authenticated_user_token == other.authenticated_user_token
244
+ authenticated_user_token == other.authenticated_user_token &&
245
+ timestamp == other.timestamp
223
246
  end
224
247
 
225
248
  # @see the `==` method
@@ -231,7 +254,7 @@ module Algolia
231
254
  # Calculates hash code according to all attributes.
232
255
  # @return [Integer] Hash code
233
256
  def hash
234
- [event_name, event_type, index, object_ids, user_token, timestamp, authenticated_user_token].hash
257
+ [event_name, event_type, index, object_ids, user_token, authenticated_user_token, timestamp].hash
235
258
  end
236
259
 
237
260
  # Builds the object from hash
@@ -1,5 +1,5 @@
1
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
2
 
3
3
  module Algolia
4
- VERSION = '3.0.0.alpha.2'.freeze
4
+ VERSION = '3.0.0.alpha.5'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algolia
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.alpha.2
4
+ version: 3.0.0.alpha.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-09 00:00:00.000000000 Z
11
+ date: 2024-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -113,6 +113,12 @@ executables: []
113
113
  extensions: []
114
114
  extra_rdoc_files: []
115
115
  files:
116
+ - ".github/workflows/release.yml"
117
+ - ".gitignore"
118
+ - ".openapi-generator-ignore"
119
+ - ".openapi-generator/FILES"
120
+ - ".openapi-generator/VERSION"
121
+ - ".rubocop.yml"
116
122
  - CHANGELOG.md
117
123
  - Gemfile
118
124
  - Gemfile.lock
@@ -321,6 +327,7 @@ files:
321
327
  - lib/algolia/models/insights/purchase_event.rb
322
328
  - lib/algolia/models/insights/purchased_object_ids.rb
323
329
  - lib/algolia/models/insights/purchased_object_ids_after_search.rb
330
+ - lib/algolia/models/insights/value.rb
324
331
  - lib/algolia/models/insights/view_event.rb
325
332
  - lib/algolia/models/insights/viewed_filters.rb
326
333
  - lib/algolia/models/insights/viewed_object_ids.rb
@@ -654,7 +661,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
654
661
  - !ruby/object:Gem::Version
655
662
  version: 1.3.1
656
663
  requirements: []
657
- rubygems_version: 3.0.3.1
664
+ rubygems_version: 3.4.10
658
665
  signing_key:
659
666
  specification_version: 4
660
667
  summary: A simple Ruby client for the algolia.com REST API