algolia 3.0.0.alpha.16 → 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/.openapi-generator/FILES +10 -167
- data/CHANGELOG.md +16 -0
- data/Gemfile.lock +4 -4
- data/lib/algolia/api/abtesting_client.rb +20 -20
- data/lib/algolia/api/analytics_client.rb +76 -76
- data/lib/algolia/api/personalization_client.rb +12 -12
- data/lib/algolia/api/recommend_client.rb +22 -22
- data/lib/algolia/api/search_client.rb +8 -8
- data/lib/algolia/api/usage_client.rb +329 -0
- 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/analytics/get_status_response.rb +1 -1
- data/lib/algolia/models/ingestion/auth_algolia_insights.rb +212 -0
- data/lib/algolia/models/{recommend/consequence_query_object.rb → ingestion/auth_algolia_insights_partial.rb} +21 -24
- data/lib/algolia/models/ingestion/auth_input.rb +1 -0
- data/lib/algolia/models/ingestion/auth_input_partial.rb +1 -0
- data/lib/algolia/models/ingestion/authentication_type.rb +2 -1
- 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/{recommend/base_recommended_for_you_query_parameters.rb → ingestion/source_shopify_base.rb} +14 -14
- 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 +2 -2
- data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +2 -2
- data/lib/algolia/models/insights/clicked_filters.rb +2 -2
- data/lib/algolia/models/insights/clicked_object_ids.rb +2 -2
- data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +2 -2
- data/lib/algolia/models/insights/converted_filters.rb +2 -2
- data/lib/algolia/models/insights/converted_object_ids.rb +2 -2
- data/lib/algolia/models/insights/converted_object_ids_after_search.rb +2 -2
- data/lib/algolia/models/insights/purchased_object_ids.rb +2 -2
- data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +2 -2
- data/lib/algolia/models/insights/viewed_filters.rb +2 -2
- data/lib/algolia/models/insights/viewed_object_ids.rb +2 -2
- data/lib/algolia/models/monitoring/incidents_inner.rb +1 -1
- data/lib/algolia/models/monitoring/probes_metric.rb +1 -1
- data/lib/algolia/models/monitoring/time_inner.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 +3 -3
- data/lib/algolia/models/query-suggestions/get_log_file200_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/auto_facet_filter.rb +208 -0
- data/lib/algolia/models/recommend/base_recommend_request.rb +37 -8
- data/lib/algolia/models/recommend/base_search_params.rb +4 -4
- data/lib/algolia/models/recommend/base_search_params_without_query.rb +4 -4
- data/lib/algolia/models/recommend/bought_together_query.rb +319 -0
- data/lib/algolia/models/recommend/condition.rb +12 -62
- data/lib/algolia/models/recommend/consequence.rb +32 -54
- data/lib/algolia/models/recommend/deleted_at_response.rb +1 -1
- data/lib/algolia/models/recommend/{recommended_for_you_query_parameters.rb → fallback_params.rb} +17 -20
- data/lib/algolia/models/recommend/{edit_type.rb → fbt_model.rb} +5 -6
- data/lib/algolia/models/recommend/{base_trending_facets_query.rb → frequently_bought_together.rb} +20 -18
- data/lib/algolia/models/recommend/get_recommendations_params.rb +2 -2
- data/lib/algolia/models/recommend/{consequence_hide.rb → hide_consequence_object.rb} +4 -6
- data/lib/algolia/models/recommend/index_settings_as_search_params.rb +10 -10
- data/lib/algolia/models/recommend/{base_recommendations_query.rb → looking_similar.rb} +6 -15
- data/lib/algolia/models/recommend/{anchoring.rb → looking_similar_model.rb} +5 -8
- data/lib/algolia/models/recommend/looking_similar_query.rb +328 -0
- data/lib/algolia/models/recommend/{params.rb → params_consequence.rb} +26 -28
- data/lib/algolia/models/recommend/{promote_object_id.rb → promote_consequence_object.rb} +19 -9
- data/lib/algolia/models/recommend/re_ranking_apply_filter.rb +1 -1
- data/lib/algolia/models/recommend/{rule_response.rb → recommend_rule.rb} +13 -18
- data/lib/algolia/models/recommend/{rule_response_metadata.rb → recommend_rule_metadata.rb} +5 -4
- data/lib/algolia/models/recommend/recommendations_hits.rb +4 -24
- data/lib/algolia/models/recommend/recommendations_request.rb +3 -1
- data/lib/algolia/models/recommend/recommendations_results.rb +4 -24
- data/lib/algolia/models/recommend/{base_recommended_for_you_query.rb → recommended_for_you.rb} +5 -14
- data/lib/algolia/models/recommend/recommended_for_you_query.rb +36 -16
- data/lib/algolia/models/recommend/{recommendation_models.rb → related_model.rb} +4 -5
- data/lib/algolia/models/recommend/{edit.rb → related_products.rb} +27 -24
- data/lib/algolia/models/recommend/{recommendations_query.rb → related_query.rb} +40 -20
- data/lib/algolia/models/recommend/{consequence_params.rb → search_params.rb} +33 -52
- data/lib/algolia/models/recommend/search_params_object.rb +15 -14
- data/lib/algolia/models/recommend/search_recommend_rules_params.rb +58 -10
- data/lib/algolia/models/recommend/search_recommend_rules_response.rb +2 -2
- data/lib/algolia/models/recommend/trending_facet_hit.rb +2 -2
- data/lib/algolia/models/recommend/trending_facets.rb +243 -0
- data/lib/algolia/models/recommend/trending_facets_query.rb +51 -11
- data/lib/algolia/models/recommend/{base_trending_items_query.rb → trending_items.rb} +12 -15
- data/lib/algolia/models/recommend/trending_items_query.rb +43 -17
- data/lib/algolia/models/search/add_api_key_response.rb +1 -1
- data/lib/algolia/models/search/base_get_api_key_response.rb +1 -1
- data/lib/algolia/models/search/base_index_settings.rb +10 -10
- data/lib/algolia/models/search/base_search_params.rb +4 -4
- data/lib/algolia/models/search/base_search_params_without_query.rb +4 -4
- data/lib/algolia/models/search/browse_params_object.rb +14 -14
- data/lib/algolia/models/search/consequence_params.rb +14 -14
- data/lib/algolia/models/search/created_at_response.rb +1 -1
- data/lib/algolia/models/search/delete_api_key_response.rb +1 -1
- data/lib/algolia/models/search/delete_by_params.rb +2 -2
- data/lib/algolia/models/search/delete_source_response.rb +1 -1
- data/lib/algolia/models/search/deleted_at_response.rb +1 -1
- data/lib/algolia/models/search/fetched_index.rb +1 -1
- data/lib/algolia/models/search/get_api_key_response.rb +1 -1
- data/lib/algolia/models/search/index_settings.rb +20 -20
- data/lib/algolia/models/search/index_settings_as_search_params.rb +10 -10
- data/lib/algolia/models/search/log.rb +1 -1
- 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/remove_user_id_response.rb +1 -1
- data/lib/algolia/models/search/replace_source_response.rb +1 -1
- data/lib/algolia/models/search/save_object_response.rb +1 -1
- data/lib/algolia/models/search/save_synonym_response.rb +1 -1
- data/lib/algolia/models/search/search_for_facets.rb +15 -15
- data/lib/algolia/models/search/search_for_facets_options.rb +1 -1
- data/lib/algolia/models/search/search_for_hits.rb +15 -15
- data/lib/algolia/models/search/search_for_hits_options.rb +1 -1
- data/lib/algolia/models/search/search_params_object.rb +15 -14
- data/lib/algolia/models/search/search_user_ids_response.rb +1 -1
- data/lib/algolia/models/search/secured_api_key_restrictions.rb +1 -1
- data/lib/algolia/models/search/update_api_key_response.rb +1 -1
- data/lib/algolia/models/search/updated_at_response.rb +1 -1
- data/lib/algolia/models/search/updated_at_with_object_id_response.rb +1 -1
- data/lib/algolia/models/search/updated_rule_response.rb +1 -1
- data/lib/algolia/models/search/user_hit.rb +1 -1
- data/lib/algolia/models/search/user_id.rb +1 -1
- data/lib/algolia/models/usage/error_base.rb +205 -0
- data/lib/algolia/models/usage/get_usage200_response.rb +198 -0
- data/lib/algolia/models/usage/get_usage200_response_statistics_inner.rb +206 -0
- data/lib/algolia/models/usage/get_usage400_response.rb +198 -0
- data/lib/algolia/models/usage/get_usage400_response_error.rb +216 -0
- data/lib/algolia/models/usage/get_usage400_response_error_errors_inner.rb +225 -0
- data/lib/algolia/models/usage/granularity.rb +33 -0
- data/lib/algolia/models/usage/statistic.rb +116 -0
- data/lib/algolia/models/{recommend/promote.rb → usage/statistic_value.rb} +5 -5
- data/lib/algolia/version.rb +1 -1
- metadata +47 -25
- data/lib/algolia/models/recommend/automatic_facet_filter.rb +0 -220
- data/lib/algolia/models/recommend/automatic_facet_filters.rb +0 -97
- data/lib/algolia/models/recommend/consequence_query.rb +0 -97
- data/lib/algolia/models/recommend/promote_object_ids.rb +0 -228
@@ -1,228 +0,0 @@
|
|
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 Recommend
|
8
|
-
# Records to promote.
|
9
|
-
class PromoteObjectIDs
|
10
|
-
# Object IDs of the records you want to promote. The records are placed as a group at the `position`. For example, if you want to promote four records to position `0`, they will be the first four search results.
|
11
|
-
attr_accessor :object_ids
|
12
|
-
|
13
|
-
# Position in the search results where you want to show the promoted records.
|
14
|
-
attr_accessor :position
|
15
|
-
|
16
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
17
|
-
def self.attribute_map
|
18
|
-
{
|
19
|
-
:object_ids => :objectIDs,
|
20
|
-
:position => :position
|
21
|
-
}
|
22
|
-
end
|
23
|
-
|
24
|
-
# Returns all the JSON keys this model knows about
|
25
|
-
def self.acceptable_attributes
|
26
|
-
attribute_map.values
|
27
|
-
end
|
28
|
-
|
29
|
-
# Attribute type mapping.
|
30
|
-
def self.types_mapping
|
31
|
-
{
|
32
|
-
:object_ids => :'Array<String>',
|
33
|
-
:position => :Integer
|
34
|
-
}
|
35
|
-
end
|
36
|
-
|
37
|
-
# List of attributes with nullable: true
|
38
|
-
def self.openapi_nullable
|
39
|
-
Set.new([])
|
40
|
-
end
|
41
|
-
|
42
|
-
# Initializes the object
|
43
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
44
|
-
def initialize(attributes = {})
|
45
|
-
unless attributes.is_a?(Hash)
|
46
|
-
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::PromoteObjectIDs` initialize method"
|
47
|
-
end
|
48
|
-
|
49
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
50
|
-
attributes = attributes.each_with_object({}) do |(k, v), h|
|
51
|
-
unless self.class.attribute_map.key?(k.to_sym)
|
52
|
-
raise ArgumentError,
|
53
|
-
"`#{k}` is not a valid attribute in `Algolia::PromoteObjectIDs`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
54
|
-
end
|
55
|
-
|
56
|
-
h[k.to_sym] = v
|
57
|
-
end
|
58
|
-
|
59
|
-
if attributes.key?(:object_ids)
|
60
|
-
if (value = attributes[:object_ids]).is_a?(Array)
|
61
|
-
self.object_ids = value
|
62
|
-
end
|
63
|
-
else
|
64
|
-
self.object_ids = nil
|
65
|
-
end
|
66
|
-
|
67
|
-
if attributes.key?(:position)
|
68
|
-
self.position = attributes[:position]
|
69
|
-
else
|
70
|
-
self.position = nil
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
# Custom attribute writer method with validation
|
75
|
-
# @param [Object] object_ids Value to be assigned
|
76
|
-
def object_ids=(object_ids)
|
77
|
-
if object_ids.nil?
|
78
|
-
raise ArgumentError, 'object_ids cannot be nil'
|
79
|
-
end
|
80
|
-
|
81
|
-
if object_ids.length > 100
|
82
|
-
raise ArgumentError, 'invalid value for "object_ids", number of items must be less than or equal to 100.'
|
83
|
-
end
|
84
|
-
|
85
|
-
@object_ids = object_ids
|
86
|
-
end
|
87
|
-
|
88
|
-
# Checks equality by comparing each attribute.
|
89
|
-
# @param [Object] Object to be compared
|
90
|
-
def ==(other)
|
91
|
-
return true if equal?(other)
|
92
|
-
|
93
|
-
self.class == other.class &&
|
94
|
-
object_ids == other.object_ids &&
|
95
|
-
position == other.position
|
96
|
-
end
|
97
|
-
|
98
|
-
# @see the `==` method
|
99
|
-
# @param [Object] Object to be compared
|
100
|
-
def eql?(other)
|
101
|
-
self == other
|
102
|
-
end
|
103
|
-
|
104
|
-
# Calculates hash code according to all attributes.
|
105
|
-
# @return [Integer] Hash code
|
106
|
-
def hash
|
107
|
-
[object_ids, position].hash
|
108
|
-
end
|
109
|
-
|
110
|
-
# Builds the object from hash
|
111
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
-
# @return [Object] Returns the model itself
|
113
|
-
def self.build_from_hash(attributes)
|
114
|
-
return nil unless attributes.is_a?(Hash)
|
115
|
-
|
116
|
-
attributes = attributes.transform_keys(&:to_sym)
|
117
|
-
transformed_hash = {}
|
118
|
-
types_mapping.each_pair do |key, type|
|
119
|
-
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
120
|
-
transformed_hash[key.to_sym] = nil
|
121
|
-
elsif type =~ /\AArray<(.*)>/i
|
122
|
-
# check to ensure the input is an array given that the attribute
|
123
|
-
# is documented as an array but the input is not
|
124
|
-
if attributes[attribute_map[key]].is_a?(Array)
|
125
|
-
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
|
126
|
-
end
|
127
|
-
elsif !attributes[attribute_map[key]].nil?
|
128
|
-
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
129
|
-
end
|
130
|
-
end
|
131
|
-
new(transformed_hash)
|
132
|
-
end
|
133
|
-
|
134
|
-
# Deserializes the data based on type
|
135
|
-
# @param string type Data type
|
136
|
-
# @param string value Value to be deserialized
|
137
|
-
# @return [Object] Deserialized data
|
138
|
-
def self._deserialize(type, value)
|
139
|
-
case type.to_sym
|
140
|
-
when :Time
|
141
|
-
Time.parse(value)
|
142
|
-
when :Date
|
143
|
-
Date.parse(value)
|
144
|
-
when :String
|
145
|
-
value.to_s
|
146
|
-
when :Integer
|
147
|
-
value.to_i
|
148
|
-
when :Float
|
149
|
-
value.to_f
|
150
|
-
when :Boolean
|
151
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
152
|
-
true
|
153
|
-
else
|
154
|
-
false
|
155
|
-
end
|
156
|
-
when :Object
|
157
|
-
# generic object (usually a Hash), return directly
|
158
|
-
value
|
159
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
160
|
-
inner_type = Regexp.last_match[:inner_type]
|
161
|
-
value.map { |v| _deserialize(inner_type, v) }
|
162
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
163
|
-
k_type = Regexp.last_match[:k_type]
|
164
|
-
v_type = Regexp.last_match[:v_type]
|
165
|
-
{}.tap do |hash|
|
166
|
-
value.each do |k, v|
|
167
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
168
|
-
end
|
169
|
-
end
|
170
|
-
else # model
|
171
|
-
# models (e.g. Pet) or oneOf
|
172
|
-
klass = Algolia::Recommend.const_get(type)
|
173
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
174
|
-
end
|
175
|
-
end
|
176
|
-
|
177
|
-
# Returns the string representation of the object
|
178
|
-
# @return [String] String presentation of the object
|
179
|
-
def to_s
|
180
|
-
to_hash.to_s
|
181
|
-
end
|
182
|
-
|
183
|
-
# to_body is an alias to to_hash (backward compatibility)
|
184
|
-
# @return [Hash] Returns the object in the form of hash
|
185
|
-
def to_body
|
186
|
-
to_hash
|
187
|
-
end
|
188
|
-
|
189
|
-
def to_json(*_args)
|
190
|
-
to_hash.to_json
|
191
|
-
end
|
192
|
-
|
193
|
-
# Returns the object in the form of hash
|
194
|
-
# @return [Hash] Returns the object in the form of hash
|
195
|
-
def to_hash
|
196
|
-
hash = {}
|
197
|
-
self.class.attribute_map.each_pair do |attr, param|
|
198
|
-
value = send(attr)
|
199
|
-
if value.nil?
|
200
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
201
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
202
|
-
end
|
203
|
-
|
204
|
-
hash[param] = _to_hash(value)
|
205
|
-
end
|
206
|
-
hash
|
207
|
-
end
|
208
|
-
|
209
|
-
# Outputs non-array value in the form of hash
|
210
|
-
# For object, use to_hash. Otherwise, just return the value
|
211
|
-
# @param [Object] value Any valid value
|
212
|
-
# @return [Hash] Returns the value in the form of hash
|
213
|
-
def _to_hash(value)
|
214
|
-
if value.is_a?(Array)
|
215
|
-
value.compact.map { |v| _to_hash(v) }
|
216
|
-
elsif value.is_a?(Hash)
|
217
|
-
{}.tap do |hash|
|
218
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
219
|
-
end
|
220
|
-
elsif value.respond_to? :to_hash
|
221
|
-
value.to_hash
|
222
|
-
else
|
223
|
-
value
|
224
|
-
end
|
225
|
-
end
|
226
|
-
end
|
227
|
-
end
|
228
|
-
end
|