algolia 3.0.0.alpha.14 → 3.0.0.alpha.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +2 -2
- data/lib/algolia/api/abtesting_client.rb +4 -4
- data/lib/algolia/api/analytics_client.rb +268 -98
- data/lib/algolia/api/ingestion_client.rb +4 -4
- data/lib/algolia/api/insights_client.rb +4 -4
- data/lib/algolia/api/monitoring_client.rb +4 -4
- data/lib/algolia/api/personalization_client.rb +4 -4
- data/lib/algolia/api/query_suggestions_client.rb +4 -4
- data/lib/algolia/api/recommend_client.rb +4 -4
- data/lib/algolia/api/search_client.rb +4 -4
- data/lib/algolia/models/abtesting/{currencies_value.rb → currency.rb} +3 -3
- data/lib/algolia/models/abtesting/variant.rb +2 -5
- data/lib/algolia/models/analytics/click_positions_inner.rb +242 -0
- data/lib/algolia/models/analytics/currencies_value.rb +208 -0
- data/lib/algolia/models/analytics/daily_add_to_cart_rates.rb +265 -0
- data/lib/algolia/models/analytics/daily_average_clicks.rb +249 -0
- data/lib/algolia/models/analytics/{click_through_rate_event.rb → daily_click_through_rates.rb} +24 -14
- data/lib/algolia/models/analytics/daily_conversion_rates.rb +265 -0
- data/lib/algolia/models/analytics/{no_click_rate_event.rb → daily_no_click_rates.rb} +21 -7
- data/lib/algolia/models/analytics/{no_results_rate_event.rb → daily_no_results_rates.rb} +7 -7
- data/lib/algolia/models/analytics/{conversion_rate_event.rb → daily_purchase_rates.rb} +18 -22
- data/lib/algolia/models/analytics/{average_click_event.rb → daily_revenue.rb} +15 -25
- data/lib/algolia/models/analytics/{search_event.rb → daily_searches.rb} +4 -4
- data/lib/algolia/models/analytics/{search_no_result_event.rb → daily_searches_no_clicks.rb} +19 -5
- data/lib/algolia/models/analytics/{search_no_click_event.rb → daily_searches_no_results.rb} +19 -5
- data/lib/algolia/models/analytics/{user_with_date.rb → daily_users.rb} +5 -5
- data/lib/algolia/models/analytics/get_add_to_cart_rate_response.rb +267 -0
- data/lib/algolia/models/analytics/get_average_click_position_response.rb +31 -5
- data/lib/algolia/models/analytics/get_click_positions_response.rb +6 -6
- data/lib/algolia/models/analytics/get_click_through_rate_response.rb +22 -12
- data/lib/algolia/models/analytics/get_conversion_rate_response.rb +267 -0
- data/lib/algolia/models/analytics/get_no_click_rate_response.rb +19 -5
- data/lib/algolia/models/analytics/get_no_results_rate_response.rb +5 -5
- data/lib/algolia/models/analytics/{get_conversation_rate_response.rb → get_purchase_rate_response.rb} +19 -23
- data/lib/algolia/models/analytics/{click_position.rb → get_revenue.rb} +23 -21
- data/lib/algolia/models/analytics/get_searches_count_response.rb +2 -2
- data/lib/algolia/models/analytics/get_searches_no_clicks_response.rb +2 -2
- data/lib/algolia/models/analytics/get_searches_no_results_response.rb +2 -2
- data/lib/algolia/models/analytics/get_status_response.rb +4 -2
- data/lib/algolia/models/analytics/get_top_countries_response.rb +1 -1
- data/lib/algolia/models/analytics/get_top_filter_attributes_response.rb +1 -1
- data/lib/algolia/models/analytics/get_top_filter_for_attribute.rb +23 -2
- data/lib/algolia/models/analytics/get_top_filters_no_results_response.rb +4 -2
- data/lib/algolia/models/analytics/get_top_filters_no_results_value.rb +23 -2
- data/lib/algolia/models/analytics/get_top_hits_response.rb +2 -1
- data/lib/algolia/models/analytics/get_top_searches_response.rb +2 -1
- data/lib/algolia/models/analytics/get_users_count_response.rb +3 -3
- data/lib/algolia/models/analytics/operator.rb +38 -0
- data/lib/algolia/models/analytics/top_country.rb +1 -1
- data/lib/algolia/models/analytics/top_hit.rb +1 -1
- data/lib/algolia/models/analytics/top_hit_with_analytics.rb +60 -21
- data/lib/algolia/models/analytics/top_hit_with_revenue_analytics.rb +437 -0
- data/lib/algolia/models/analytics/top_hits_response.rb +1 -1
- data/lib/algolia/models/analytics/top_hits_response_with_analytics.rb +1 -1
- data/lib/algolia/models/analytics/top_hits_response_with_revenue_analytics.rb +201 -0
- data/lib/algolia/models/analytics/top_search.rb +2 -2
- data/lib/algolia/models/analytics/top_search_with_analytics.rb +99 -17
- data/lib/algolia/models/analytics/top_search_with_revenue_analytics.rb +504 -0
- data/lib/algolia/models/analytics/top_searches_response.rb +1 -1
- data/lib/algolia/models/analytics/top_searches_response_with_analytics.rb +1 -1
- data/lib/algolia/models/analytics/top_searches_response_with_revenue_analytics.rb +201 -0
- data/lib/algolia/version.rb +1 -1
- metadata +26 -14
@@ -6,13 +6,13 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module Analytics
|
8
8
|
class GetAverageClickPositionResponse
|
9
|
-
# Average
|
9
|
+
# Average position of a clicked search result in the list of search results. If null, Algolia didn't receive any search requests with `clickAnalytics` set to true.
|
10
10
|
attr_accessor :average
|
11
11
|
|
12
|
-
# Number of
|
12
|
+
# Number of clicks associated with this search.
|
13
13
|
attr_accessor :click_count
|
14
14
|
|
15
|
-
#
|
15
|
+
# Daily average click positions.
|
16
16
|
attr_accessor :dates
|
17
17
|
|
18
18
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -34,13 +34,15 @@ module Algolia
|
|
34
34
|
{
|
35
35
|
:average => :Float,
|
36
36
|
:click_count => :Integer,
|
37
|
-
:dates => :'Array<
|
37
|
+
:dates => :'Array<DailyAverageClicks>'
|
38
38
|
}
|
39
39
|
end
|
40
40
|
|
41
41
|
# List of attributes with nullable: true
|
42
42
|
def self.openapi_nullable
|
43
|
-
Set.new([
|
43
|
+
Set.new([
|
44
|
+
:average
|
45
|
+
])
|
44
46
|
end
|
45
47
|
|
46
48
|
# Initializes the object
|
@@ -81,6 +83,30 @@ module Algolia
|
|
81
83
|
end
|
82
84
|
end
|
83
85
|
|
86
|
+
# Custom attribute writer method with validation
|
87
|
+
# @param [Object] average Value to be assigned
|
88
|
+
def average=(average)
|
89
|
+
if !average.nil? && average < 1
|
90
|
+
raise ArgumentError, 'invalid value for "average", must be greater than or equal to 1.'
|
91
|
+
end
|
92
|
+
|
93
|
+
@average = average
|
94
|
+
end
|
95
|
+
|
96
|
+
# Custom attribute writer method with validation
|
97
|
+
# @param [Object] click_count Value to be assigned
|
98
|
+
def click_count=(click_count)
|
99
|
+
if click_count.nil?
|
100
|
+
raise ArgumentError, 'click_count cannot be nil'
|
101
|
+
end
|
102
|
+
|
103
|
+
if click_count < 0
|
104
|
+
raise ArgumentError, 'invalid value for "click_count", must be greater than or equal to 0.'
|
105
|
+
end
|
106
|
+
|
107
|
+
@click_count = click_count
|
108
|
+
end
|
109
|
+
|
84
110
|
# Checks equality by comparing each attribute.
|
85
111
|
# @param [Object] Object to be compared
|
86
112
|
def ==(other)
|
@@ -6,7 +6,7 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module Analytics
|
8
8
|
class GetClickPositionsResponse
|
9
|
-
#
|
9
|
+
# List of positions in the search results and clicks associated with this search.
|
10
10
|
attr_accessor :positions
|
11
11
|
|
12
12
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -24,7 +24,7 @@ module Algolia
|
|
24
24
|
# Attribute type mapping.
|
25
25
|
def self.types_mapping
|
26
26
|
{
|
27
|
-
:positions => :'Array<
|
27
|
+
:positions => :'Array<ClickPositionsInner>'
|
28
28
|
}
|
29
29
|
end
|
30
30
|
|
@@ -66,12 +66,12 @@ module Algolia
|
|
66
66
|
raise ArgumentError, 'positions cannot be nil'
|
67
67
|
end
|
68
68
|
|
69
|
-
if positions.length >
|
70
|
-
raise ArgumentError, 'invalid value for "positions", number of items must be less than or equal to
|
69
|
+
if positions.length > 12
|
70
|
+
raise ArgumentError, 'invalid value for "positions", number of items must be less than or equal to 12.'
|
71
71
|
end
|
72
72
|
|
73
|
-
if positions.length <
|
74
|
-
raise ArgumentError, 'invalid value for "positions", number of items must be greater than or equal to
|
73
|
+
if positions.length < 12
|
74
|
+
raise ArgumentError, 'invalid value for "positions", number of items must be greater than or equal to 12.'
|
75
75
|
end
|
76
76
|
|
77
77
|
@positions = positions
|
@@ -6,16 +6,16 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module Analytics
|
8
8
|
class GetClickThroughRateResponse
|
9
|
-
#
|
9
|
+
# Click-through rate, calculated as number of tracked searches with at least one click event divided by the number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to true.
|
10
10
|
attr_accessor :rate
|
11
11
|
|
12
|
-
# Number of
|
12
|
+
# Number of clicks associated with this search.
|
13
13
|
attr_accessor :click_count
|
14
14
|
|
15
|
-
# Number of tracked searches.
|
15
|
+
# Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
|
16
16
|
attr_accessor :tracked_search_count
|
17
17
|
|
18
|
-
#
|
18
|
+
# Daily click-through rates.
|
19
19
|
attr_accessor :dates
|
20
20
|
|
21
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -39,14 +39,14 @@ module Algolia
|
|
39
39
|
:rate => :Float,
|
40
40
|
:click_count => :Integer,
|
41
41
|
:tracked_search_count => :Integer,
|
42
|
-
:dates => :'Array<
|
42
|
+
:dates => :'Array<DailyClickThroughRates>'
|
43
43
|
}
|
44
44
|
end
|
45
45
|
|
46
46
|
# List of attributes with nullable: true
|
47
47
|
def self.openapi_nullable
|
48
48
|
Set.new([
|
49
|
-
:
|
49
|
+
:rate
|
50
50
|
])
|
51
51
|
end
|
52
52
|
|
@@ -97,21 +97,31 @@ module Algolia
|
|
97
97
|
# Custom attribute writer method with validation
|
98
98
|
# @param [Object] rate Value to be assigned
|
99
99
|
def rate=(rate)
|
100
|
-
if rate.nil?
|
101
|
-
raise ArgumentError, 'rate cannot be nil'
|
102
|
-
end
|
103
|
-
|
104
|
-
if rate > 1
|
100
|
+
if !rate.nil? && rate > 1
|
105
101
|
raise ArgumentError, 'invalid value for "rate", must be smaller than or equal to 1.'
|
106
102
|
end
|
107
103
|
|
108
|
-
if rate < 0
|
104
|
+
if !rate.nil? && rate < 0
|
109
105
|
raise ArgumentError, 'invalid value for "rate", must be greater than or equal to 0.'
|
110
106
|
end
|
111
107
|
|
112
108
|
@rate = rate
|
113
109
|
end
|
114
110
|
|
111
|
+
# Custom attribute writer method with validation
|
112
|
+
# @param [Object] click_count Value to be assigned
|
113
|
+
def click_count=(click_count)
|
114
|
+
if click_count.nil?
|
115
|
+
raise ArgumentError, 'click_count cannot be nil'
|
116
|
+
end
|
117
|
+
|
118
|
+
if click_count < 0
|
119
|
+
raise ArgumentError, 'invalid value for "click_count", must be greater than or equal to 0.'
|
120
|
+
end
|
121
|
+
|
122
|
+
@click_count = click_count
|
123
|
+
end
|
124
|
+
|
115
125
|
# Checks equality by comparing each attribute.
|
116
126
|
# @param [Object] Object to be compared
|
117
127
|
def ==(other)
|
@@ -0,0 +1,267 @@
|
|
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 Analytics
|
8
|
+
class GetConversionRateResponse
|
9
|
+
# Conversion rate, calculated as number of tracked searches with at least one conversion event divided by the number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to true.
|
10
|
+
attr_accessor :rate
|
11
|
+
|
12
|
+
# Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
|
13
|
+
attr_accessor :tracked_search_count
|
14
|
+
|
15
|
+
# Number of conversions from this search.
|
16
|
+
attr_accessor :conversion_count
|
17
|
+
|
18
|
+
# Daily conversion rates.
|
19
|
+
attr_accessor :dates
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:rate => :rate,
|
25
|
+
:tracked_search_count => :trackedSearchCount,
|
26
|
+
:conversion_count => :conversionCount,
|
27
|
+
:dates => :dates
|
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
|
+
:rate => :Float,
|
40
|
+
:tracked_search_count => :Integer,
|
41
|
+
:conversion_count => :Integer,
|
42
|
+
:dates => :'Array<DailyConversionRates>'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# List of attributes with nullable: true
|
47
|
+
def self.openapi_nullable
|
48
|
+
Set.new([
|
49
|
+
:rate
|
50
|
+
])
|
51
|
+
end
|
52
|
+
|
53
|
+
# Initializes the object
|
54
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
55
|
+
def initialize(attributes = {})
|
56
|
+
unless attributes.is_a?(Hash)
|
57
|
+
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::GetConversionRateResponse` initialize method"
|
58
|
+
end
|
59
|
+
|
60
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
61
|
+
attributes = attributes.each_with_object({}) do |(k, v), h|
|
62
|
+
unless self.class.attribute_map.key?(k.to_sym)
|
63
|
+
raise ArgumentError,
|
64
|
+
"`#{k}` is not a valid attribute in `Algolia::GetConversionRateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
65
|
+
end
|
66
|
+
|
67
|
+
h[k.to_sym] = v
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:rate)
|
71
|
+
self.rate = attributes[:rate]
|
72
|
+
else
|
73
|
+
self.rate = nil
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.key?(:tracked_search_count)
|
77
|
+
self.tracked_search_count = attributes[:tracked_search_count]
|
78
|
+
else
|
79
|
+
self.tracked_search_count = nil
|
80
|
+
end
|
81
|
+
|
82
|
+
if attributes.key?(:conversion_count)
|
83
|
+
self.conversion_count = attributes[:conversion_count]
|
84
|
+
else
|
85
|
+
self.conversion_count = nil
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes.key?(:dates)
|
89
|
+
if (value = attributes[:dates]).is_a?(Array)
|
90
|
+
self.dates = value
|
91
|
+
end
|
92
|
+
else
|
93
|
+
self.dates = nil
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
# Custom attribute writer method with validation
|
98
|
+
# @param [Object] rate Value to be assigned
|
99
|
+
def rate=(rate)
|
100
|
+
if !rate.nil? && rate > 1
|
101
|
+
raise ArgumentError, 'invalid value for "rate", must be smaller than or equal to 1.'
|
102
|
+
end
|
103
|
+
|
104
|
+
if !rate.nil? && rate < 0
|
105
|
+
raise ArgumentError, 'invalid value for "rate", must be greater than or equal to 0.'
|
106
|
+
end
|
107
|
+
|
108
|
+
@rate = rate
|
109
|
+
end
|
110
|
+
|
111
|
+
# Custom attribute writer method with validation
|
112
|
+
# @param [Object] conversion_count Value to be assigned
|
113
|
+
def conversion_count=(conversion_count)
|
114
|
+
if conversion_count.nil?
|
115
|
+
raise ArgumentError, 'conversion_count cannot be nil'
|
116
|
+
end
|
117
|
+
|
118
|
+
if conversion_count < 0
|
119
|
+
raise ArgumentError, 'invalid value for "conversion_count", must be greater than or equal to 0.'
|
120
|
+
end
|
121
|
+
|
122
|
+
@conversion_count = conversion_count
|
123
|
+
end
|
124
|
+
|
125
|
+
# Checks equality by comparing each attribute.
|
126
|
+
# @param [Object] Object to be compared
|
127
|
+
def ==(other)
|
128
|
+
return true if equal?(other)
|
129
|
+
|
130
|
+
self.class == other.class &&
|
131
|
+
rate == other.rate &&
|
132
|
+
tracked_search_count == other.tracked_search_count &&
|
133
|
+
conversion_count == other.conversion_count &&
|
134
|
+
dates == other.dates
|
135
|
+
end
|
136
|
+
|
137
|
+
# @see the `==` method
|
138
|
+
# @param [Object] Object to be compared
|
139
|
+
def eql?(other)
|
140
|
+
self == other
|
141
|
+
end
|
142
|
+
|
143
|
+
# Calculates hash code according to all attributes.
|
144
|
+
# @return [Integer] Hash code
|
145
|
+
def hash
|
146
|
+
[rate, tracked_search_count, conversion_count, dates].hash
|
147
|
+
end
|
148
|
+
|
149
|
+
# Builds the object from hash
|
150
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
151
|
+
# @return [Object] Returns the model itself
|
152
|
+
def self.build_from_hash(attributes)
|
153
|
+
return nil unless attributes.is_a?(Hash)
|
154
|
+
|
155
|
+
attributes = attributes.transform_keys(&:to_sym)
|
156
|
+
transformed_hash = {}
|
157
|
+
types_mapping.each_pair do |key, type|
|
158
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
159
|
+
transformed_hash[key.to_sym] = nil
|
160
|
+
elsif type =~ /\AArray<(.*)>/i
|
161
|
+
# check to ensure the input is an array given that the attribute
|
162
|
+
# is documented as an array but the input is not
|
163
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
164
|
+
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
|
165
|
+
end
|
166
|
+
elsif !attributes[attribute_map[key]].nil?
|
167
|
+
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
168
|
+
end
|
169
|
+
end
|
170
|
+
new(transformed_hash)
|
171
|
+
end
|
172
|
+
|
173
|
+
# Deserializes the data based on type
|
174
|
+
# @param string type Data type
|
175
|
+
# @param string value Value to be deserialized
|
176
|
+
# @return [Object] Deserialized data
|
177
|
+
def self._deserialize(type, value)
|
178
|
+
case type.to_sym
|
179
|
+
when :Time
|
180
|
+
Time.parse(value)
|
181
|
+
when :Date
|
182
|
+
Date.parse(value)
|
183
|
+
when :String
|
184
|
+
value.to_s
|
185
|
+
when :Integer
|
186
|
+
value.to_i
|
187
|
+
when :Float
|
188
|
+
value.to_f
|
189
|
+
when :Boolean
|
190
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
191
|
+
true
|
192
|
+
else
|
193
|
+
false
|
194
|
+
end
|
195
|
+
when :Object
|
196
|
+
# generic object (usually a Hash), return directly
|
197
|
+
value
|
198
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
199
|
+
inner_type = Regexp.last_match[:inner_type]
|
200
|
+
value.map { |v| _deserialize(inner_type, v) }
|
201
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
202
|
+
k_type = Regexp.last_match[:k_type]
|
203
|
+
v_type = Regexp.last_match[:v_type]
|
204
|
+
{}.tap do |hash|
|
205
|
+
value.each do |k, v|
|
206
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
207
|
+
end
|
208
|
+
end
|
209
|
+
else # model
|
210
|
+
# models (e.g. Pet) or oneOf
|
211
|
+
klass = Algolia::Analytics.const_get(type)
|
212
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
# Returns the string representation of the object
|
217
|
+
# @return [String] String presentation of the object
|
218
|
+
def to_s
|
219
|
+
to_hash.to_s
|
220
|
+
end
|
221
|
+
|
222
|
+
# to_body is an alias to to_hash (backward compatibility)
|
223
|
+
# @return [Hash] Returns the object in the form of hash
|
224
|
+
def to_body
|
225
|
+
to_hash
|
226
|
+
end
|
227
|
+
|
228
|
+
def to_json(*_args)
|
229
|
+
to_hash.to_json
|
230
|
+
end
|
231
|
+
|
232
|
+
# Returns the object in the form of hash
|
233
|
+
# @return [Hash] Returns the object in the form of hash
|
234
|
+
def to_hash
|
235
|
+
hash = {}
|
236
|
+
self.class.attribute_map.each_pair do |attr, param|
|
237
|
+
value = send(attr)
|
238
|
+
if value.nil?
|
239
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
240
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
241
|
+
end
|
242
|
+
|
243
|
+
hash[param] = _to_hash(value)
|
244
|
+
end
|
245
|
+
hash
|
246
|
+
end
|
247
|
+
|
248
|
+
# Outputs non-array value in the form of hash
|
249
|
+
# For object, use to_hash. Otherwise, just return the value
|
250
|
+
# @param [Object] value Any valid value
|
251
|
+
# @return [Hash] Returns the value in the form of hash
|
252
|
+
def _to_hash(value)
|
253
|
+
if value.is_a?(Array)
|
254
|
+
value.compact.map { |v| _to_hash(v) }
|
255
|
+
elsif value.is_a?(Hash)
|
256
|
+
{}.tap do |hash|
|
257
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
258
|
+
end
|
259
|
+
elsif value.respond_to? :to_hash
|
260
|
+
value.to_hash
|
261
|
+
else
|
262
|
+
value
|
263
|
+
end
|
264
|
+
end
|
265
|
+
end
|
266
|
+
end
|
267
|
+
end
|
@@ -6,16 +6,16 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module Analytics
|
8
8
|
class GetNoClickRateResponse
|
9
|
-
#
|
9
|
+
# No click rate, calculated as number of tracked searches without any click divided by the number of tracked searches.
|
10
10
|
attr_accessor :rate
|
11
11
|
|
12
|
-
# Number of
|
12
|
+
# Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
|
13
13
|
attr_accessor :count
|
14
14
|
|
15
|
-
# Number of click
|
15
|
+
# Number of times this search was returned as a result without any click.
|
16
16
|
attr_accessor :no_click_count
|
17
17
|
|
18
|
-
#
|
18
|
+
# Daily no click rates.
|
19
19
|
attr_accessor :dates
|
20
20
|
|
21
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -39,7 +39,7 @@ module Algolia
|
|
39
39
|
:rate => :Float,
|
40
40
|
:count => :Integer,
|
41
41
|
:no_click_count => :Integer,
|
42
|
-
:dates => :'Array<
|
42
|
+
:dates => :'Array<DailyNoClickRates>'
|
43
43
|
}
|
44
44
|
end
|
45
45
|
|
@@ -110,6 +110,20 @@ module Algolia
|
|
110
110
|
@rate = rate
|
111
111
|
end
|
112
112
|
|
113
|
+
# Custom attribute writer method with validation
|
114
|
+
# @param [Object] no_click_count Value to be assigned
|
115
|
+
def no_click_count=(no_click_count)
|
116
|
+
if no_click_count.nil?
|
117
|
+
raise ArgumentError, 'no_click_count cannot be nil'
|
118
|
+
end
|
119
|
+
|
120
|
+
if no_click_count < 1
|
121
|
+
raise ArgumentError, 'invalid value for "no_click_count", must be greater than or equal to 1.'
|
122
|
+
end
|
123
|
+
|
124
|
+
@no_click_count = no_click_count
|
125
|
+
end
|
126
|
+
|
113
127
|
# Checks equality by comparing each attribute.
|
114
128
|
# @param [Object] Object to be compared
|
115
129
|
def ==(other)
|
@@ -6,16 +6,16 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module Analytics
|
8
8
|
class GetNoResultsRateResponse
|
9
|
-
#
|
9
|
+
# No results rate, calculated as number of searches with zero results divided by the total number of searches.
|
10
10
|
attr_accessor :rate
|
11
11
|
|
12
|
-
# Number of
|
12
|
+
# Number of searches.
|
13
13
|
attr_accessor :count
|
14
14
|
|
15
|
-
# Number of
|
15
|
+
# Number of searches without any results.
|
16
16
|
attr_accessor :no_result_count
|
17
17
|
|
18
|
-
#
|
18
|
+
# Daily no results rates.
|
19
19
|
attr_accessor :dates
|
20
20
|
|
21
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -39,7 +39,7 @@ module Algolia
|
|
39
39
|
:rate => :Float,
|
40
40
|
:count => :Integer,
|
41
41
|
:no_result_count => :Integer,
|
42
|
-
:dates => :'Array<
|
42
|
+
:dates => :'Array<DailyNoResultsRates>'
|
43
43
|
}
|
44
44
|
end
|
45
45
|
|
@@ -5,17 +5,17 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Analytics
|
8
|
-
class
|
9
|
-
#
|
8
|
+
class GetPurchaseRateResponse
|
9
|
+
# Purchase rate, calculated as number of tracked searches with at least one purchase event divided by the number of tracked searches. If null, Algolia didn't receive any search requests with `clickAnalytics` set to true.
|
10
10
|
attr_accessor :rate
|
11
11
|
|
12
|
-
# Number of tracked searches.
|
12
|
+
# Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
|
13
13
|
attr_accessor :tracked_search_count
|
14
14
|
|
15
|
-
# Number of
|
16
|
-
attr_accessor :
|
15
|
+
# Number of purchase events from this search.
|
16
|
+
attr_accessor :purchase_count
|
17
17
|
|
18
|
-
#
|
18
|
+
# Daily purchase rates.
|
19
19
|
attr_accessor :dates
|
20
20
|
|
21
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -23,7 +23,7 @@ module Algolia
|
|
23
23
|
{
|
24
24
|
:rate => :rate,
|
25
25
|
:tracked_search_count => :trackedSearchCount,
|
26
|
-
:
|
26
|
+
:purchase_count => :purchaseCount,
|
27
27
|
:dates => :dates
|
28
28
|
}
|
29
29
|
end
|
@@ -38,15 +38,15 @@ module Algolia
|
|
38
38
|
{
|
39
39
|
:rate => :Float,
|
40
40
|
:tracked_search_count => :Integer,
|
41
|
-
:
|
42
|
-
:dates => :'Array<
|
41
|
+
:purchase_count => :Integer,
|
42
|
+
:dates => :'Array<DailyPurchaseRates>'
|
43
43
|
}
|
44
44
|
end
|
45
45
|
|
46
46
|
# List of attributes with nullable: true
|
47
47
|
def self.openapi_nullable
|
48
48
|
Set.new([
|
49
|
-
:
|
49
|
+
:rate
|
50
50
|
])
|
51
51
|
end
|
52
52
|
|
@@ -54,14 +54,14 @@ module Algolia
|
|
54
54
|
# @param [Hash] attributes Model attributes in the form of hash
|
55
55
|
def initialize(attributes = {})
|
56
56
|
unless attributes.is_a?(Hash)
|
57
|
-
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::
|
57
|
+
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::GetPurchaseRateResponse` initialize method"
|
58
58
|
end
|
59
59
|
|
60
60
|
# check to see if the attribute exists and convert string to symbol for hash key
|
61
61
|
attributes = attributes.each_with_object({}) do |(k, v), h|
|
62
62
|
unless self.class.attribute_map.key?(k.to_sym)
|
63
63
|
raise ArgumentError,
|
64
|
-
"`#{k}` is not a valid attribute in `Algolia::
|
64
|
+
"`#{k}` is not a valid attribute in `Algolia::GetPurchaseRateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
65
65
|
end
|
66
66
|
|
67
67
|
h[k.to_sym] = v
|
@@ -79,10 +79,10 @@ module Algolia
|
|
79
79
|
self.tracked_search_count = nil
|
80
80
|
end
|
81
81
|
|
82
|
-
if attributes.key?(:
|
83
|
-
self.
|
82
|
+
if attributes.key?(:purchase_count)
|
83
|
+
self.purchase_count = attributes[:purchase_count]
|
84
84
|
else
|
85
|
-
self.
|
85
|
+
self.purchase_count = nil
|
86
86
|
end
|
87
87
|
|
88
88
|
if attributes.key?(:dates)
|
@@ -97,15 +97,11 @@ module Algolia
|
|
97
97
|
# Custom attribute writer method with validation
|
98
98
|
# @param [Object] rate Value to be assigned
|
99
99
|
def rate=(rate)
|
100
|
-
if rate.nil?
|
101
|
-
raise ArgumentError, 'rate cannot be nil'
|
102
|
-
end
|
103
|
-
|
104
|
-
if rate > 1
|
100
|
+
if !rate.nil? && rate > 1
|
105
101
|
raise ArgumentError, 'invalid value for "rate", must be smaller than or equal to 1.'
|
106
102
|
end
|
107
103
|
|
108
|
-
if rate < 0
|
104
|
+
if !rate.nil? && rate < 0
|
109
105
|
raise ArgumentError, 'invalid value for "rate", must be greater than or equal to 0.'
|
110
106
|
end
|
111
107
|
|
@@ -120,7 +116,7 @@ module Algolia
|
|
120
116
|
self.class == other.class &&
|
121
117
|
rate == other.rate &&
|
122
118
|
tracked_search_count == other.tracked_search_count &&
|
123
|
-
|
119
|
+
purchase_count == other.purchase_count &&
|
124
120
|
dates == other.dates
|
125
121
|
end
|
126
122
|
|
@@ -133,7 +129,7 @@ module Algolia
|
|
133
129
|
# Calculates hash code according to all attributes.
|
134
130
|
# @return [Integer] Hash code
|
135
131
|
def hash
|
136
|
-
[rate, tracked_search_count,
|
132
|
+
[rate, tracked_search_count, purchase_count, dates].hash
|
137
133
|
end
|
138
134
|
|
139
135
|
# Builds the object from hash
|