algolia 3.0.0.alpha.17 → 3.0.0.alpha.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +4 -4
- data/lib/algolia/api/abtesting_client.rb +20 -20
- data/lib/algolia/api/personalization_client.rb +12 -12
- data/lib/algolia/models/abtesting/ab_test.rb +41 -16
- data/lib/algolia/models/abtesting/ab_test_configuration.rb +217 -0
- data/lib/algolia/models/abtesting/ab_test_response.rb +2 -2
- data/lib/algolia/models/abtesting/ab_tests_variant.rb +21 -3
- data/lib/algolia/models/abtesting/ab_tests_variant_search_params.rb +21 -3
- data/lib/algolia/models/abtesting/add_ab_tests_request.rb +1 -1
- data/lib/algolia/models/abtesting/custom_search_params.rb +1 -1
- data/lib/algolia/models/abtesting/effect.rb +35 -0
- data/lib/algolia/models/abtesting/empty_search.rb +198 -0
- data/lib/algolia/models/abtesting/list_ab_tests_response.rb +1 -1
- data/lib/algolia/models/abtesting/minimum_detectable_effect.rb +247 -0
- data/lib/algolia/models/abtesting/outliers.rb +198 -0
- data/lib/algolia/models/abtesting/status.rb +35 -0
- data/lib/algolia/models/abtesting/variant.rb +31 -13
- data/lib/algolia/models/ingestion/destination_index_name.rb +1 -1
- data/lib/algolia/models/ingestion/shopify_input.rb +212 -0
- data/lib/algolia/models/ingestion/shopify_market.rb +227 -0
- data/lib/algolia/models/ingestion/shopify_metafield.rb +221 -0
- data/lib/algolia/models/ingestion/source_input.rb +2 -1
- data/lib/algolia/models/ingestion/source_shopify.rb +278 -0
- data/lib/algolia/models/ingestion/source_shopify_base.rb +199 -0
- data/lib/algolia/models/ingestion/source_update_input.rb +2 -1
- data/lib/algolia/models/ingestion/source_update_shopify.rb +258 -0
- data/lib/algolia/models/ingestion/task_input.rb +1 -0
- data/lib/algolia/models/insights/added_to_cart_object_ids.rb +1 -1
- data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/clicked_filters.rb +1 -1
- data/lib/algolia/models/insights/clicked_object_ids.rb +1 -1
- data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/converted_filters.rb +1 -1
- data/lib/algolia/models/insights/converted_object_ids.rb +1 -1
- data/lib/algolia/models/insights/converted_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/purchased_object_ids.rb +1 -1
- data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +1 -1
- data/lib/algolia/models/insights/viewed_filters.rb +1 -1
- data/lib/algolia/models/insights/viewed_object_ids.rb +1 -1
- data/lib/algolia/models/personalization/delete_user_profile_response.rb +2 -2
- data/lib/algolia/models/personalization/event_scoring.rb +25 -4
- data/lib/algolia/models/personalization/event_type.rb +34 -0
- data/lib/algolia/models/personalization/facet_scoring.rb +2 -2
- data/lib/algolia/models/personalization/get_user_token_response.rb +3 -3
- data/lib/algolia/models/personalization/personalization_strategy_params.rb +21 -3
- data/lib/algolia/models/query-suggestions/get_config_status200_response.rb +1 -1
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb +1 -1
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb +1 -1
- data/lib/algolia/models/query-suggestions/source_index.rb +1 -1
- data/lib/algolia/models/recommend/base_recommend_request.rb +1 -1
- data/lib/algolia/models/recommend/base_search_params.rb +3 -3
- data/lib/algolia/models/recommend/base_search_params_without_query.rb +3 -3
- data/lib/algolia/models/recommend/bought_together_query.rb +1 -1
- data/lib/algolia/models/recommend/fallback_params.rb +9 -9
- data/lib/algolia/models/recommend/index_settings_as_search_params.rb +6 -6
- data/lib/algolia/models/recommend/looking_similar_query.rb +1 -1
- data/lib/algolia/models/recommend/re_ranking_apply_filter.rb +1 -1
- data/lib/algolia/models/recommend/recommended_for_you_query.rb +1 -1
- data/lib/algolia/models/recommend/related_query.rb +1 -1
- data/lib/algolia/models/recommend/search_params.rb +9 -9
- data/lib/algolia/models/recommend/search_params_object.rb +10 -9
- data/lib/algolia/models/recommend/trending_facets_query.rb +1 -1
- data/lib/algolia/models/recommend/trending_items_query.rb +1 -1
- data/lib/algolia/models/search/base_index_settings.rb +9 -9
- data/lib/algolia/models/search/base_search_params.rb +3 -3
- data/lib/algolia/models/search/base_search_params_without_query.rb +3 -3
- data/lib/algolia/models/search/browse_params_object.rb +9 -9
- data/lib/algolia/models/search/consequence_params.rb +9 -9
- data/lib/algolia/models/search/delete_by_params.rb +1 -1
- data/lib/algolia/models/search/index_settings.rb +15 -15
- data/lib/algolia/models/search/index_settings_as_search_params.rb +6 -6
- data/lib/algolia/models/search/multiple_batch_request.rb +1 -1
- data/lib/algolia/models/search/operation_index_params.rb +1 -1
- data/lib/algolia/models/search/re_ranking_apply_filter.rb +1 -1
- data/lib/algolia/models/search/search_for_facets.rb +10 -10
- data/lib/algolia/models/search/search_for_facets_options.rb +1 -1
- data/lib/algolia/models/search/search_for_hits.rb +10 -10
- data/lib/algolia/models/search/search_for_hits_options.rb +1 -1
- data/lib/algolia/models/search/search_params_object.rb +10 -9
- data/lib/algolia/version.rb +1 -1
- metadata +15 -2
@@ -0,0 +1,258 @@
|
|
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
|
+
class SourceUpdateShopify
|
9
|
+
# Whether to index collection IDs. If your store has `has_collection_search_page` set to true, collection IDs will be indexed even if `collectionIDIndexing` is false.
|
10
|
+
attr_accessor :collection_id_indexing
|
11
|
+
|
12
|
+
# Whether to increase the number of indexed collections per product. If true, Algolia indexes 200 collections per product. If false, 100 collections per product are indexed.
|
13
|
+
attr_accessor :increase_product_collection_limit
|
14
|
+
|
15
|
+
# Whether to set the default price ratio to 1 if no sale price is present. The price ratio is determined by the ratio: `sale_price` / `regular_price`. If no sale price is present, the price ratio would be 0. If `defaultPriceRatioAsOne` is true, the price ratio is indexed as 1 instead.
|
16
|
+
attr_accessor :default_price_ratio_as_one
|
17
|
+
|
18
|
+
# Whether to exclude out-of-stock variants when determining the `max_variant_price` and `min_variant_price` attributes.
|
19
|
+
attr_accessor :exclude_oos_variants_for_price_at_trs
|
20
|
+
|
21
|
+
# Whether to include an inventory with every variant for every product record.
|
22
|
+
attr_accessor :include_variants_inventory
|
23
|
+
|
24
|
+
# Whether to include collection IDs and handles in the product records.
|
25
|
+
attr_accessor :has_collection_search_page
|
26
|
+
|
27
|
+
# Whether to convert tags on products to named tags. To learn more, see [Named tags](https://www.algolia.com/doc/integration/shopify/sending-and-managing-data/named-tags).
|
28
|
+
attr_accessor :product_named_tags
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
def self.attribute_map
|
32
|
+
{
|
33
|
+
:collection_id_indexing => :collectionIDIndexing,
|
34
|
+
:increase_product_collection_limit => :increaseProductCollectionLimit,
|
35
|
+
:default_price_ratio_as_one => :defaultPriceRatioAsOne,
|
36
|
+
:exclude_oos_variants_for_price_at_trs => :excludeOOSVariantsForPriceAtTRS,
|
37
|
+
:include_variants_inventory => :includeVariantsInventory,
|
38
|
+
:has_collection_search_page => :hasCollectionSearchPage,
|
39
|
+
:product_named_tags => :productNamedTags
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# Returns all the JSON keys this model knows about
|
44
|
+
def self.acceptable_attributes
|
45
|
+
attribute_map.values
|
46
|
+
end
|
47
|
+
|
48
|
+
# Attribute type mapping.
|
49
|
+
def self.types_mapping
|
50
|
+
{
|
51
|
+
:collection_id_indexing => :Boolean,
|
52
|
+
:increase_product_collection_limit => :Boolean,
|
53
|
+
:default_price_ratio_as_one => :Boolean,
|
54
|
+
:exclude_oos_variants_for_price_at_trs => :Boolean,
|
55
|
+
:include_variants_inventory => :Boolean,
|
56
|
+
:has_collection_search_page => :Boolean,
|
57
|
+
:product_named_tags => :Boolean
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
# List of attributes with nullable: true
|
62
|
+
def self.openapi_nullable
|
63
|
+
Set.new([])
|
64
|
+
end
|
65
|
+
|
66
|
+
# Initializes the object
|
67
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
68
|
+
def initialize(attributes = {})
|
69
|
+
unless attributes.is_a?(Hash)
|
70
|
+
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::SourceUpdateShopify` initialize method"
|
71
|
+
end
|
72
|
+
|
73
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
74
|
+
attributes = attributes.each_with_object({}) do |(k, v), h|
|
75
|
+
unless self.class.attribute_map.key?(k.to_sym)
|
76
|
+
raise ArgumentError,
|
77
|
+
"`#{k}` is not a valid attribute in `Algolia::SourceUpdateShopify`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
78
|
+
end
|
79
|
+
|
80
|
+
h[k.to_sym] = v
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.key?(:collection_id_indexing)
|
84
|
+
self.collection_id_indexing = attributes[:collection_id_indexing]
|
85
|
+
end
|
86
|
+
|
87
|
+
if attributes.key?(:increase_product_collection_limit)
|
88
|
+
self.increase_product_collection_limit = attributes[:increase_product_collection_limit]
|
89
|
+
end
|
90
|
+
|
91
|
+
if attributes.key?(:default_price_ratio_as_one)
|
92
|
+
self.default_price_ratio_as_one = attributes[:default_price_ratio_as_one]
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.key?(:exclude_oos_variants_for_price_at_trs)
|
96
|
+
self.exclude_oos_variants_for_price_at_trs = attributes[:exclude_oos_variants_for_price_at_trs]
|
97
|
+
end
|
98
|
+
|
99
|
+
if attributes.key?(:include_variants_inventory)
|
100
|
+
self.include_variants_inventory = attributes[:include_variants_inventory]
|
101
|
+
end
|
102
|
+
|
103
|
+
if attributes.key?(:has_collection_search_page)
|
104
|
+
self.has_collection_search_page = attributes[:has_collection_search_page]
|
105
|
+
end
|
106
|
+
|
107
|
+
if attributes.key?(:product_named_tags)
|
108
|
+
self.product_named_tags = attributes[:product_named_tags]
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
# Checks equality by comparing each attribute.
|
113
|
+
# @param [Object] Object to be compared
|
114
|
+
def ==(other)
|
115
|
+
return true if equal?(other)
|
116
|
+
|
117
|
+
self.class == other.class &&
|
118
|
+
collection_id_indexing == other.collection_id_indexing &&
|
119
|
+
increase_product_collection_limit == other.increase_product_collection_limit &&
|
120
|
+
default_price_ratio_as_one == other.default_price_ratio_as_one &&
|
121
|
+
exclude_oos_variants_for_price_at_trs == other.exclude_oos_variants_for_price_at_trs &&
|
122
|
+
include_variants_inventory == other.include_variants_inventory &&
|
123
|
+
has_collection_search_page == other.has_collection_search_page &&
|
124
|
+
product_named_tags == other.product_named_tags
|
125
|
+
end
|
126
|
+
|
127
|
+
# @see the `==` method
|
128
|
+
# @param [Object] Object to be compared
|
129
|
+
def eql?(other)
|
130
|
+
self == other
|
131
|
+
end
|
132
|
+
|
133
|
+
# Calculates hash code according to all attributes.
|
134
|
+
# @return [Integer] Hash code
|
135
|
+
def hash
|
136
|
+
[collection_id_indexing, increase_product_collection_limit, default_price_ratio_as_one, exclude_oos_variants_for_price_at_trs, include_variants_inventory,
|
137
|
+
has_collection_search_page, product_named_tags].hash
|
138
|
+
end
|
139
|
+
|
140
|
+
# Builds the object from hash
|
141
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
142
|
+
# @return [Object] Returns the model itself
|
143
|
+
def self.build_from_hash(attributes)
|
144
|
+
return nil unless attributes.is_a?(Hash)
|
145
|
+
|
146
|
+
attributes = attributes.transform_keys(&:to_sym)
|
147
|
+
transformed_hash = {}
|
148
|
+
types_mapping.each_pair do |key, type|
|
149
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
150
|
+
transformed_hash[key.to_sym] = nil
|
151
|
+
elsif type =~ /\AArray<(.*)>/i
|
152
|
+
# check to ensure the input is an array given that the attribute
|
153
|
+
# is documented as an array but the input is not
|
154
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
155
|
+
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
|
156
|
+
end
|
157
|
+
elsif !attributes[attribute_map[key]].nil?
|
158
|
+
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
159
|
+
end
|
160
|
+
end
|
161
|
+
new(transformed_hash)
|
162
|
+
end
|
163
|
+
|
164
|
+
# Deserializes the data based on type
|
165
|
+
# @param string type Data type
|
166
|
+
# @param string value Value to be deserialized
|
167
|
+
# @return [Object] Deserialized data
|
168
|
+
def self._deserialize(type, value)
|
169
|
+
case type.to_sym
|
170
|
+
when :Time
|
171
|
+
Time.parse(value)
|
172
|
+
when :Date
|
173
|
+
Date.parse(value)
|
174
|
+
when :String
|
175
|
+
value.to_s
|
176
|
+
when :Integer
|
177
|
+
value.to_i
|
178
|
+
when :Float
|
179
|
+
value.to_f
|
180
|
+
when :Boolean
|
181
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
182
|
+
true
|
183
|
+
else
|
184
|
+
false
|
185
|
+
end
|
186
|
+
when :Object
|
187
|
+
# generic object (usually a Hash), return directly
|
188
|
+
value
|
189
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
190
|
+
inner_type = Regexp.last_match[:inner_type]
|
191
|
+
value.map { |v| _deserialize(inner_type, v) }
|
192
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
193
|
+
k_type = Regexp.last_match[:k_type]
|
194
|
+
v_type = Regexp.last_match[:v_type]
|
195
|
+
{}.tap do |hash|
|
196
|
+
value.each do |k, v|
|
197
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
198
|
+
end
|
199
|
+
end
|
200
|
+
else # model
|
201
|
+
# models (e.g. Pet) or oneOf
|
202
|
+
klass = Algolia::Ingestion.const_get(type)
|
203
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
# Returns the string representation of the object
|
208
|
+
# @return [String] String presentation of the object
|
209
|
+
def to_s
|
210
|
+
to_hash.to_s
|
211
|
+
end
|
212
|
+
|
213
|
+
# to_body is an alias to to_hash (backward compatibility)
|
214
|
+
# @return [Hash] Returns the object in the form of hash
|
215
|
+
def to_body
|
216
|
+
to_hash
|
217
|
+
end
|
218
|
+
|
219
|
+
def to_json(*_args)
|
220
|
+
to_hash.to_json
|
221
|
+
end
|
222
|
+
|
223
|
+
# Returns the object in the form of hash
|
224
|
+
# @return [Hash] Returns the object in the form of hash
|
225
|
+
def to_hash
|
226
|
+
hash = {}
|
227
|
+
self.class.attribute_map.each_pair do |attr, param|
|
228
|
+
value = send(attr)
|
229
|
+
if value.nil?
|
230
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
231
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
232
|
+
end
|
233
|
+
|
234
|
+
hash[param] = _to_hash(value)
|
235
|
+
end
|
236
|
+
hash
|
237
|
+
end
|
238
|
+
|
239
|
+
# Outputs non-array value in the form of hash
|
240
|
+
# For object, use to_hash. Otherwise, just return the value
|
241
|
+
# @param [Object] value Any valid value
|
242
|
+
# @return [Hash] Returns the value in the form of hash
|
243
|
+
def _to_hash(value)
|
244
|
+
if value.is_a?(Array)
|
245
|
+
value.compact.map { |v| _to_hash(v) }
|
246
|
+
elsif value.is_a?(Hash)
|
247
|
+
{}.tap do |hash|
|
248
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
249
|
+
end
|
250
|
+
elsif value.respond_to? :to_hash
|
251
|
+
value.to_hash
|
252
|
+
else
|
253
|
+
value
|
254
|
+
end
|
255
|
+
end
|
256
|
+
end
|
257
|
+
end
|
258
|
+
end
|
@@ -14,7 +14,7 @@ module Algolia
|
|
14
14
|
|
15
15
|
attr_accessor :event_subtype
|
16
16
|
|
17
|
-
# Index name to which the event's items belong.
|
17
|
+
# Index name (case-sensitive) to which the event's items belong.
|
18
18
|
attr_accessor :index
|
19
19
|
|
20
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.
|
@@ -12,7 +12,7 @@ module Algolia
|
|
12
12
|
|
13
13
|
attr_accessor :event_type
|
14
14
|
|
15
|
-
# Index name to which the event's items belong.
|
15
|
+
# Index name (case-sensitive) to which the event's items belong.
|
16
16
|
attr_accessor :index
|
17
17
|
|
18
18
|
# Applied facet filters. Facet filters are `facet:value` pairs. Facet values must be URL-encoded, such as, `discount:10%25`.
|
@@ -11,7 +11,7 @@ module Algolia
|
|
11
11
|
|
12
12
|
attr_accessor :event_type
|
13
13
|
|
14
|
-
# Index name to which the event's items belong.
|
14
|
+
# Index name (case-sensitive) to which the event's items belong.
|
15
15
|
attr_accessor :index
|
16
16
|
|
17
17
|
# Applied facet filters. Facet filters are `facet:value` pairs. Facet values must be URL-encoded, such as, `discount:10%25`.
|
@@ -12,7 +12,7 @@ module Algolia
|
|
12
12
|
|
13
13
|
attr_accessor :event_type
|
14
14
|
|
15
|
-
# Index name to which the event's items belong.
|
15
|
+
# Index name (case-sensitive) to which the event's items belong.
|
16
16
|
attr_accessor :index
|
17
17
|
|
18
18
|
# Applied facet filters. Facet filters are `facet:value` pairs. Facet values must be URL-encoded, such as, `discount:10%25`.
|
@@ -6,10 +6,10 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module Personalization
|
8
8
|
class DeleteUserProfileResponse
|
9
|
-
#
|
9
|
+
# Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events. For more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
|
10
10
|
attr_accessor :user_token
|
11
11
|
|
12
|
-
#
|
12
|
+
# Date and time when the user profile can be safely considered to be deleted. Any events received after the `deletedUntil` date start a new user profile.
|
13
13
|
attr_accessor :deleted_until
|
14
14
|
|
15
15
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -6,15 +6,36 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module Personalization
|
8
8
|
class EventScoring
|
9
|
-
#
|
9
|
+
# Event score.
|
10
10
|
attr_accessor :score
|
11
11
|
|
12
|
-
#
|
12
|
+
# Event name.
|
13
13
|
attr_accessor :event_name
|
14
14
|
|
15
|
-
# The type of the event.
|
16
15
|
attr_accessor :event_type
|
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
|
{
|
@@ -34,7 +55,7 @@ module Algolia
|
|
34
55
|
{
|
35
56
|
:score => :Integer,
|
36
57
|
:event_name => :String,
|
37
|
-
:event_type => :
|
58
|
+
:event_type => :EventType
|
38
59
|
}
|
39
60
|
end
|
40
61
|
|
@@ -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 Personalization
|
8
|
+
class EventType
|
9
|
+
CLICK = "click".freeze
|
10
|
+
CONVERSION = "conversion".freeze
|
11
|
+
VIEW = "view".freeze
|
12
|
+
|
13
|
+
def self.all_vars
|
14
|
+
@all_vars ||= [CLICK, CONVERSION, VIEW].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 EventType.all_vars.include?(value)
|
29
|
+
|
30
|
+
raise "Invalid ENUM value #{value} for class #EventType"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -6,10 +6,10 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module Personalization
|
8
8
|
class FacetScoring
|
9
|
-
#
|
9
|
+
# Event score.
|
10
10
|
attr_accessor :score
|
11
11
|
|
12
|
-
#
|
12
|
+
# Facet attribute name.
|
13
13
|
attr_accessor :facet_name
|
14
14
|
|
15
15
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -6,13 +6,13 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module Personalization
|
8
8
|
class GetUserTokenResponse
|
9
|
-
#
|
9
|
+
# Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events. For more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
|
10
10
|
attr_accessor :user_token
|
11
11
|
|
12
|
-
# Date of last event
|
12
|
+
# Date and time of the last event from this user, in RFC 3339 format.
|
13
13
|
attr_accessor :last_event_at
|
14
14
|
|
15
|
-
#
|
15
|
+
# Scores for different facet values. Scores represent the user affinity for a user profile towards specific facet values, given the personalization strategy and past events.
|
16
16
|
attr_accessor :scores
|
17
17
|
|
18
18
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -6,13 +6,13 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module Personalization
|
8
8
|
class PersonalizationStrategyParams
|
9
|
-
# Scores associated with the events.
|
9
|
+
# Scores associated with each event. The higher the scores, the higher the impact of those events on the personalization of search results.
|
10
10
|
attr_accessor :event_scoring
|
11
11
|
|
12
|
-
# Scores associated with the
|
12
|
+
# Scores associated with each facet. The higher the scores, the higher the impact of those events on the personalization of search results.
|
13
13
|
attr_accessor :facet_scoring
|
14
14
|
|
15
|
-
#
|
15
|
+
# Impact of personalization on the search results. If set to 0, personalization has no impact on the search results.
|
16
16
|
attr_accessor :personalization_impact
|
17
17
|
|
18
18
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -83,6 +83,24 @@ module Algolia
|
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
|
+
# Custom attribute writer method with validation
|
87
|
+
# @param [Object] personalization_impact Value to be assigned
|
88
|
+
def personalization_impact=(personalization_impact)
|
89
|
+
if personalization_impact.nil?
|
90
|
+
raise ArgumentError, 'personalization_impact cannot be nil'
|
91
|
+
end
|
92
|
+
|
93
|
+
if personalization_impact > 100
|
94
|
+
raise ArgumentError, 'invalid value for "personalization_impact", must be smaller than or equal to 100.'
|
95
|
+
end
|
96
|
+
|
97
|
+
if personalization_impact < 0
|
98
|
+
raise ArgumentError, 'invalid value for "personalization_impact", must be greater than or equal to 0.'
|
99
|
+
end
|
100
|
+
|
101
|
+
@personalization_impact = personalization_impact
|
102
|
+
end
|
103
|
+
|
86
104
|
# Checks equality by comparing each attribute.
|
87
105
|
# @param [Object] Object to be compared
|
88
106
|
def ==(other)
|
@@ -6,7 +6,7 @@ require 'time'
|
|
6
6
|
module Algolia
|
7
7
|
module QuerySuggestions
|
8
8
|
class GetConfigStatus200Response
|
9
|
-
# Name of the Query Suggestions index.
|
9
|
+
# Name of the Query Suggestions index (case-sensitive).
|
10
10
|
attr_accessor :index_name
|
11
11
|
|
12
12
|
# Whether the creation or update of the Query Suggestions index is in progress.
|
@@ -10,7 +10,7 @@ module Algolia
|
|
10
10
|
# Algolia application ID to which this Query Suggestions configuration belongs.
|
11
11
|
attr_accessor :app_id
|
12
12
|
|
13
|
-
# Name of the Query Suggestions index.
|
13
|
+
# Name of the Query Suggestions index (case-sensitive).
|
14
14
|
attr_accessor :index_name
|
15
15
|
|
16
16
|
# Algolia indices from which to get the popular searches for query suggestions.
|
@@ -20,7 +20,7 @@ module Algolia
|
|
20
20
|
# Whether to include suggestions with special characters.
|
21
21
|
attr_accessor :allow_special_characters
|
22
22
|
|
23
|
-
# Name of the Query Suggestions index.
|
23
|
+
# Name of the Query Suggestions index (case-sensitive).
|
24
24
|
attr_accessor :index_name
|
25
25
|
|
26
26
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -7,7 +7,7 @@ module Algolia
|
|
7
7
|
module QuerySuggestions
|
8
8
|
# Configuration of an Algolia index for Query Suggestions.
|
9
9
|
class SourceIndex
|
10
|
-
# Name of the Algolia index to use as source for query suggestions.
|
10
|
+
# Name of the Algolia index (case-sensitive) to use as source for query suggestions.
|
11
11
|
attr_accessor :index_name
|
12
12
|
|
13
13
|
# If true, Query Suggestions uses all replica indices to find popular searches. If false, only the primary index is used.
|
@@ -26,7 +26,7 @@ module Algolia
|
|
26
26
|
# Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores).
|
27
27
|
attr_accessor :sum_or_filters_scores
|
28
28
|
|
29
|
-
# Restricts a search to a subset of your searchable attributes.
|
29
|
+
# Restricts a search to a subset of your searchable attributes. Attribute names are case-sensitive.
|
30
30
|
attr_accessor :restrict_searchable_attributes
|
31
31
|
|
32
32
|
# Facets for which to retrieve facet values that match the search criteria and the number of matching facet values. To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts).
|
@@ -60,7 +60,7 @@ module Algolia
|
|
60
60
|
# Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas).
|
61
61
|
attr_accessor :inside_bounding_box
|
62
62
|
|
63
|
-
# Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored
|
63
|
+
# Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`.
|
64
64
|
attr_accessor :inside_polygon
|
65
65
|
|
66
66
|
# ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`.
|
@@ -163,7 +163,7 @@ module Algolia
|
|
163
163
|
:minimum_around_radius => :Integer,
|
164
164
|
:inside_bounding_box => :'Array<Array<Float>>',
|
165
165
|
:inside_polygon => :'Array<Array<Float>>',
|
166
|
-
:natural_languages => :'Array<
|
166
|
+
:natural_languages => :'Array<SupportedLanguage>',
|
167
167
|
:rule_contexts => :'Array<String>',
|
168
168
|
:personalization_impact => :Integer,
|
169
169
|
:user_token => :String,
|