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
@@ -5,18 +5,18 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Algolia
|
7
7
|
module Analytics
|
8
|
-
class
|
9
|
-
#
|
10
|
-
attr_accessor :
|
8
|
+
class GetRevenue
|
9
|
+
# Revenue associated with this search, broken-down by currencies.
|
10
|
+
attr_accessor :currencies
|
11
11
|
|
12
|
-
#
|
13
|
-
attr_accessor :
|
12
|
+
# Daily revenue.
|
13
|
+
attr_accessor :dates
|
14
14
|
|
15
15
|
# Attribute mapping from ruby-style variable name to JSON key.
|
16
16
|
def self.attribute_map
|
17
17
|
{
|
18
|
-
:
|
19
|
-
:
|
18
|
+
:currencies => :currencies,
|
19
|
+
:dates => :dates
|
20
20
|
}
|
21
21
|
end
|
22
22
|
|
@@ -28,8 +28,8 @@ module Algolia
|
|
28
28
|
# Attribute type mapping.
|
29
29
|
def self.types_mapping
|
30
30
|
{
|
31
|
-
:
|
32
|
-
:
|
31
|
+
:currencies => :'Hash<String, CurrenciesValue>',
|
32
|
+
:dates => :'Array<DailyRevenue>'
|
33
33
|
}
|
34
34
|
end
|
35
35
|
|
@@ -42,31 +42,33 @@ module Algolia
|
|
42
42
|
# @param [Hash] attributes Model attributes in the form of hash
|
43
43
|
def initialize(attributes = {})
|
44
44
|
unless attributes.is_a?(Hash)
|
45
|
-
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::
|
45
|
+
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::GetRevenue` initialize method"
|
46
46
|
end
|
47
47
|
|
48
48
|
# check to see if the attribute exists and convert string to symbol for hash key
|
49
49
|
attributes = attributes.each_with_object({}) do |(k, v), h|
|
50
50
|
unless self.class.attribute_map.key?(k.to_sym)
|
51
51
|
raise ArgumentError,
|
52
|
-
"`#{k}` is not a valid attribute in `Algolia::
|
52
|
+
"`#{k}` is not a valid attribute in `Algolia::GetRevenue`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
53
53
|
end
|
54
54
|
|
55
55
|
h[k.to_sym] = v
|
56
56
|
end
|
57
57
|
|
58
|
-
if attributes.key?(:
|
59
|
-
if (value = attributes[:
|
60
|
-
self.
|
58
|
+
if attributes.key?(:currencies)
|
59
|
+
if (value = attributes[:currencies]).is_a?(Hash)
|
60
|
+
self.currencies = value
|
61
61
|
end
|
62
62
|
else
|
63
|
-
self.
|
63
|
+
self.currencies = nil
|
64
64
|
end
|
65
65
|
|
66
|
-
if attributes.key?(:
|
67
|
-
|
66
|
+
if attributes.key?(:dates)
|
67
|
+
if (value = attributes[:dates]).is_a?(Array)
|
68
|
+
self.dates = value
|
69
|
+
end
|
68
70
|
else
|
69
|
-
self.
|
71
|
+
self.dates = nil
|
70
72
|
end
|
71
73
|
end
|
72
74
|
|
@@ -76,8 +78,8 @@ module Algolia
|
|
76
78
|
return true if equal?(other)
|
77
79
|
|
78
80
|
self.class == other.class &&
|
79
|
-
|
80
|
-
|
81
|
+
currencies == other.currencies &&
|
82
|
+
dates == other.dates
|
81
83
|
end
|
82
84
|
|
83
85
|
# @see the `==` method
|
@@ -89,7 +91,7 @@ module Algolia
|
|
89
91
|
# Calculates hash code according to all attributes.
|
90
92
|
# @return [Integer] Hash code
|
91
93
|
def hash
|
92
|
-
[
|
94
|
+
[currencies, dates].hash
|
93
95
|
end
|
94
96
|
|
95
97
|
# Builds the object from hash
|
@@ -9,7 +9,7 @@ module Algolia
|
|
9
9
|
# Number of occurrences.
|
10
10
|
attr_accessor :count
|
11
11
|
|
12
|
-
#
|
12
|
+
# Daily number of searches.
|
13
13
|
attr_accessor :dates
|
14
14
|
|
15
15
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -29,7 +29,7 @@ module Algolia
|
|
29
29
|
def self.types_mapping
|
30
30
|
{
|
31
31
|
:count => :Integer,
|
32
|
-
:dates => :'Array<
|
32
|
+
:dates => :'Array<DailySearches>'
|
33
33
|
}
|
34
34
|
end
|
35
35
|
|
@@ -6,7 +6,7 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module Analytics
|
8
8
|
class GetSearchesNoClicksResponse
|
9
|
-
# Searches
|
9
|
+
# Searches without any clicks.
|
10
10
|
attr_accessor :searches
|
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
|
-
:searches => :'Array<
|
27
|
+
:searches => :'Array<DailySearchesNoClicks>'
|
28
28
|
}
|
29
29
|
end
|
30
30
|
|
@@ -6,7 +6,7 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module Analytics
|
8
8
|
class GetSearchesNoResultsResponse
|
9
|
-
# Searches
|
9
|
+
# Searches without results.
|
10
10
|
attr_accessor :searches
|
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
|
-
:searches => :'Array<
|
27
|
+
:searches => :'Array<DailySearchesNoResults>'
|
28
28
|
}
|
29
29
|
end
|
30
30
|
|
@@ -6,7 +6,7 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module Analytics
|
8
8
|
class GetStatusResponse
|
9
|
-
# Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format.
|
9
|
+
# Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. If null, no update was performed yet.
|
10
10
|
attr_accessor :updated_at
|
11
11
|
|
12
12
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -30,7 +30,9 @@ module Algolia
|
|
30
30
|
|
31
31
|
# List of attributes with nullable: true
|
32
32
|
def self.openapi_nullable
|
33
|
-
Set.new([
|
33
|
+
Set.new([
|
34
|
+
:updated_at
|
35
|
+
])
|
34
36
|
end
|
35
37
|
|
36
38
|
# Initializes the object
|
@@ -9,7 +9,6 @@ module Algolia
|
|
9
9
|
# Attribute name.
|
10
10
|
attr_accessor :attribute
|
11
11
|
|
12
|
-
# Operator.
|
13
12
|
attr_accessor :operator
|
14
13
|
|
15
14
|
# Attribute value.
|
@@ -18,6 +17,28 @@ module Algolia
|
|
18
17
|
# Number of occurrences.
|
19
18
|
attr_accessor :count
|
20
19
|
|
20
|
+
class EnumAttributeValidator
|
21
|
+
attr_reader :datatype
|
22
|
+
attr_reader :allowable_values
|
23
|
+
|
24
|
+
def initialize(datatype, allowable_values)
|
25
|
+
@allowable_values = allowable_values.map do |value|
|
26
|
+
case datatype.to_s
|
27
|
+
when /Integer/i
|
28
|
+
value.to_i
|
29
|
+
when /Float/i
|
30
|
+
value.to_f
|
31
|
+
else
|
32
|
+
value
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def valid?(value)
|
38
|
+
!value || allowable_values.include?(value)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
21
42
|
# Attribute mapping from ruby-style variable name to JSON key.
|
22
43
|
def self.attribute_map
|
23
44
|
{
|
@@ -37,7 +58,7 @@ module Algolia
|
|
37
58
|
def self.types_mapping
|
38
59
|
{
|
39
60
|
:attribute => :String,
|
40
|
-
:operator => :
|
61
|
+
:operator => :Operator,
|
41
62
|
:value => :String,
|
42
63
|
:count => :Integer
|
43
64
|
}
|
@@ -6,7 +6,7 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module Analytics
|
8
8
|
class GetTopFiltersNoResultsResponse
|
9
|
-
# Filters with
|
9
|
+
# Filters for searches without any results. If null, the search term specified with the `search` parameter is not a search without results, or the `search` parameter is absent from the request.
|
10
10
|
attr_accessor :values
|
11
11
|
|
12
12
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -30,7 +30,9 @@ module Algolia
|
|
30
30
|
|
31
31
|
# List of attributes with nullable: true
|
32
32
|
def self.openapi_nullable
|
33
|
-
Set.new([
|
33
|
+
Set.new([
|
34
|
+
:values
|
35
|
+
])
|
34
36
|
end
|
35
37
|
|
36
38
|
# Initializes the object
|
@@ -9,12 +9,33 @@ module Algolia
|
|
9
9
|
# Attribute name.
|
10
10
|
attr_accessor :attribute
|
11
11
|
|
12
|
-
# Operator.
|
13
12
|
attr_accessor :operator
|
14
13
|
|
15
14
|
# Attribute value.
|
16
15
|
attr_accessor :value
|
17
16
|
|
17
|
+
class EnumAttributeValidator
|
18
|
+
attr_reader :datatype
|
19
|
+
attr_reader :allowable_values
|
20
|
+
|
21
|
+
def initialize(datatype, allowable_values)
|
22
|
+
@allowable_values = allowable_values.map do |value|
|
23
|
+
case datatype.to_s
|
24
|
+
when /Integer/i
|
25
|
+
value.to_i
|
26
|
+
when /Float/i
|
27
|
+
value.to_f
|
28
|
+
else
|
29
|
+
value
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def valid?(value)
|
35
|
+
!value || allowable_values.include?(value)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
18
39
|
# Attribute mapping from ruby-style variable name to JSON key.
|
19
40
|
def self.attribute_map
|
20
41
|
{
|
@@ -33,7 +54,7 @@ module Algolia
|
|
33
54
|
def self.types_mapping
|
34
55
|
{
|
35
56
|
:attribute => :String,
|
36
|
-
:operator => :
|
57
|
+
:operator => :Operator,
|
37
58
|
:value => :String
|
38
59
|
}
|
39
60
|
end
|
@@ -6,10 +6,10 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module Analytics
|
8
8
|
class GetUsersCountResponse
|
9
|
-
# Number of
|
9
|
+
# Number of unique users.
|
10
10
|
attr_accessor :count
|
11
11
|
|
12
|
-
#
|
12
|
+
# Daily number of unique users.
|
13
13
|
attr_accessor :dates
|
14
14
|
|
15
15
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -29,7 +29,7 @@ module Algolia
|
|
29
29
|
def self.types_mapping
|
30
30
|
{
|
31
31
|
:count => :Integer,
|
32
|
-
:dates => :'Array<
|
32
|
+
:dates => :'Array<DailyUsers>'
|
33
33
|
}
|
34
34
|
end
|
35
35
|
|
@@ -0,0 +1,38 @@
|
|
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 Operator
|
9
|
+
APPLY = ":".freeze
|
10
|
+
LESS_THAN = "<".freeze
|
11
|
+
LESS_EQUALS = "<=".freeze
|
12
|
+
EQUALS = "=".freeze
|
13
|
+
NOT_EQUALS = "!=".freeze
|
14
|
+
GREATER_THAN = ">".freeze
|
15
|
+
GREATER_EQUALS = ">=".freeze
|
16
|
+
|
17
|
+
def self.all_vars
|
18
|
+
@all_vars ||= [APPLY, LESS_THAN, LESS_EQUALS, EQUALS, NOT_EQUALS, GREATER_THAN, GREATER_EQUALS].freeze
|
19
|
+
end
|
20
|
+
|
21
|
+
# Builds the enum from string
|
22
|
+
# @param [String] The enum value in the form of the string
|
23
|
+
# @return [String] The enum value
|
24
|
+
def self.build_from_hash(value)
|
25
|
+
new.build_from_hash(value)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Builds the enum from string
|
29
|
+
# @param [String] The enum value in the form of the string
|
30
|
+
# @return [String] The enum value
|
31
|
+
def build_from_hash(value)
|
32
|
+
return value if Operator.all_vars.include?(value)
|
33
|
+
|
34
|
+
raise "Invalid ENUM value #{value} for class #Operator"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -6,25 +6,25 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module Analytics
|
8
8
|
class TopHitWithAnalytics
|
9
|
-
#
|
9
|
+
# Object ID of a record that's returned as a search result.
|
10
10
|
attr_accessor :hit
|
11
11
|
|
12
12
|
# Number of occurrences.
|
13
13
|
attr_accessor :count
|
14
14
|
|
15
|
-
#
|
15
|
+
# 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.
|
16
16
|
attr_accessor :click_through_rate
|
17
17
|
|
18
|
-
#
|
18
|
+
# 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.
|
19
19
|
attr_accessor :conversion_rate
|
20
20
|
|
21
|
-
# Number of tracked searches.
|
22
|
-
attr_accessor :
|
21
|
+
# Number of tracked searches. Tracked searches are search requests where the `clickAnalytics` parameter is true.
|
22
|
+
attr_accessor :tracked_hit_count
|
23
23
|
|
24
|
-
# Number of
|
24
|
+
# Number of clicks associated with this search.
|
25
25
|
attr_accessor :click_count
|
26
26
|
|
27
|
-
# Number of
|
27
|
+
# Number of conversions from this search.
|
28
28
|
attr_accessor :conversion_count
|
29
29
|
|
30
30
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -34,7 +34,7 @@ module Algolia
|
|
34
34
|
:count => :count,
|
35
35
|
:click_through_rate => :clickThroughRate,
|
36
36
|
:conversion_rate => :conversionRate,
|
37
|
-
:
|
37
|
+
:tracked_hit_count => :trackedHitCount,
|
38
38
|
:click_count => :clickCount,
|
39
39
|
:conversion_count => :conversionCount
|
40
40
|
}
|
@@ -52,7 +52,7 @@ module Algolia
|
|
52
52
|
:count => :Integer,
|
53
53
|
:click_through_rate => :Float,
|
54
54
|
:conversion_rate => :Float,
|
55
|
-
:
|
55
|
+
:tracked_hit_count => :Integer,
|
56
56
|
:click_count => :Integer,
|
57
57
|
:conversion_count => :Integer
|
58
58
|
}
|
@@ -61,7 +61,8 @@ module Algolia
|
|
61
61
|
# List of attributes with nullable: true
|
62
62
|
def self.openapi_nullable
|
63
63
|
Set.new([
|
64
|
-
:
|
64
|
+
:click_through_rate,
|
65
|
+
:conversion_rate
|
65
66
|
])
|
66
67
|
end
|
67
68
|
|
@@ -106,10 +107,10 @@ module Algolia
|
|
106
107
|
self.conversion_rate = nil
|
107
108
|
end
|
108
109
|
|
109
|
-
if attributes.key?(:
|
110
|
-
self.
|
110
|
+
if attributes.key?(:tracked_hit_count)
|
111
|
+
self.tracked_hit_count = attributes[:tracked_hit_count]
|
111
112
|
else
|
112
|
-
self.
|
113
|
+
self.tracked_hit_count = nil
|
113
114
|
end
|
114
115
|
|
115
116
|
if attributes.key?(:click_count)
|
@@ -128,21 +129,59 @@ module Algolia
|
|
128
129
|
# Custom attribute writer method with validation
|
129
130
|
# @param [Object] click_through_rate Value to be assigned
|
130
131
|
def click_through_rate=(click_through_rate)
|
131
|
-
if click_through_rate.nil?
|
132
|
-
raise ArgumentError, 'click_through_rate cannot be nil'
|
133
|
-
end
|
134
|
-
|
135
|
-
if click_through_rate > 1
|
132
|
+
if !click_through_rate.nil? && click_through_rate > 1
|
136
133
|
raise ArgumentError, 'invalid value for "click_through_rate", must be smaller than or equal to 1.'
|
137
134
|
end
|
138
135
|
|
139
|
-
if click_through_rate < 0
|
136
|
+
if !click_through_rate.nil? && click_through_rate < 0
|
140
137
|
raise ArgumentError, 'invalid value for "click_through_rate", must be greater than or equal to 0.'
|
141
138
|
end
|
142
139
|
|
143
140
|
@click_through_rate = click_through_rate
|
144
141
|
end
|
145
142
|
|
143
|
+
# Custom attribute writer method with validation
|
144
|
+
# @param [Object] conversion_rate Value to be assigned
|
145
|
+
def conversion_rate=(conversion_rate)
|
146
|
+
if !conversion_rate.nil? && conversion_rate > 1
|
147
|
+
raise ArgumentError, 'invalid value for "conversion_rate", must be smaller than or equal to 1.'
|
148
|
+
end
|
149
|
+
|
150
|
+
if !conversion_rate.nil? && conversion_rate < 0
|
151
|
+
raise ArgumentError, 'invalid value for "conversion_rate", must be greater than or equal to 0.'
|
152
|
+
end
|
153
|
+
|
154
|
+
@conversion_rate = conversion_rate
|
155
|
+
end
|
156
|
+
|
157
|
+
# Custom attribute writer method with validation
|
158
|
+
# @param [Object] click_count Value to be assigned
|
159
|
+
def click_count=(click_count)
|
160
|
+
if click_count.nil?
|
161
|
+
raise ArgumentError, 'click_count cannot be nil'
|
162
|
+
end
|
163
|
+
|
164
|
+
if click_count < 0
|
165
|
+
raise ArgumentError, 'invalid value for "click_count", must be greater than or equal to 0.'
|
166
|
+
end
|
167
|
+
|
168
|
+
@click_count = click_count
|
169
|
+
end
|
170
|
+
|
171
|
+
# Custom attribute writer method with validation
|
172
|
+
# @param [Object] conversion_count Value to be assigned
|
173
|
+
def conversion_count=(conversion_count)
|
174
|
+
if conversion_count.nil?
|
175
|
+
raise ArgumentError, 'conversion_count cannot be nil'
|
176
|
+
end
|
177
|
+
|
178
|
+
if conversion_count < 0
|
179
|
+
raise ArgumentError, 'invalid value for "conversion_count", must be greater than or equal to 0.'
|
180
|
+
end
|
181
|
+
|
182
|
+
@conversion_count = conversion_count
|
183
|
+
end
|
184
|
+
|
146
185
|
# Checks equality by comparing each attribute.
|
147
186
|
# @param [Object] Object to be compared
|
148
187
|
def ==(other)
|
@@ -153,7 +192,7 @@ module Algolia
|
|
153
192
|
count == other.count &&
|
154
193
|
click_through_rate == other.click_through_rate &&
|
155
194
|
conversion_rate == other.conversion_rate &&
|
156
|
-
|
195
|
+
tracked_hit_count == other.tracked_hit_count &&
|
157
196
|
click_count == other.click_count &&
|
158
197
|
conversion_count == other.conversion_count
|
159
198
|
end
|
@@ -167,7 +206,7 @@ module Algolia
|
|
167
206
|
# Calculates hash code according to all attributes.
|
168
207
|
# @return [Integer] Hash code
|
169
208
|
def hash
|
170
|
-
[hit, count, click_through_rate, conversion_rate,
|
209
|
+
[hit, count, click_through_rate, conversion_rate, tracked_hit_count, click_count, conversion_count].hash
|
171
210
|
end
|
172
211
|
|
173
212
|
# Builds the object from hash
|