algolia 3.0.0.alpha.10 → 3.0.0.alpha.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.openapi-generator/FILES +2 -0
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +4 -4
- data/lib/algolia/models/ingestion/mapping_field_directive.rb +214 -0
- data/lib/algolia/models/ingestion/mapping_input.rb +213 -0
- data/lib/algolia/models/ingestion/mapping_kit_action.rb +235 -0
- data/lib/algolia/models/ingestion/on_demand_date_utils_input.rb +13 -4
- data/lib/algolia/models/ingestion/schedule_date_utils_input.rb +13 -4
- data/lib/algolia/models/recommend/base_search_response.rb +14 -4
- data/lib/algolia/models/recommend/recommendations_results.rb +11 -1
- data/lib/algolia/models/search/api_key_operation.rb +34 -0
- data/lib/algolia/models/search/base_search_response.rb +14 -4
- data/lib/algolia/models/search/browse_response.rb +11 -1
- data/lib/algolia/models/search/search_response.rb +11 -1
- data/lib/algolia/models/search/secured_api_key_restrictions.rb +248 -0
- data/lib/algolia/version.rb +1 -1
- metadata +7 -2
@@ -0,0 +1,235 @@
|
|
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 Ingestion
|
8
|
+
# Describes how a destination object should be resolved by means of applying a set of directives.
|
9
|
+
class MappingKitAction
|
10
|
+
# ID to uniquely identify this action.
|
11
|
+
attr_accessor :id
|
12
|
+
|
13
|
+
# Whether this action has any effect.
|
14
|
+
attr_accessor :enabled
|
15
|
+
|
16
|
+
# Condition which must be satisfied to apply the action. If this evaluates to false, the action is not applied, and the process attempts to apply the next action, if any.
|
17
|
+
attr_accessor :trigger
|
18
|
+
|
19
|
+
attr_accessor :field_directives
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:id => :id,
|
25
|
+
:enabled => :enabled,
|
26
|
+
:trigger => :trigger,
|
27
|
+
:field_directives => :fieldDirectives
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Returns all the JSON keys this model knows about
|
32
|
+
def self.acceptable_attributes
|
33
|
+
attribute_map.values
|
34
|
+
end
|
35
|
+
|
36
|
+
# Attribute type mapping.
|
37
|
+
def self.types_mapping
|
38
|
+
{
|
39
|
+
:id => :String,
|
40
|
+
:enabled => :Boolean,
|
41
|
+
:trigger => :String,
|
42
|
+
:field_directives => :'Array<MappingFieldDirective>'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# List of attributes with nullable: true
|
47
|
+
def self.openapi_nullable
|
48
|
+
Set.new([])
|
49
|
+
end
|
50
|
+
|
51
|
+
# Initializes the object
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
53
|
+
def initialize(attributes = {})
|
54
|
+
unless attributes.is_a?(Hash)
|
55
|
+
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::MappingKitAction` initialize method"
|
56
|
+
end
|
57
|
+
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
59
|
+
attributes = attributes.each_with_object({}) do |(k, v), h|
|
60
|
+
unless self.class.attribute_map.key?(k.to_sym)
|
61
|
+
raise ArgumentError,
|
62
|
+
"`#{k}` is not a valid attribute in `Algolia::MappingKitAction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
63
|
+
end
|
64
|
+
|
65
|
+
h[k.to_sym] = v
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes.key?(:id)
|
69
|
+
self.id = attributes[:id]
|
70
|
+
end
|
71
|
+
|
72
|
+
if attributes.key?(:enabled)
|
73
|
+
self.enabled = attributes[:enabled]
|
74
|
+
else
|
75
|
+
self.enabled = nil
|
76
|
+
end
|
77
|
+
|
78
|
+
if attributes.key?(:trigger)
|
79
|
+
self.trigger = attributes[:trigger]
|
80
|
+
else
|
81
|
+
self.trigger = nil
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.key?(:field_directives)
|
85
|
+
if (value = attributes[:field_directives]).is_a?(Array)
|
86
|
+
self.field_directives = value
|
87
|
+
end
|
88
|
+
else
|
89
|
+
self.field_directives = nil
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
# Checks equality by comparing each attribute.
|
94
|
+
# @param [Object] Object to be compared
|
95
|
+
def ==(other)
|
96
|
+
return true if equal?(other)
|
97
|
+
|
98
|
+
self.class == other.class &&
|
99
|
+
id == other.id &&
|
100
|
+
enabled == other.enabled &&
|
101
|
+
trigger == other.trigger &&
|
102
|
+
field_directives == other.field_directives
|
103
|
+
end
|
104
|
+
|
105
|
+
# @see the `==` method
|
106
|
+
# @param [Object] Object to be compared
|
107
|
+
def eql?(other)
|
108
|
+
self == other
|
109
|
+
end
|
110
|
+
|
111
|
+
# Calculates hash code according to all attributes.
|
112
|
+
# @return [Integer] Hash code
|
113
|
+
def hash
|
114
|
+
[id, enabled, trigger, field_directives].hash
|
115
|
+
end
|
116
|
+
|
117
|
+
# Builds the object from hash
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
119
|
+
# @return [Object] Returns the model itself
|
120
|
+
def self.build_from_hash(attributes)
|
121
|
+
return nil unless attributes.is_a?(Hash)
|
122
|
+
|
123
|
+
attributes = attributes.transform_keys(&:to_sym)
|
124
|
+
transformed_hash = {}
|
125
|
+
types_mapping.each_pair do |key, type|
|
126
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
127
|
+
transformed_hash[key.to_sym] = nil
|
128
|
+
elsif type =~ /\AArray<(.*)>/i
|
129
|
+
# check to ensure the input is an array given that the attribute
|
130
|
+
# is documented as an array but the input is not
|
131
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
132
|
+
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
|
133
|
+
end
|
134
|
+
elsif !attributes[attribute_map[key]].nil?
|
135
|
+
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
136
|
+
end
|
137
|
+
end
|
138
|
+
new(transformed_hash)
|
139
|
+
end
|
140
|
+
|
141
|
+
# Deserializes the data based on type
|
142
|
+
# @param string type Data type
|
143
|
+
# @param string value Value to be deserialized
|
144
|
+
# @return [Object] Deserialized data
|
145
|
+
def self._deserialize(type, value)
|
146
|
+
case type.to_sym
|
147
|
+
when :Time
|
148
|
+
Time.parse(value)
|
149
|
+
when :Date
|
150
|
+
Date.parse(value)
|
151
|
+
when :String
|
152
|
+
value.to_s
|
153
|
+
when :Integer
|
154
|
+
value.to_i
|
155
|
+
when :Float
|
156
|
+
value.to_f
|
157
|
+
when :Boolean
|
158
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
159
|
+
true
|
160
|
+
else
|
161
|
+
false
|
162
|
+
end
|
163
|
+
when :Object
|
164
|
+
# generic object (usually a Hash), return directly
|
165
|
+
value
|
166
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
167
|
+
inner_type = Regexp.last_match[:inner_type]
|
168
|
+
value.map { |v| _deserialize(inner_type, v) }
|
169
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
170
|
+
k_type = Regexp.last_match[:k_type]
|
171
|
+
v_type = Regexp.last_match[:v_type]
|
172
|
+
{}.tap do |hash|
|
173
|
+
value.each do |k, v|
|
174
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
175
|
+
end
|
176
|
+
end
|
177
|
+
else # model
|
178
|
+
# models (e.g. Pet) or oneOf
|
179
|
+
klass = Algolia::Ingestion.const_get(type)
|
180
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
# Returns the string representation of the object
|
185
|
+
# @return [String] String presentation of the object
|
186
|
+
def to_s
|
187
|
+
to_hash.to_s
|
188
|
+
end
|
189
|
+
|
190
|
+
# to_body is an alias to to_hash (backward compatibility)
|
191
|
+
# @return [Hash] Returns the object in the form of hash
|
192
|
+
def to_body
|
193
|
+
to_hash
|
194
|
+
end
|
195
|
+
|
196
|
+
def to_json(*_args)
|
197
|
+
to_hash.to_json
|
198
|
+
end
|
199
|
+
|
200
|
+
# Returns the object in the form of hash
|
201
|
+
# @return [Hash] Returns the object in the form of hash
|
202
|
+
def to_hash
|
203
|
+
hash = {}
|
204
|
+
self.class.attribute_map.each_pair do |attr, param|
|
205
|
+
value = send(attr)
|
206
|
+
if value.nil?
|
207
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
208
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
209
|
+
end
|
210
|
+
|
211
|
+
hash[param] = _to_hash(value)
|
212
|
+
end
|
213
|
+
hash
|
214
|
+
end
|
215
|
+
|
216
|
+
# Outputs non-array value in the form of hash
|
217
|
+
# For object, use to_hash. Otherwise, just return the value
|
218
|
+
# @param [Object] value Any valid value
|
219
|
+
# @return [Hash] Returns the value in the form of hash
|
220
|
+
def _to_hash(value)
|
221
|
+
if value.is_a?(Array)
|
222
|
+
value.compact.map { |v| _to_hash(v) }
|
223
|
+
elsif value.is_a?(Hash)
|
224
|
+
{}.tap do |hash|
|
225
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
226
|
+
end
|
227
|
+
elsif value.respond_to? :to_hash
|
228
|
+
value.to_hash
|
229
|
+
else
|
230
|
+
value
|
231
|
+
end
|
232
|
+
end
|
233
|
+
end
|
234
|
+
end
|
235
|
+
end
|
@@ -13,11 +13,14 @@ module Algolia
|
|
13
13
|
# The end date of the extraction (RFC3339 format).
|
14
14
|
attr_accessor :end_date
|
15
15
|
|
16
|
+
attr_accessor :mapping
|
17
|
+
|
16
18
|
# Attribute mapping from ruby-style variable name to JSON key.
|
17
19
|
def self.attribute_map
|
18
20
|
{
|
19
21
|
:start_date => :startDate,
|
20
|
-
:end_date => :endDate
|
22
|
+
:end_date => :endDate,
|
23
|
+
:mapping => :mapping
|
21
24
|
}
|
22
25
|
end
|
23
26
|
|
@@ -30,7 +33,8 @@ module Algolia
|
|
30
33
|
def self.types_mapping
|
31
34
|
{
|
32
35
|
:start_date => :String,
|
33
|
-
:end_date => :String
|
36
|
+
:end_date => :String,
|
37
|
+
:mapping => :MappingInput
|
34
38
|
}
|
35
39
|
end
|
36
40
|
|
@@ -67,6 +71,10 @@ module Algolia
|
|
67
71
|
else
|
68
72
|
self.end_date = nil
|
69
73
|
end
|
74
|
+
|
75
|
+
if attributes.key?(:mapping)
|
76
|
+
self.mapping = attributes[:mapping]
|
77
|
+
end
|
70
78
|
end
|
71
79
|
|
72
80
|
# Checks equality by comparing each attribute.
|
@@ -76,7 +84,8 @@ module Algolia
|
|
76
84
|
|
77
85
|
self.class == other.class &&
|
78
86
|
start_date == other.start_date &&
|
79
|
-
end_date == other.end_date
|
87
|
+
end_date == other.end_date &&
|
88
|
+
mapping == other.mapping
|
80
89
|
end
|
81
90
|
|
82
91
|
# @see the `==` method
|
@@ -88,7 +97,7 @@ module Algolia
|
|
88
97
|
# Calculates hash code according to all attributes.
|
89
98
|
# @return [Integer] Hash code
|
90
99
|
def hash
|
91
|
-
[start_date, end_date].hash
|
100
|
+
[start_date, end_date, mapping].hash
|
92
101
|
end
|
93
102
|
|
94
103
|
# Builds the object from hash
|
@@ -10,10 +10,13 @@ module Algolia
|
|
10
10
|
# The timeframe of the extraction, in number of days from today.
|
11
11
|
attr_accessor :timeframe
|
12
12
|
|
13
|
+
attr_accessor :mapping
|
14
|
+
|
13
15
|
# Attribute mapping from ruby-style variable name to JSON key.
|
14
16
|
def self.attribute_map
|
15
17
|
{
|
16
|
-
:timeframe => :timeframe
|
18
|
+
:timeframe => :timeframe,
|
19
|
+
:mapping => :mapping
|
17
20
|
}
|
18
21
|
end
|
19
22
|
|
@@ -25,7 +28,8 @@ module Algolia
|
|
25
28
|
# Attribute type mapping.
|
26
29
|
def self.types_mapping
|
27
30
|
{
|
28
|
-
:timeframe => :Integer
|
31
|
+
:timeframe => :Integer,
|
32
|
+
:mapping => :MappingInput
|
29
33
|
}
|
30
34
|
end
|
31
35
|
|
@@ -56,6 +60,10 @@ module Algolia
|
|
56
60
|
else
|
57
61
|
self.timeframe = nil
|
58
62
|
end
|
63
|
+
|
64
|
+
if attributes.key?(:mapping)
|
65
|
+
self.mapping = attributes[:mapping]
|
66
|
+
end
|
59
67
|
end
|
60
68
|
|
61
69
|
# Custom attribute writer method with validation
|
@@ -82,7 +90,8 @@ module Algolia
|
|
82
90
|
return true if equal?(other)
|
83
91
|
|
84
92
|
self.class == other.class &&
|
85
|
-
timeframe == other.timeframe
|
93
|
+
timeframe == other.timeframe &&
|
94
|
+
mapping == other.mapping
|
86
95
|
end
|
87
96
|
|
88
97
|
# @see the `==` method
|
@@ -94,7 +103,7 @@ module Algolia
|
|
94
103
|
# Calculates hash code according to all attributes.
|
95
104
|
# @return [Integer] Hash code
|
96
105
|
def hash
|
97
|
-
[timeframe].hash
|
106
|
+
[timeframe, mapping].hash
|
98
107
|
end
|
99
108
|
|
100
109
|
# Builds the object from hash
|
@@ -84,6 +84,9 @@ module Algolia
|
|
84
84
|
# Lets you store custom data in your indices.
|
85
85
|
attr_accessor :user_data
|
86
86
|
|
87
|
+
# Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/).
|
88
|
+
attr_accessor :query_id
|
89
|
+
|
87
90
|
attr_accessor :additional_properties
|
88
91
|
|
89
92
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -115,7 +118,8 @@ module Algolia
|
|
115
118
|
:rendering_content => :renderingContent,
|
116
119
|
:server_time_ms => :serverTimeMS,
|
117
120
|
:server_used => :serverUsed,
|
118
|
-
:user_data => :userData
|
121
|
+
:user_data => :userData,
|
122
|
+
:query_id => :queryID
|
119
123
|
}
|
120
124
|
end
|
121
125
|
|
@@ -153,7 +157,8 @@ module Algolia
|
|
153
157
|
:rendering_content => :RenderingContent,
|
154
158
|
:server_time_ms => :Integer,
|
155
159
|
:server_used => :String,
|
156
|
-
:user_data => :Object
|
160
|
+
:user_data => :Object,
|
161
|
+
:query_id => :String
|
157
162
|
}
|
158
163
|
end
|
159
164
|
|
@@ -293,6 +298,10 @@ module Algolia
|
|
293
298
|
self.user_data = attributes[:user_data]
|
294
299
|
end
|
295
300
|
|
301
|
+
if attributes.key?(:query_id)
|
302
|
+
self.query_id = attributes[:query_id]
|
303
|
+
end
|
304
|
+
|
296
305
|
# add extra attribute to additional_properties
|
297
306
|
self.additional_properties ||= {}
|
298
307
|
self.additional_properties.merge!(attributes.reject { |k, _| self.class.attribute_map.key?(k.to_sym) })
|
@@ -377,7 +386,8 @@ module Algolia
|
|
377
386
|
rendering_content == other.rendering_content &&
|
378
387
|
server_time_ms == other.server_time_ms &&
|
379
388
|
server_used == other.server_used &&
|
380
|
-
user_data == other.user_data
|
389
|
+
user_data == other.user_data &&
|
390
|
+
query_id == other.query_id
|
381
391
|
end
|
382
392
|
|
383
393
|
# @see the `==` method
|
@@ -390,7 +400,7 @@ module Algolia
|
|
390
400
|
# @return [Integer] Hash code
|
391
401
|
def hash
|
392
402
|
[ab_test_id, ab_test_variant_id, around_lat_lng, automatic_radius, exhaustive, exhaustive_facets_count, exhaustive_nb_hits, exhaustive_typo, facets, facets_stats,
|
393
|
-
hits_per_page, index, index_used, message, nb_hits, nb_pages, nb_sorted_hits, page, parsed_query, processing_time_ms, processing_timings_ms, query_after_removal, redirect, rendering_content, server_time_ms, server_used, user_data].hash
|
403
|
+
hits_per_page, index, index_used, message, nb_hits, nb_pages, nb_sorted_hits, page, parsed_query, processing_time_ms, processing_timings_ms, query_after_removal, redirect, rendering_content, server_time_ms, server_used, user_data, query_id].hash
|
394
404
|
end
|
395
405
|
|
396
406
|
# Builds the object from hash
|
@@ -84,6 +84,9 @@ module Algolia
|
|
84
84
|
# Lets you store custom data in your indices.
|
85
85
|
attr_accessor :user_data
|
86
86
|
|
87
|
+
# Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/).
|
88
|
+
attr_accessor :query_id
|
89
|
+
|
87
90
|
attr_accessor :hits
|
88
91
|
|
89
92
|
# Text to search for in an index.
|
@@ -122,6 +125,7 @@ module Algolia
|
|
122
125
|
:server_time_ms => :serverTimeMS,
|
123
126
|
:server_used => :serverUsed,
|
124
127
|
:user_data => :userData,
|
128
|
+
:query_id => :queryID,
|
125
129
|
:hits => :hits,
|
126
130
|
:query => :query,
|
127
131
|
:params => :params
|
@@ -163,6 +167,7 @@ module Algolia
|
|
163
167
|
:server_time_ms => :Integer,
|
164
168
|
:server_used => :String,
|
165
169
|
:user_data => :Object,
|
170
|
+
:query_id => :String,
|
166
171
|
:hits => :'Array<RecommendationsHit>',
|
167
172
|
:query => :String,
|
168
173
|
:params => :String
|
@@ -321,6 +326,10 @@ module Algolia
|
|
321
326
|
self.user_data = attributes[:user_data]
|
322
327
|
end
|
323
328
|
|
329
|
+
if attributes.key?(:query_id)
|
330
|
+
self.query_id = attributes[:query_id]
|
331
|
+
end
|
332
|
+
|
324
333
|
if attributes.key?(:hits)
|
325
334
|
if (value = attributes[:hits]).is_a?(Array)
|
326
335
|
self.hits = value
|
@@ -418,6 +427,7 @@ module Algolia
|
|
418
427
|
server_time_ms == other.server_time_ms &&
|
419
428
|
server_used == other.server_used &&
|
420
429
|
user_data == other.user_data &&
|
430
|
+
query_id == other.query_id &&
|
421
431
|
hits == other.hits &&
|
422
432
|
query == other.query &&
|
423
433
|
params == other.params
|
@@ -433,7 +443,7 @@ module Algolia
|
|
433
443
|
# @return [Integer] Hash code
|
434
444
|
def hash
|
435
445
|
[ab_test_id, ab_test_variant_id, around_lat_lng, automatic_radius, exhaustive, exhaustive_facets_count, exhaustive_nb_hits, exhaustive_typo, facets, facets_stats,
|
436
|
-
hits_per_page, index, index_used, message, nb_hits, nb_pages, nb_sorted_hits, page, parsed_query, processing_time_ms, processing_timings_ms, query_after_removal, redirect, rendering_content, server_time_ms, server_used, user_data, hits, query, params].hash
|
446
|
+
hits_per_page, index, index_used, message, nb_hits, nb_pages, nb_sorted_hits, page, parsed_query, processing_time_ms, processing_timings_ms, query_after_removal, redirect, rendering_content, server_time_ms, server_used, user_data, query_id, hits, query, params].hash
|
437
447
|
end
|
438
448
|
|
439
449
|
# Builds the object from hash
|
@@ -0,0 +1,34 @@
|
|
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 Search
|
8
|
+
class ApiKeyOperation
|
9
|
+
ADD = "add".freeze
|
10
|
+
DELETE = "delete".freeze
|
11
|
+
UPDATE = "update".freeze
|
12
|
+
|
13
|
+
def self.all_vars
|
14
|
+
@all_vars ||= [ADD, DELETE, UPDATE].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 ApiKeyOperation.all_vars.include?(value)
|
29
|
+
|
30
|
+
raise "Invalid ENUM value #{value} for class #ApiKeyOperation"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -84,6 +84,9 @@ module Algolia
|
|
84
84
|
# Lets you store custom data in your indices.
|
85
85
|
attr_accessor :user_data
|
86
86
|
|
87
|
+
# Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/).
|
88
|
+
attr_accessor :query_id
|
89
|
+
|
87
90
|
attr_accessor :additional_properties
|
88
91
|
|
89
92
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -115,7 +118,8 @@ module Algolia
|
|
115
118
|
:rendering_content => :renderingContent,
|
116
119
|
:server_time_ms => :serverTimeMS,
|
117
120
|
:server_used => :serverUsed,
|
118
|
-
:user_data => :userData
|
121
|
+
:user_data => :userData,
|
122
|
+
:query_id => :queryID
|
119
123
|
}
|
120
124
|
end
|
121
125
|
|
@@ -153,7 +157,8 @@ module Algolia
|
|
153
157
|
:rendering_content => :RenderingContent,
|
154
158
|
:server_time_ms => :Integer,
|
155
159
|
:server_used => :String,
|
156
|
-
:user_data => :Object
|
160
|
+
:user_data => :Object,
|
161
|
+
:query_id => :String
|
157
162
|
}
|
158
163
|
end
|
159
164
|
|
@@ -293,6 +298,10 @@ module Algolia
|
|
293
298
|
self.user_data = attributes[:user_data]
|
294
299
|
end
|
295
300
|
|
301
|
+
if attributes.key?(:query_id)
|
302
|
+
self.query_id = attributes[:query_id]
|
303
|
+
end
|
304
|
+
|
296
305
|
# add extra attribute to additional_properties
|
297
306
|
self.additional_properties ||= {}
|
298
307
|
self.additional_properties.merge!(attributes.reject { |k, _| self.class.attribute_map.key?(k.to_sym) })
|
@@ -377,7 +386,8 @@ module Algolia
|
|
377
386
|
rendering_content == other.rendering_content &&
|
378
387
|
server_time_ms == other.server_time_ms &&
|
379
388
|
server_used == other.server_used &&
|
380
|
-
user_data == other.user_data
|
389
|
+
user_data == other.user_data &&
|
390
|
+
query_id == other.query_id
|
381
391
|
end
|
382
392
|
|
383
393
|
# @see the `==` method
|
@@ -390,7 +400,7 @@ module Algolia
|
|
390
400
|
# @return [Integer] Hash code
|
391
401
|
def hash
|
392
402
|
[ab_test_id, ab_test_variant_id, around_lat_lng, automatic_radius, exhaustive, exhaustive_facets_count, exhaustive_nb_hits, exhaustive_typo, facets, facets_stats,
|
393
|
-
hits_per_page, index, index_used, message, nb_hits, nb_pages, nb_sorted_hits, page, parsed_query, processing_time_ms, processing_timings_ms, query_after_removal, redirect, rendering_content, server_time_ms, server_used, user_data].hash
|
403
|
+
hits_per_page, index, index_used, message, nb_hits, nb_pages, nb_sorted_hits, page, parsed_query, processing_time_ms, processing_timings_ms, query_after_removal, redirect, rendering_content, server_time_ms, server_used, user_data, query_id].hash
|
394
404
|
end
|
395
405
|
|
396
406
|
# Builds the object from hash
|
@@ -84,6 +84,9 @@ module Algolia
|
|
84
84
|
# Lets you store custom data in your indices.
|
85
85
|
attr_accessor :user_data
|
86
86
|
|
87
|
+
# Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/).
|
88
|
+
attr_accessor :query_id
|
89
|
+
|
87
90
|
attr_accessor :hits
|
88
91
|
|
89
92
|
# Text to search for in an index.
|
@@ -125,6 +128,7 @@ module Algolia
|
|
125
128
|
:server_time_ms => :serverTimeMS,
|
126
129
|
:server_used => :serverUsed,
|
127
130
|
:user_data => :userData,
|
131
|
+
:query_id => :queryID,
|
128
132
|
:hits => :hits,
|
129
133
|
:query => :query,
|
130
134
|
:params => :params,
|
@@ -167,6 +171,7 @@ module Algolia
|
|
167
171
|
:server_time_ms => :Integer,
|
168
172
|
:server_used => :String,
|
169
173
|
:user_data => :Object,
|
174
|
+
:query_id => :String,
|
170
175
|
:hits => :'Array<Hit>',
|
171
176
|
:query => :String,
|
172
177
|
:params => :String,
|
@@ -327,6 +332,10 @@ module Algolia
|
|
327
332
|
self.user_data = attributes[:user_data]
|
328
333
|
end
|
329
334
|
|
335
|
+
if attributes.key?(:query_id)
|
336
|
+
self.query_id = attributes[:query_id]
|
337
|
+
end
|
338
|
+
|
330
339
|
if attributes.key?(:hits)
|
331
340
|
if (value = attributes[:hits]).is_a?(Array)
|
332
341
|
self.hits = value
|
@@ -432,6 +441,7 @@ module Algolia
|
|
432
441
|
server_time_ms == other.server_time_ms &&
|
433
442
|
server_used == other.server_used &&
|
434
443
|
user_data == other.user_data &&
|
444
|
+
query_id == other.query_id &&
|
435
445
|
hits == other.hits &&
|
436
446
|
query == other.query &&
|
437
447
|
params == other.params &&
|
@@ -448,7 +458,7 @@ module Algolia
|
|
448
458
|
# @return [Integer] Hash code
|
449
459
|
def hash
|
450
460
|
[ab_test_id, ab_test_variant_id, around_lat_lng, automatic_radius, exhaustive, exhaustive_facets_count, exhaustive_nb_hits, exhaustive_typo, facets, facets_stats,
|
451
|
-
hits_per_page, index, index_used, message, nb_hits, nb_pages, nb_sorted_hits, page, parsed_query, processing_time_ms, processing_timings_ms, query_after_removal, redirect, rendering_content, server_time_ms, server_used, user_data, hits, query, params, cursor].hash
|
461
|
+
hits_per_page, index, index_used, message, nb_hits, nb_pages, nb_sorted_hits, page, parsed_query, processing_time_ms, processing_timings_ms, query_after_removal, redirect, rendering_content, server_time_ms, server_used, user_data, query_id, hits, query, params, cursor].hash
|
452
462
|
end
|
453
463
|
|
454
464
|
# Builds the object from hash
|
@@ -84,6 +84,9 @@ module Algolia
|
|
84
84
|
# Lets you store custom data in your indices.
|
85
85
|
attr_accessor :user_data
|
86
86
|
|
87
|
+
# Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/).
|
88
|
+
attr_accessor :query_id
|
89
|
+
|
87
90
|
attr_accessor :hits
|
88
91
|
|
89
92
|
# Text to search for in an index.
|
@@ -124,6 +127,7 @@ module Algolia
|
|
124
127
|
:server_time_ms => :serverTimeMS,
|
125
128
|
:server_used => :serverUsed,
|
126
129
|
:user_data => :userData,
|
130
|
+
:query_id => :queryID,
|
127
131
|
:hits => :hits,
|
128
132
|
:query => :query,
|
129
133
|
:params => :params
|
@@ -165,6 +169,7 @@ module Algolia
|
|
165
169
|
:server_time_ms => :Integer,
|
166
170
|
:server_used => :String,
|
167
171
|
:user_data => :Object,
|
172
|
+
:query_id => :String,
|
168
173
|
:hits => :'Array<Hit>',
|
169
174
|
:query => :String,
|
170
175
|
:params => :String
|
@@ -313,6 +318,10 @@ module Algolia
|
|
313
318
|
self.user_data = attributes[:user_data]
|
314
319
|
end
|
315
320
|
|
321
|
+
if attributes.key?(:query_id)
|
322
|
+
self.query_id = attributes[:query_id]
|
323
|
+
end
|
324
|
+
|
316
325
|
if attributes.key?(:hits)
|
317
326
|
if (value = attributes[:hits]).is_a?(Array)
|
318
327
|
self.hits = value
|
@@ -418,6 +427,7 @@ module Algolia
|
|
418
427
|
server_time_ms == other.server_time_ms &&
|
419
428
|
server_used == other.server_used &&
|
420
429
|
user_data == other.user_data &&
|
430
|
+
query_id == other.query_id &&
|
421
431
|
hits == other.hits &&
|
422
432
|
query == other.query &&
|
423
433
|
params == other.params
|
@@ -433,7 +443,7 @@ module Algolia
|
|
433
443
|
# @return [Integer] Hash code
|
434
444
|
def hash
|
435
445
|
[ab_test_id, ab_test_variant_id, around_lat_lng, automatic_radius, exhaustive, exhaustive_facets_count, exhaustive_nb_hits, exhaustive_typo, facets, facets_stats,
|
436
|
-
hits_per_page, index, index_used, message, nb_hits, nb_pages, nb_sorted_hits, page, parsed_query, processing_time_ms, processing_timings_ms, query_after_removal, redirect, rendering_content, server_time_ms, server_used, user_data, hits, query, params].hash
|
446
|
+
hits_per_page, index, index_used, message, nb_hits, nb_pages, nb_sorted_hits, page, parsed_query, processing_time_ms, processing_timings_ms, query_after_removal, redirect, rendering_content, server_time_ms, server_used, user_data, query_id, hits, query, params].hash
|
437
447
|
end
|
438
448
|
|
439
449
|
# Builds the object from hash
|