algolia 3.4.0 → 3.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/Gemfile.lock +1 -1
  4. data/lib/algolia/api/abtesting_client.rb +0 -7
  5. data/lib/algolia/api/analytics_client.rb +32 -88
  6. data/lib/algolia/api/ingestion_client.rb +2 -170
  7. data/lib/algolia/api/insights_client.rb +0 -22
  8. data/lib/algolia/api/monitoring_client.rb +11 -11
  9. data/lib/algolia/api/search_client.rb +19 -74
  10. data/lib/algolia/models/abtesting/ab_tests_variant.rb +0 -18
  11. data/lib/algolia/models/abtesting/ab_tests_variant_search_params.rb +0 -18
  12. data/lib/algolia/models/abtesting/add_ab_tests_request.rb +0 -18
  13. data/lib/algolia/models/abtesting/minimum_detectable_effect.rb +0 -18
  14. data/lib/algolia/models/abtesting/schedule_ab_tests_request.rb +0 -18
  15. data/lib/algolia/models/abtesting/variant.rb +0 -18
  16. data/lib/algolia/models/analytics/click_position.rb +0 -32
  17. data/lib/algolia/models/analytics/daily_add_to_cart_rates.rb +0 -28
  18. data/lib/algolia/models/analytics/daily_average_clicks.rb +0 -24
  19. data/lib/algolia/models/analytics/daily_click_through_rates.rb +0 -28
  20. data/lib/algolia/models/analytics/daily_conversion_rates.rb +0 -28
  21. data/lib/algolia/models/analytics/daily_no_click_rates.rb +0 -32
  22. data/lib/algolia/models/analytics/daily_no_results_rates.rb +0 -18
  23. data/lib/algolia/models/analytics/daily_purchase_rates.rb +0 -14
  24. data/lib/algolia/models/analytics/daily_searches_no_clicks.rb +0 -14
  25. data/lib/algolia/models/analytics/daily_searches_no_results.rb +0 -14
  26. data/lib/algolia/models/analytics/get_add_to_cart_rate_response.rb +0 -28
  27. data/lib/algolia/models/analytics/get_average_click_position_response.rb +0 -24
  28. data/lib/algolia/models/analytics/get_click_positions_response.rb +0 -18
  29. data/lib/algolia/models/analytics/get_click_through_rate_response.rb +0 -28
  30. data/lib/algolia/models/analytics/get_conversion_rate_response.rb +0 -28
  31. data/lib/algolia/models/analytics/get_no_click_rate_response.rb +0 -32
  32. data/lib/algolia/models/analytics/get_no_results_rate_response.rb +0 -18
  33. data/lib/algolia/models/analytics/get_purchase_rate_response.rb +0 -14
  34. data/lib/algolia/models/analytics/top_hit_with_analytics.rb +0 -56
  35. data/lib/algolia/models/analytics/top_hit_with_revenue_analytics.rb +0 -98
  36. data/lib/algolia/models/analytics/top_search_with_analytics.rb +0 -90
  37. data/lib/algolia/models/analytics/top_search_with_revenue_analytics.rb +0 -132
  38. data/lib/algolia/models/ingestion/event.rb +0 -14
  39. data/lib/algolia/models/ingestion/pagination.rb +0 -60
  40. data/lib/algolia/models/ingestion/run.rb +0 -18
  41. data/lib/algolia/models/ingestion/source_csv.rb +0 -21
  42. data/lib/algolia/models/ingestion/task.rb +0 -18
  43. data/lib/algolia/models/ingestion/task_create.rb +0 -18
  44. data/lib/algolia/models/ingestion/task_create_v1.rb +0 -18
  45. data/lib/algolia/models/ingestion/task_update.rb +0 -18
  46. data/lib/algolia/models/ingestion/task_update_v1.rb +0 -18
  47. data/lib/algolia/models/ingestion/task_v1.rb +0 -18
  48. data/lib/algolia/models/ingestion/transformation.rb +1 -1
  49. data/lib/algolia/models/ingestion/transformation_create.rb +1 -1
  50. data/lib/algolia/models/insights/added_to_cart_object_ids.rb +0 -123
  51. data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +0 -149
  52. data/lib/algolia/models/insights/clicked_filters.rb +0 -105
  53. data/lib/algolia/models/insights/clicked_object_ids.rb +0 -105
  54. data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +0 -149
  55. data/lib/algolia/models/insights/converted_filters.rb +0 -105
  56. data/lib/algolia/models/insights/converted_object_ids.rb +0 -105
  57. data/lib/algolia/models/insights/converted_object_ids_after_search.rb +0 -131
  58. data/lib/algolia/models/insights/insights_events.rb +0 -18
  59. data/lib/algolia/models/insights/object_data_after_search.rb +0 -26
  60. data/lib/algolia/models/insights/purchased_object_ids.rb +0 -123
  61. data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +0 -123
  62. data/lib/algolia/models/insights/viewed_filters.rb +0 -105
  63. data/lib/algolia/models/insights/viewed_object_ids.rb +0 -105
  64. data/lib/algolia/models/personalization/personalization_strategy_params.rb +0 -18
  65. data/lib/algolia/models/query-suggestions/configuration.rb +0 -17
  66. data/lib/algolia/models/query-suggestions/configuration_response.rb +0 -17
  67. data/lib/algolia/models/query-suggestions/configuration_with_index.rb +0 -17
  68. data/lib/algolia/models/query-suggestions/source_index.rb +0 -28
  69. data/lib/algolia/models/recommend/banner.rb +218 -0
  70. data/lib/algolia/models/{query-suggestions/base_query_suggestions_configuration_response.rb → recommend/banner_image.rb} +31 -38
  71. data/lib/algolia/models/{query-suggestions/base_query_suggestions_configuration_with_index.rb → recommend/banner_image_url.rb} +23 -23
  72. data/lib/algolia/models/{query-suggestions/get_config_status200_response.rb → recommend/banner_link.rb} +13 -53
  73. data/lib/algolia/models/recommend/bought_together_query.rb +0 -36
  74. data/lib/algolia/models/recommend/condition.rb +0 -15
  75. data/lib/algolia/models/recommend/consequence.rb +0 -28
  76. data/lib/algolia/models/recommend/fallback_params.rb +8 -100
  77. data/lib/algolia/models/recommend/looking_similar_query.rb +0 -36
  78. data/lib/algolia/models/recommend/numeric_filters.rb +1 -1
  79. data/lib/algolia/models/recommend/promote_consequence_object.rb +0 -14
  80. data/lib/algolia/models/recommend/ranking_info.rb +0 -112
  81. data/lib/algolia/models/recommend/recommend_hit.rb +0 -18
  82. data/lib/algolia/models/recommend/recommend_search_params.rb +8 -100
  83. data/lib/algolia/models/recommend/recommendations_results.rb +0 -61
  84. data/lib/algolia/models/recommend/recommended_for_you_query.rb +0 -36
  85. data/lib/algolia/models/recommend/related_query.rb +0 -36
  86. data/lib/algolia/models/recommend/rendering_content.rb +14 -5
  87. data/lib/algolia/models/recommend/search_recommend_rules_params.rb +0 -50
  88. data/lib/algolia/models/recommend/search_recommend_rules_response.rb +0 -14
  89. data/lib/algolia/models/recommend/trending_facet_hit.rb +0 -18
  90. data/lib/algolia/models/recommend/trending_facets_query.rb +0 -36
  91. data/lib/algolia/models/recommend/trending_items_query.rb +0 -36
  92. data/lib/algolia/models/recommend/typo_tolerance.rb +1 -1
  93. data/lib/algolia/models/recommend/widgets.rb +212 -0
  94. data/lib/algolia/models/search/api_key.rb +1 -1
  95. data/lib/algolia/models/search/banner.rb +218 -0
  96. data/lib/algolia/models/{query-suggestions/get_log_file200_response.rb → search/banner_image.rb} +21 -61
  97. data/lib/algolia/models/search/banner_image_url.rb +212 -0
  98. data/lib/algolia/models/search/banner_link.rb +212 -0
  99. data/lib/algolia/models/search/browse_params_object.rb +4 -132
  100. data/lib/algolia/models/search/browse_response.rb +0 -61
  101. data/lib/algolia/models/search/condition.rb +0 -15
  102. data/lib/algolia/models/search/consequence.rb +0 -28
  103. data/lib/algolia/models/search/consequence_params.rb +4 -132
  104. data/lib/algolia/models/search/delete_by_params.rb +1 -1
  105. data/lib/algolia/models/search/get_api_key_response.rb +1 -1
  106. data/lib/algolia/models/search/index_settings.rb +7 -85
  107. data/lib/algolia/models/search/log.rb +0 -34
  108. data/lib/algolia/models/search/numeric_filters.rb +1 -1
  109. data/lib/algolia/models/search/promote_object_ids.rb +0 -14
  110. data/lib/algolia/models/search/ranking_info.rb +0 -112
  111. data/lib/algolia/models/search/rendering_content.rb +14 -5
  112. data/lib/algolia/models/search/rule.rb +0 -18
  113. data/lib/algolia/models/search/search_dictionary_entries_params.rb +0 -32
  114. data/lib/algolia/models/search/search_dictionary_entries_response.rb +0 -14
  115. data/lib/algolia/models/search/search_for_facet_values_request.rb +0 -14
  116. data/lib/algolia/models/search/search_for_facets.rb +4 -132
  117. data/lib/algolia/models/search/search_for_hits.rb +4 -132
  118. data/lib/algolia/models/search/search_params_object.rb +4 -132
  119. data/lib/algolia/models/search/search_response.rb +0 -61
  120. data/lib/algolia/models/search/search_rules_params.rb +0 -32
  121. data/lib/algolia/models/search/search_synonyms_params.rb +0 -32
  122. data/lib/algolia/models/search/search_user_ids_params.rb +0 -32
  123. data/lib/algolia/models/search/search_user_ids_response.rb +0 -32
  124. data/lib/algolia/models/search/settings_response.rb +7 -85
  125. data/lib/algolia/models/search/typo_tolerance.rb +1 -1
  126. data/lib/algolia/models/search/user_hit.rb +0 -15
  127. data/lib/algolia/models/search/user_id.rb +0 -15
  128. data/lib/algolia/models/search/widgets.rb +212 -0
  129. data/lib/algolia/version.rb +1 -1
  130. metadata +12 -9
  131. data/lib/algolia/models/query-suggestions/query_suggestions_configuration.rb +0 -276
  132. data/lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb +0 -316
  133. data/lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb +0 -295
@@ -1,295 +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 QuerySuggestions
8
- # Query Suggestions configuration.
9
- class QuerySuggestionsConfigurationWithIndex
10
- # Algolia indices from which to get the popular searches for query suggestions.
11
- attr_accessor :source_indices
12
-
13
- attr_accessor :languages
14
-
15
- attr_accessor :exclude
16
-
17
- # Whether to turn on personalized query suggestions.
18
- attr_accessor :enable_personalization
19
-
20
- # Whether to include suggestions with special characters.
21
- attr_accessor :allow_special_characters
22
-
23
- # Name of the Query Suggestions index (case-sensitive).
24
- attr_accessor :index_name
25
-
26
- # Attribute mapping from ruby-style variable name to JSON key.
27
- def self.attribute_map
28
- {
29
- :source_indices => :sourceIndices,
30
- :languages => :languages,
31
- :exclude => :exclude,
32
- :enable_personalization => :enablePersonalization,
33
- :allow_special_characters => :allowSpecialCharacters,
34
- :index_name => :indexName
35
- }
36
- end
37
-
38
- # Returns all the JSON keys this model knows about
39
- def self.acceptable_attributes
40
- attribute_map.values
41
- end
42
-
43
- # Attribute type mapping.
44
- def self.types_mapping
45
- {
46
- :source_indices => :"Array<SourceIndex>",
47
- :languages => :Languages,
48
- :exclude => :"Array<String>",
49
- :enable_personalization => :Boolean,
50
- :allow_special_characters => :Boolean,
51
- :index_name => :String
52
- }
53
- end
54
-
55
- # List of attributes with nullable: true
56
- def self.openapi_nullable
57
- Set.new(
58
- [
59
- :exclude
60
- ]
61
- )
62
- end
63
-
64
- # List of class defined in allOf (OpenAPI v3)
65
- def self.openapi_all_of
66
- [
67
- :QuerySuggestionsConfiguration
68
- ]
69
- end
70
-
71
- # Initializes the object
72
- # @param [Hash] attributes Model attributes in the form of hash
73
- def initialize(attributes = {})
74
- unless attributes.is_a?(Hash)
75
- raise(
76
- ArgumentError,
77
- "The input argument (attributes) must be a hash in `Algolia::QuerySuggestionsConfigurationWithIndex` initialize method"
78
- )
79
- end
80
-
81
- # check to see if the attribute exists and convert string to symbol for hash key
82
- attributes = attributes.each_with_object({}) do |(k, v), h|
83
- unless self.class.attribute_map.key?(k.to_sym)
84
- raise(
85
- ArgumentError,
86
- "`#{k}` is not a valid attribute in `Algolia::QuerySuggestionsConfigurationWithIndex`. Please check the name to make sure it's valid. List of attributes: " +
87
- self.class.attribute_map.keys.inspect
88
- )
89
- end
90
-
91
- h[k.to_sym] = v
92
- end
93
-
94
- if attributes.key?(:source_indices)
95
- if (value = attributes[:source_indices]).is_a?(Array)
96
- self.source_indices = value
97
- end
98
- else
99
- self.source_indices = nil
100
- end
101
-
102
- if attributes.key?(:languages)
103
- self.languages = attributes[:languages]
104
- end
105
-
106
- if attributes.key?(:exclude)
107
- if (value = attributes[:exclude]).is_a?(Array)
108
- self.exclude = value
109
- end
110
- end
111
-
112
- if attributes.key?(:enable_personalization)
113
- self.enable_personalization = attributes[:enable_personalization]
114
- end
115
-
116
- if attributes.key?(:allow_special_characters)
117
- self.allow_special_characters = attributes[:allow_special_characters]
118
- end
119
-
120
- if attributes.key?(:index_name)
121
- self.index_name = attributes[:index_name]
122
- else
123
- self.index_name = nil
124
- end
125
- end
126
-
127
- # Custom attribute writer method with validation
128
- # @param [Object] source_indices Value to be assigned
129
- def source_indices=(source_indices)
130
- if source_indices.nil?
131
- raise ArgumentError, "source_indices cannot be nil"
132
- end
133
-
134
- if source_indices.length < 1
135
- raise(
136
- ArgumentError,
137
- "invalid value for \"source_indices\", number of items must be greater than or equal to 1."
138
- )
139
- end
140
-
141
- @source_indices = source_indices
142
- end
143
-
144
- # Checks equality by comparing each attribute.
145
- # @param [Object] Object to be compared
146
- def ==(other)
147
- return true if equal?(other)
148
-
149
- self.class == other.class &&
150
- source_indices == other.source_indices &&
151
- languages == other.languages &&
152
- exclude == other.exclude &&
153
- enable_personalization == other.enable_personalization &&
154
- allow_special_characters == other.allow_special_characters &&
155
- index_name == other.index_name
156
- end
157
-
158
- # @see the `==` method
159
- # @param [Object] Object to be compared
160
- def eql?(other)
161
- self == other
162
- end
163
-
164
- # Calculates hash code according to all attributes.
165
- # @return [Integer] Hash code
166
- def hash
167
- [source_indices, languages, exclude, enable_personalization, allow_special_characters, index_name].hash
168
- end
169
-
170
- # Builds the object from hash
171
- # @param [Hash] attributes Model attributes in the form of hash
172
- # @return [Object] Returns the model itself
173
- def self.build_from_hash(attributes)
174
- return nil unless attributes.is_a?(Hash)
175
-
176
- attributes = attributes.transform_keys(&:to_sym)
177
- transformed_hash = {}
178
- types_mapping.each_pair do |key, type|
179
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
180
- transformed_hash[key.to_sym] = nil
181
- elsif type =~ /\AArray<(.*)>/i
182
- # check to ensure the input is an array given that the attribute
183
- # is documented as an array but the input is not
184
- if attributes[attribute_map[key]].is_a?(Array)
185
- transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
186
- _deserialize(::Regexp.last_match(1), v)
187
- }
188
- end
189
- elsif !attributes[attribute_map[key]].nil?
190
- transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
191
- end
192
- end
193
-
194
- new(transformed_hash)
195
- end
196
-
197
- # Deserializes the data based on type
198
- # @param string type Data type
199
- # @param string value Value to be deserialized
200
- # @return [Object] Deserialized data
201
- def self._deserialize(type, value)
202
- case type.to_sym
203
- when :Time
204
- Time.parse(value)
205
- when :Date
206
- Date.parse(value)
207
- when :String
208
- value.to_s
209
- when :Integer
210
- value.to_i
211
- when :Float
212
- value.to_f
213
- when :Boolean
214
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
215
- true
216
- else
217
- false
218
- end
219
-
220
- when :Object
221
- # generic object (usually a Hash), return directly
222
- value
223
- when /\AArray<(?<inner_type>.+)>\z/
224
- inner_type = Regexp.last_match[:inner_type]
225
- value.map { |v| _deserialize(inner_type, v) }
226
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
227
- k_type = Regexp.last_match[:k_type]
228
- v_type = Regexp.last_match[:v_type]
229
- {}.tap do |hash|
230
- value.each do |k, v|
231
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
232
- end
233
- end
234
- # model
235
- else
236
- # models (e.g. Pet) or oneOf
237
- klass = Algolia::QuerySuggestions.const_get(type)
238
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
239
- .build_from_hash(value)
240
- end
241
- end
242
-
243
- # Returns the string representation of the object
244
- # @return [String] String presentation of the object
245
- def to_s
246
- to_hash.to_s
247
- end
248
-
249
- # to_body is an alias to to_hash (backward compatibility)
250
- # @return [Hash] Returns the object in the form of hash
251
- def to_body
252
- to_hash
253
- end
254
-
255
- def to_json(*_args)
256
- to_hash.to_json
257
- end
258
-
259
- # Returns the object in the form of hash
260
- # @return [Hash] Returns the object in the form of hash
261
- def to_hash
262
- hash = {}
263
- self.class.attribute_map.each_pair do |attr, param|
264
- value = send(attr)
265
- if value.nil?
266
- is_nullable = self.class.openapi_nullable.include?(attr)
267
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
268
- end
269
-
270
- hash[param] = _to_hash(value)
271
- end
272
-
273
- hash
274
- end
275
-
276
- # Outputs non-array value in the form of hash
277
- # For object, use to_hash. Otherwise, just return the value
278
- # @param [Object] value Any valid value
279
- # @return [Hash] Returns the value in the form of hash
280
- def _to_hash(value)
281
- if value.is_a?(Array)
282
- value.compact.map { |v| _to_hash(v) }
283
- elsif value.is_a?(Hash)
284
- {}.tap do |hash|
285
- value.each { |k, v| hash[k] = _to_hash(v) }
286
- end
287
- elsif value.respond_to?(:to_hash)
288
- value.to_hash
289
- else
290
- value
291
- end
292
- end
293
- end
294
- end
295
- end