algolia 3.5.0 → 3.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/Gemfile.lock +1 -1
- data/lib/algolia/api/abtesting_client.rb +17 -16
- data/lib/algolia/api/analytics_client.rb +173 -333
- data/lib/algolia/api/ingestion_client.rb +40 -200
- data/lib/algolia/api/insights_client.rb +18 -32
- data/lib/algolia/api/monitoring_client.rb +33 -25
- data/lib/algolia/api/personalization_client.rb +16 -8
- data/lib/algolia/api/query_suggestions_client.rb +17 -9
- data/lib/algolia/api/recommend_client.rb +17 -9
- data/lib/algolia/api/search_client.rb +63 -110
- data/lib/algolia/configuration.rb +16 -1
- data/lib/algolia/models/abtesting/ab_test_configuration.rb +0 -2
- data/lib/algolia/models/abtesting/ab_tests_variant.rb +0 -18
- data/lib/algolia/models/abtesting/ab_tests_variant_search_params.rb +0 -18
- data/lib/algolia/models/abtesting/add_ab_tests_request.rb +0 -18
- data/lib/algolia/models/abtesting/minimum_detectable_effect.rb +0 -18
- data/lib/algolia/models/abtesting/schedule_ab_tests_request.rb +0 -18
- data/lib/algolia/models/abtesting/variant.rb +0 -20
- data/lib/algolia/models/analytics/click_position.rb +0 -32
- data/lib/algolia/models/analytics/daily_add_to_cart_rates.rb +0 -28
- data/lib/algolia/models/analytics/daily_average_clicks.rb +0 -24
- data/lib/algolia/models/analytics/daily_click_through_rates.rb +0 -28
- data/lib/algolia/models/analytics/daily_conversion_rates.rb +0 -28
- data/lib/algolia/models/analytics/daily_no_click_rates.rb +0 -32
- data/lib/algolia/models/analytics/daily_no_results_rates.rb +0 -18
- data/lib/algolia/models/analytics/daily_purchase_rates.rb +0 -14
- data/lib/algolia/models/analytics/daily_searches_no_clicks.rb +0 -14
- data/lib/algolia/models/analytics/daily_searches_no_results.rb +0 -14
- data/lib/algolia/models/analytics/get_add_to_cart_rate_response.rb +0 -28
- data/lib/algolia/models/analytics/get_average_click_position_response.rb +0 -24
- data/lib/algolia/models/analytics/get_click_positions_response.rb +0 -18
- data/lib/algolia/models/analytics/get_click_through_rate_response.rb +0 -28
- data/lib/algolia/models/analytics/get_conversion_rate_response.rb +0 -28
- data/lib/algolia/models/analytics/get_no_click_rate_response.rb +0 -32
- data/lib/algolia/models/analytics/get_no_results_rate_response.rb +0 -18
- data/lib/algolia/models/analytics/get_purchase_rate_response.rb +0 -14
- data/lib/algolia/models/analytics/top_hit_with_analytics.rb +0 -56
- data/lib/algolia/models/analytics/top_hit_with_revenue_analytics.rb +0 -98
- data/lib/algolia/models/analytics/top_search_with_analytics.rb +0 -90
- data/lib/algolia/models/analytics/top_search_with_revenue_analytics.rb +0 -132
- data/lib/algolia/models/ingestion/event.rb +1 -25
- data/lib/algolia/models/ingestion/pagination.rb +0 -60
- data/lib/algolia/models/ingestion/run.rb +0 -18
- data/lib/algolia/models/ingestion/source_csv.rb +0 -21
- data/lib/algolia/models/ingestion/task.rb +0 -18
- data/lib/algolia/models/ingestion/task_create.rb +0 -18
- data/lib/algolia/models/ingestion/task_create_v1.rb +0 -18
- data/lib/algolia/models/ingestion/task_update.rb +0 -18
- data/lib/algolia/models/ingestion/task_update_v1.rb +0 -18
- data/lib/algolia/models/ingestion/task_v1.rb +0 -18
- data/lib/algolia/models/ingestion/transformation.rb +1 -1
- data/lib/algolia/models/ingestion/transformation_create.rb +1 -1
- data/lib/algolia/models/insights/added_to_cart_object_ids.rb +0 -123
- data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +0 -149
- data/lib/algolia/models/insights/clicked_filters.rb +0 -105
- data/lib/algolia/models/insights/clicked_object_ids.rb +0 -105
- data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +0 -149
- data/lib/algolia/models/insights/converted_filters.rb +0 -105
- data/lib/algolia/models/insights/converted_object_ids.rb +0 -105
- data/lib/algolia/models/insights/converted_object_ids_after_search.rb +0 -131
- data/lib/algolia/models/insights/insights_events.rb +0 -18
- data/lib/algolia/models/insights/object_data_after_search.rb +0 -26
- data/lib/algolia/models/insights/purchased_object_ids.rb +0 -123
- data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +0 -123
- data/lib/algolia/models/insights/viewed_filters.rb +0 -105
- data/lib/algolia/models/insights/viewed_object_ids.rb +0 -105
- data/lib/algolia/models/personalization/personalization_strategy_params.rb +0 -18
- data/lib/algolia/models/query-suggestions/configuration.rb +0 -17
- data/lib/algolia/models/query-suggestions/configuration_response.rb +0 -17
- data/lib/algolia/models/query-suggestions/configuration_with_index.rb +0 -17
- data/lib/algolia/models/query-suggestions/source_index.rb +0 -28
- data/lib/algolia/models/recommend/banner_image.rb +4 -2
- data/lib/algolia/models/recommend/bought_together_query.rb +0 -36
- data/lib/algolia/models/recommend/condition.rb +0 -15
- data/lib/algolia/models/recommend/consequence.rb +0 -28
- data/lib/algolia/models/recommend/fallback_params.rb +3 -95
- data/lib/algolia/models/recommend/looking_similar_query.rb +0 -36
- data/lib/algolia/models/recommend/promote_consequence_object.rb +0 -14
- data/lib/algolia/models/recommend/ranking_info.rb +0 -112
- data/lib/algolia/models/recommend/recommend_hit.rb +0 -20
- data/lib/algolia/models/recommend/recommend_search_params.rb +3 -95
- data/lib/algolia/models/recommend/recommendations_results.rb +13 -61
- data/lib/algolia/models/recommend/recommended_for_you_query.rb +0 -36
- data/lib/algolia/models/recommend/related_query.rb +0 -36
- data/lib/algolia/models/recommend/search_recommend_rules_params.rb +2 -52
- data/lib/algolia/models/recommend/search_recommend_rules_response.rb +0 -14
- data/lib/algolia/models/recommend/trending_facet_hit.rb +0 -20
- data/lib/algolia/models/recommend/trending_facets_query.rb +0 -36
- data/lib/algolia/models/recommend/trending_items_query.rb +0 -36
- data/lib/algolia/models/recommend/widgets.rb +5 -2
- data/lib/algolia/models/search/banner_image.rb +4 -2
- data/lib/algolia/models/search/browse_params_object.rb +1 -129
- data/lib/algolia/models/search/browse_response.rb +13 -61
- data/lib/algolia/models/search/condition.rb +0 -15
- data/lib/algolia/models/search/consequence.rb +0 -28
- data/lib/algolia/models/search/consequence_params.rb +1 -129
- data/lib/algolia/models/search/get_api_key_response.rb +2 -0
- data/lib/algolia/models/search/get_objects_response.rb +0 -2
- data/lib/algolia/models/search/index_settings.rb +3 -81
- data/lib/algolia/models/search/log.rb +0 -34
- data/lib/algolia/models/search/promote_object_ids.rb +0 -14
- data/lib/algolia/models/search/ranking_info.rb +0 -112
- data/lib/algolia/models/search/rule.rb +0 -18
- data/lib/algolia/models/search/search_dictionary_entries_params.rb +0 -32
- data/lib/algolia/models/search/search_dictionary_entries_response.rb +1 -15
- data/lib/algolia/models/search/search_for_facet_values_request.rb +0 -14
- data/lib/algolia/models/search/search_for_facets.rb +1 -129
- data/lib/algolia/models/search/search_for_hits.rb +1 -129
- data/lib/algolia/models/search/search_params_object.rb +1 -129
- data/lib/algolia/models/search/search_response.rb +13 -61
- data/lib/algolia/models/search/search_rules_params.rb +2 -34
- data/lib/algolia/models/search/search_synonyms_params.rb +0 -32
- data/lib/algolia/models/search/search_user_ids_params.rb +0 -32
- data/lib/algolia/models/search/search_user_ids_response.rb +1 -33
- data/lib/algolia/models/search/settings_response.rb +3 -81
- data/lib/algolia/models/search/user_hit.rb +0 -15
- data/lib/algolia/models/search/user_id.rb +0 -15
- data/lib/algolia/models/search/widgets.rb +5 -2
- data/lib/algolia/user_agent.rb +8 -2
- data/lib/algolia/version.rb +1 -1
- metadata +2 -11
- data/lib/algolia/models/query-suggestions/base_query_suggestions_configuration_response.rb +0 -230
- data/lib/algolia/models/query-suggestions/base_query_suggestions_configuration_with_index.rb +0 -212
- data/lib/algolia/models/query-suggestions/get_config_status200_response.rb +0 -252
- data/lib/algolia/models/query-suggestions/get_log_file200_response.rb +0 -263
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration.rb +0 -276
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb +0 -316
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb +0 -295
- data/lib/algolia/models/recommend/banners.rb +0 -209
- data/lib/algolia/models/search/banners.rb +0 -209
@@ -16,7 +16,7 @@ module Algolia
|
|
16
16
|
# Page of search results to retrieve.
|
17
17
|
attr_accessor :page
|
18
18
|
|
19
|
-
# Maximum number of hits per page.
|
19
|
+
# Maximum number of hits per page. Algolia uses `page` and `hitsPerPage` to control how search results are displayed ([paginated](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/)). - `hitsPerPage`: sets the number of search results (_hits_) displayed per page. - `page`: specifies the page number of the search results you want to retrieve. Page numbering starts at 0, so the first page is `page=0`, the second is `page=1`, and so on. For example, to display 10 results per page starting from the third page, set `hitsPerPage` to 10 and `page` to 2.
|
20
20
|
attr_accessor :hits_per_page
|
21
21
|
|
22
22
|
# Date and time when the object was updated, in RFC 3339 format.
|
@@ -112,38 +112,6 @@ module Algolia
|
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
115
|
-
# Custom attribute writer method with validation
|
116
|
-
# @param [Object] page Value to be assigned
|
117
|
-
def page=(page)
|
118
|
-
if page.nil?
|
119
|
-
raise ArgumentError, "page cannot be nil"
|
120
|
-
end
|
121
|
-
|
122
|
-
if page < 0
|
123
|
-
raise ArgumentError, "invalid value for \"page\", must be greater than or equal to 0."
|
124
|
-
end
|
125
|
-
|
126
|
-
@page = page
|
127
|
-
end
|
128
|
-
|
129
|
-
# Custom attribute writer method with validation
|
130
|
-
# @param [Object] hits_per_page Value to be assigned
|
131
|
-
def hits_per_page=(hits_per_page)
|
132
|
-
if hits_per_page.nil?
|
133
|
-
raise ArgumentError, "hits_per_page cannot be nil"
|
134
|
-
end
|
135
|
-
|
136
|
-
if hits_per_page > 1000
|
137
|
-
raise ArgumentError, "invalid value for \"hits_per_page\", must be smaller than or equal to 1000."
|
138
|
-
end
|
139
|
-
|
140
|
-
if hits_per_page < 1
|
141
|
-
raise ArgumentError, "invalid value for \"hits_per_page\", must be greater than or equal to 1."
|
142
|
-
end
|
143
|
-
|
144
|
-
@hits_per_page = hits_per_page
|
145
|
-
end
|
146
|
-
|
147
115
|
# Checks equality by comparing each attribute.
|
148
116
|
# @param [Object] Object to be compared
|
149
117
|
def ==(other)
|
@@ -18,7 +18,7 @@ module Algolia
|
|
18
18
|
# Attributes that can't be retrieved at query time. This can be useful if you want to use an attribute for ranking or to [restrict access](https://www.algolia.com/doc/guides/security/api-keys/how-to/user-restricted-access-to-data/), but don't want to include it in the search results. Attribute names are case-sensitive.
|
19
19
|
attr_accessor :unretrievable_attributes
|
20
20
|
|
21
|
-
#
|
21
|
+
# Creates a list of [words which require exact matches](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#turn-off-typo-tolerance-for-certain-words). This also turns off [word splitting and concatenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation/) for the specified words.
|
22
22
|
attr_accessor :disable_typo_tolerance_on_words
|
23
23
|
|
24
24
|
# Attributes, for which you want to support [Japanese transliteration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#japanese-transliteration-and-type-ahead). Transliteration supports searching in any of the Japanese writing systems. To support transliteration, you must set the indexing language to Japanese. Attribute names are case-sensitive.
|
@@ -42,7 +42,7 @@ module Algolia
|
|
42
42
|
# Numeric attributes that can be used as [numerical filters](https://www.algolia.com/doc/guides/managing-results/rules/detecting-intent/how-to/applying-a-custom-filter-for-a-specific-query/#numerical-filters). Attribute names are case-sensitive. By default, all numeric attributes are available as numerical filters. For faster indexing, reduce the number of numeric attributes. To turn off filtering for all numeric attributes, specify an attribute that doesn't exist in your index, such as `NO_NUMERIC_FILTERING`. **Modifier** - `equalOnly(\"ATTRIBUTE\")`. Support only filtering based on equality comparisons `=` and `!=`.
|
43
43
|
attr_accessor :numeric_attributes_for_filtering
|
44
44
|
|
45
|
-
#
|
45
|
+
# Control which non-alphanumeric characters are indexed. By default, Algolia ignores [non-alphanumeric characters](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/how-to/how-to-search-in-hyphenated-attributes/#handling-non-alphanumeric-characters) like hyphen (`-`), plus (`+`), and parentheses (`(`,`)`). To include such characters, define them with `separatorsToIndex`. Separators are all non-letter characters except spaces and currency characters, such as $€£¥. With `separatorsToIndex`, Algolia treats separator characters as separate words. For example, in a search for \"Disney+\", Algolia considers \"Disney\" and \"+\" as two separate words.
|
46
46
|
attr_accessor :separators_to_index
|
47
47
|
|
48
48
|
# Attributes used for searching. Attribute names are case-sensitive. By default, all attributes are searchable and the [Attribute](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#attribute) ranking criterion is turned off. With a non-empty list, Algolia only returns results with matches in the selected attributes. In addition, the Attribute ranking criterion is turned on: matches in attributes that are higher in the list of `searchableAttributes` rank first. To make matches in two attributes rank equally, include them in a comma-separated string, such as `\"title,alternate_title\"`. Attributes with the same priority are always unordered. For more information, see [Searchable attributes](https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/how-to/setting-searchable-attributes/). **Modifier** - `unordered(\"ATTRIBUTE\")`. Ignore the position of a match within the attribute. Without a modifier, matches at the beginning of an attribute rank higher than matches at the end.
|
@@ -142,7 +142,7 @@ module Algolia
|
|
142
142
|
|
143
143
|
attr_accessor :exact_on_single_word_query
|
144
144
|
|
145
|
-
#
|
145
|
+
# Determine which plurals and synonyms should be considered an exact matches. By default, Algolia treats singular and plural forms of a word, and single-word synonyms, as [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) matches when searching. For example: - \"swimsuit\" and \"swimsuits\" are treated the same - \"swimsuit\" and \"swimwear\" are treated the same (if they are [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)). - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. Single-word synonyms, such as \"NY\" = \"NYC\", are considered exact matches. - `multiWordsSynonym`. Multi-word synonyms, such as \"NY\" = \"New York\", are considered exact matches.
|
146
146
|
attr_accessor :alternatives_as_exact
|
147
147
|
|
148
148
|
# Advanced search syntax features you want to support. - `exactPhrase`. Phrases in quotes must match exactly. For example, `sparkly blue \"iPhone case\"` only returns records with the exact string \"iPhone case\". - `excludeWords`. Query words prefixed with a `-` must not occur in a record. For example, `search -engine` matches records that contain \"search\" but not \"engine\". This setting only has an effect if `advancedSyntax` is true.
|
@@ -655,84 +655,6 @@ module Algolia
|
|
655
655
|
end
|
656
656
|
end
|
657
657
|
|
658
|
-
# Custom attribute writer method with validation
|
659
|
-
# @param [Object] pagination_limited_to Value to be assigned
|
660
|
-
def pagination_limited_to=(pagination_limited_to)
|
661
|
-
if pagination_limited_to.nil?
|
662
|
-
raise ArgumentError, "pagination_limited_to cannot be nil"
|
663
|
-
end
|
664
|
-
|
665
|
-
if pagination_limited_to > 20000
|
666
|
-
raise ArgumentError, "invalid value for \"pagination_limited_to\", must be smaller than or equal to 20000."
|
667
|
-
end
|
668
|
-
|
669
|
-
@pagination_limited_to = pagination_limited_to
|
670
|
-
end
|
671
|
-
|
672
|
-
# Custom attribute writer method with validation
|
673
|
-
# @param [Object] hits_per_page Value to be assigned
|
674
|
-
def hits_per_page=(hits_per_page)
|
675
|
-
if hits_per_page.nil?
|
676
|
-
raise ArgumentError, "hits_per_page cannot be nil"
|
677
|
-
end
|
678
|
-
|
679
|
-
if hits_per_page > 1000
|
680
|
-
raise ArgumentError, "invalid value for \"hits_per_page\", must be smaller than or equal to 1000."
|
681
|
-
end
|
682
|
-
|
683
|
-
if hits_per_page < 1
|
684
|
-
raise ArgumentError, "invalid value for \"hits_per_page\", must be greater than or equal to 1."
|
685
|
-
end
|
686
|
-
|
687
|
-
@hits_per_page = hits_per_page
|
688
|
-
end
|
689
|
-
|
690
|
-
# Custom attribute writer method with validation
|
691
|
-
# @param [Object] min_proximity Value to be assigned
|
692
|
-
def min_proximity=(min_proximity)
|
693
|
-
if min_proximity.nil?
|
694
|
-
raise ArgumentError, "min_proximity cannot be nil"
|
695
|
-
end
|
696
|
-
|
697
|
-
if min_proximity > 7
|
698
|
-
raise ArgumentError, "invalid value for \"min_proximity\", must be smaller than or equal to 7."
|
699
|
-
end
|
700
|
-
|
701
|
-
if min_proximity < 1
|
702
|
-
raise ArgumentError, "invalid value for \"min_proximity\", must be greater than or equal to 1."
|
703
|
-
end
|
704
|
-
|
705
|
-
@min_proximity = min_proximity
|
706
|
-
end
|
707
|
-
|
708
|
-
# Custom attribute writer method with validation
|
709
|
-
# @param [Object] max_facet_hits Value to be assigned
|
710
|
-
def max_facet_hits=(max_facet_hits)
|
711
|
-
if max_facet_hits.nil?
|
712
|
-
raise ArgumentError, "max_facet_hits cannot be nil"
|
713
|
-
end
|
714
|
-
|
715
|
-
if max_facet_hits > 100
|
716
|
-
raise ArgumentError, "invalid value for \"max_facet_hits\", must be smaller than or equal to 100."
|
717
|
-
end
|
718
|
-
|
719
|
-
@max_facet_hits = max_facet_hits
|
720
|
-
end
|
721
|
-
|
722
|
-
# Custom attribute writer method with validation
|
723
|
-
# @param [Object] max_values_per_facet Value to be assigned
|
724
|
-
def max_values_per_facet=(max_values_per_facet)
|
725
|
-
if max_values_per_facet.nil?
|
726
|
-
raise ArgumentError, "max_values_per_facet cannot be nil"
|
727
|
-
end
|
728
|
-
|
729
|
-
if max_values_per_facet > 1000
|
730
|
-
raise ArgumentError, "invalid value for \"max_values_per_facet\", must be smaller than or equal to 1000."
|
731
|
-
end
|
732
|
-
|
733
|
-
@max_values_per_facet = max_values_per_facet
|
734
|
-
end
|
735
|
-
|
736
658
|
# Checks equality by comparing each attribute.
|
737
659
|
# @param [Object] Object to be compared
|
738
660
|
def ==(other)
|
@@ -116,21 +116,6 @@ module Algolia
|
|
116
116
|
end
|
117
117
|
end
|
118
118
|
|
119
|
-
# Custom attribute writer method with validation
|
120
|
-
# @param [Object] user_id Value to be assigned
|
121
|
-
def user_id=(user_id)
|
122
|
-
if user_id.nil?
|
123
|
-
raise ArgumentError, "user_id cannot be nil"
|
124
|
-
end
|
125
|
-
|
126
|
-
pattern = /^[a-zA-Z0-9 \-*.]+$/
|
127
|
-
if user_id !~ pattern
|
128
|
-
raise ArgumentError, "invalid value for \"user_id\", must conform to the pattern #{pattern}."
|
129
|
-
end
|
130
|
-
|
131
|
-
@user_id = user_id
|
132
|
-
end
|
133
|
-
|
134
119
|
# Checks equality by comparing each attribute.
|
135
120
|
# @param [Object] Object to be compared
|
136
121
|
def ==(other)
|
@@ -96,21 +96,6 @@ module Algolia
|
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
99
|
-
# Custom attribute writer method with validation
|
100
|
-
# @param [Object] user_id Value to be assigned
|
101
|
-
def user_id=(user_id)
|
102
|
-
if user_id.nil?
|
103
|
-
raise ArgumentError, "user_id cannot be nil"
|
104
|
-
end
|
105
|
-
|
106
|
-
pattern = /^[a-zA-Z0-9 \-*.]+$/
|
107
|
-
if user_id !~ pattern
|
108
|
-
raise ArgumentError, "invalid value for \"user_id\", must conform to the pattern #{pattern}."
|
109
|
-
end
|
110
|
-
|
111
|
-
@user_id = user_id
|
112
|
-
end
|
113
|
-
|
114
99
|
# Checks equality by comparing each attribute.
|
115
100
|
# @param [Object] Object to be compared
|
116
101
|
def ==(other)
|
@@ -7,6 +7,7 @@ module Algolia
|
|
7
7
|
module Search
|
8
8
|
# widgets returned from any rules that are applied to the current search.
|
9
9
|
class Widgets
|
10
|
+
# banners defined in the merchandising studio for the given search.
|
10
11
|
attr_accessor :banners
|
11
12
|
|
12
13
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -24,7 +25,7 @@ module Algolia
|
|
24
25
|
# Attribute type mapping.
|
25
26
|
def self.types_mapping
|
26
27
|
{
|
27
|
-
:banners => :"
|
28
|
+
:banners => :"Array<Banner>"
|
28
29
|
}
|
29
30
|
end
|
30
31
|
|
@@ -56,7 +57,9 @@ module Algolia
|
|
56
57
|
}
|
57
58
|
|
58
59
|
if attributes.key?(:banners)
|
59
|
-
|
60
|
+
if (value = attributes[:banners]).is_a?(Array)
|
61
|
+
self.banners = value
|
62
|
+
end
|
60
63
|
end
|
61
64
|
end
|
62
65
|
|
data/lib/algolia/user_agent.rb
CHANGED
@@ -8,8 +8,14 @@ module Algolia
|
|
8
8
|
|
9
9
|
# Adds a segment to the UserAgent
|
10
10
|
#
|
11
|
-
def add(segment, version)
|
12
|
-
|
11
|
+
def add(segment, version = nil)
|
12
|
+
if version.nil?
|
13
|
+
@value += format("; %<segment>s", segment: segment)
|
14
|
+
else
|
15
|
+
@value += format("; %<segment>s (%<version>s)", segment: segment, version: version)
|
16
|
+
end
|
17
|
+
|
18
|
+
self
|
13
19
|
end
|
14
20
|
end
|
15
21
|
end
|
data/lib/algolia/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: algolia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.
|
4
|
+
version: 3.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- https://alg.li/support
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -419,8 +419,6 @@ files:
|
|
419
419
|
- lib/algolia/models/personalization/get_user_token_response.rb
|
420
420
|
- lib/algolia/models/personalization/personalization_strategy_params.rb
|
421
421
|
- lib/algolia/models/personalization/set_personalization_strategy_response.rb
|
422
|
-
- lib/algolia/models/query-suggestions/base_query_suggestions_configuration_response.rb
|
423
|
-
- lib/algolia/models/query-suggestions/base_query_suggestions_configuration_with_index.rb
|
424
422
|
- lib/algolia/models/query-suggestions/base_response.rb
|
425
423
|
- lib/algolia/models/query-suggestions/config_status.rb
|
426
424
|
- lib/algolia/models/query-suggestions/configuration.rb
|
@@ -428,14 +426,9 @@ files:
|
|
428
426
|
- lib/algolia/models/query-suggestions/configuration_with_index.rb
|
429
427
|
- lib/algolia/models/query-suggestions/error_base.rb
|
430
428
|
- lib/algolia/models/query-suggestions/facet.rb
|
431
|
-
- lib/algolia/models/query-suggestions/get_config_status200_response.rb
|
432
|
-
- lib/algolia/models/query-suggestions/get_log_file200_response.rb
|
433
429
|
- lib/algolia/models/query-suggestions/languages.rb
|
434
430
|
- lib/algolia/models/query-suggestions/log_file.rb
|
435
431
|
- lib/algolia/models/query-suggestions/log_level.rb
|
436
|
-
- lib/algolia/models/query-suggestions/query_suggestions_configuration.rb
|
437
|
-
- lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb
|
438
|
-
- lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb
|
439
432
|
- lib/algolia/models/query-suggestions/source_index.rb
|
440
433
|
- lib/algolia/models/recommend/advanced_syntax_features.rb
|
441
434
|
- lib/algolia/models/recommend/alternatives_as_exact.rb
|
@@ -447,7 +440,6 @@ files:
|
|
447
440
|
- lib/algolia/models/recommend/banner_image.rb
|
448
441
|
- lib/algolia/models/recommend/banner_image_url.rb
|
449
442
|
- lib/algolia/models/recommend/banner_link.rb
|
450
|
-
- lib/algolia/models/recommend/banners.rb
|
451
443
|
- lib/algolia/models/recommend/boolean_string.rb
|
452
444
|
- lib/algolia/models/recommend/bought_together_query.rb
|
453
445
|
- lib/algolia/models/recommend/condition.rb
|
@@ -540,7 +532,6 @@ files:
|
|
540
532
|
- lib/algolia/models/search/banner_image.rb
|
541
533
|
- lib/algolia/models/search/banner_image_url.rb
|
542
534
|
- lib/algolia/models/search/banner_link.rb
|
543
|
-
- lib/algolia/models/search/banners.rb
|
544
535
|
- lib/algolia/models/search/batch_assign_user_ids_params.rb
|
545
536
|
- lib/algolia/models/search/batch_dictionary_entries_params.rb
|
546
537
|
- lib/algolia/models/search/batch_dictionary_entries_request.rb
|
@@ -1,230 +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
|
-
class BaseQuerySuggestionsConfigurationResponse
|
9
|
-
# API key used to read from your source index.
|
10
|
-
attr_accessor :source_indices_api_key
|
11
|
-
|
12
|
-
# API key used to write and configure your Query Suggestions index.
|
13
|
-
attr_accessor :suggestions_indices_api_key
|
14
|
-
|
15
|
-
# API key used to read from external Algolia indices.
|
16
|
-
attr_accessor :external_indices_api_key
|
17
|
-
|
18
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
19
|
-
def self.attribute_map
|
20
|
-
{
|
21
|
-
:source_indices_api_key => :sourceIndicesAPIKey,
|
22
|
-
:suggestions_indices_api_key => :suggestionsIndicesAPIKey,
|
23
|
-
:external_indices_api_key => :externalIndicesAPIKey
|
24
|
-
}
|
25
|
-
end
|
26
|
-
|
27
|
-
# Returns all the JSON keys this model knows about
|
28
|
-
def self.acceptable_attributes
|
29
|
-
attribute_map.values
|
30
|
-
end
|
31
|
-
|
32
|
-
# Attribute type mapping.
|
33
|
-
def self.types_mapping
|
34
|
-
{
|
35
|
-
:source_indices_api_key => :String,
|
36
|
-
:suggestions_indices_api_key => :String,
|
37
|
-
:external_indices_api_key => :String
|
38
|
-
}
|
39
|
-
end
|
40
|
-
|
41
|
-
# List of attributes with nullable: true
|
42
|
-
def self.openapi_nullable
|
43
|
-
Set.new([])
|
44
|
-
end
|
45
|
-
|
46
|
-
# Initializes the object
|
47
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
-
def initialize(attributes = {})
|
49
|
-
unless attributes.is_a?(Hash)
|
50
|
-
raise(
|
51
|
-
ArgumentError,
|
52
|
-
"The input argument (attributes) must be a hash in `Algolia::BaseQuerySuggestionsConfigurationResponse` initialize method"
|
53
|
-
)
|
54
|
-
end
|
55
|
-
|
56
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
57
|
-
attributes = attributes.each_with_object({}) do |(k, v), h|
|
58
|
-
unless self.class.attribute_map.key?(k.to_sym)
|
59
|
-
raise(
|
60
|
-
ArgumentError,
|
61
|
-
"`#{k}` is not a valid attribute in `Algolia::BaseQuerySuggestionsConfigurationResponse`. Please check the name to make sure it's valid. List of attributes: " +
|
62
|
-
self.class.attribute_map.keys.inspect
|
63
|
-
)
|
64
|
-
end
|
65
|
-
|
66
|
-
h[k.to_sym] = v
|
67
|
-
end
|
68
|
-
|
69
|
-
if attributes.key?(:source_indices_api_key)
|
70
|
-
self.source_indices_api_key = attributes[:source_indices_api_key]
|
71
|
-
end
|
72
|
-
|
73
|
-
if attributes.key?(:suggestions_indices_api_key)
|
74
|
-
self.suggestions_indices_api_key = attributes[:suggestions_indices_api_key]
|
75
|
-
end
|
76
|
-
|
77
|
-
if attributes.key?(:external_indices_api_key)
|
78
|
-
self.external_indices_api_key = attributes[:external_indices_api_key]
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
# Checks equality by comparing each attribute.
|
83
|
-
# @param [Object] Object to be compared
|
84
|
-
def ==(other)
|
85
|
-
return true if equal?(other)
|
86
|
-
|
87
|
-
self.class == other.class &&
|
88
|
-
source_indices_api_key == other.source_indices_api_key &&
|
89
|
-
suggestions_indices_api_key == other.suggestions_indices_api_key &&
|
90
|
-
external_indices_api_key == other.external_indices_api_key
|
91
|
-
end
|
92
|
-
|
93
|
-
# @see the `==` method
|
94
|
-
# @param [Object] Object to be compared
|
95
|
-
def eql?(other)
|
96
|
-
self == other
|
97
|
-
end
|
98
|
-
|
99
|
-
# Calculates hash code according to all attributes.
|
100
|
-
# @return [Integer] Hash code
|
101
|
-
def hash
|
102
|
-
[source_indices_api_key, suggestions_indices_api_key, external_indices_api_key].hash
|
103
|
-
end
|
104
|
-
|
105
|
-
# Builds the object from hash
|
106
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
-
# @return [Object] Returns the model itself
|
108
|
-
def self.build_from_hash(attributes)
|
109
|
-
return nil unless attributes.is_a?(Hash)
|
110
|
-
|
111
|
-
attributes = attributes.transform_keys(&:to_sym)
|
112
|
-
transformed_hash = {}
|
113
|
-
types_mapping.each_pair do |key, type|
|
114
|
-
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
115
|
-
transformed_hash[key.to_sym] = nil
|
116
|
-
elsif type =~ /\AArray<(.*)>/i
|
117
|
-
# check to ensure the input is an array given that the attribute
|
118
|
-
# is documented as an array but the input is not
|
119
|
-
if attributes[attribute_map[key]].is_a?(Array)
|
120
|
-
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
|
121
|
-
_deserialize(::Regexp.last_match(1), v)
|
122
|
-
}
|
123
|
-
end
|
124
|
-
elsif !attributes[attribute_map[key]].nil?
|
125
|
-
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
126
|
-
end
|
127
|
-
end
|
128
|
-
|
129
|
-
new(transformed_hash)
|
130
|
-
end
|
131
|
-
|
132
|
-
# Deserializes the data based on type
|
133
|
-
# @param string type Data type
|
134
|
-
# @param string value Value to be deserialized
|
135
|
-
# @return [Object] Deserialized data
|
136
|
-
def self._deserialize(type, value)
|
137
|
-
case type.to_sym
|
138
|
-
when :Time
|
139
|
-
Time.parse(value)
|
140
|
-
when :Date
|
141
|
-
Date.parse(value)
|
142
|
-
when :String
|
143
|
-
value.to_s
|
144
|
-
when :Integer
|
145
|
-
value.to_i
|
146
|
-
when :Float
|
147
|
-
value.to_f
|
148
|
-
when :Boolean
|
149
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
150
|
-
true
|
151
|
-
else
|
152
|
-
false
|
153
|
-
end
|
154
|
-
|
155
|
-
when :Object
|
156
|
-
# generic object (usually a Hash), return directly
|
157
|
-
value
|
158
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
159
|
-
inner_type = Regexp.last_match[:inner_type]
|
160
|
-
value.map { |v| _deserialize(inner_type, v) }
|
161
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
162
|
-
k_type = Regexp.last_match[:k_type]
|
163
|
-
v_type = Regexp.last_match[:v_type]
|
164
|
-
{}.tap do |hash|
|
165
|
-
value.each do |k, v|
|
166
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
167
|
-
end
|
168
|
-
end
|
169
|
-
# model
|
170
|
-
else
|
171
|
-
# models (e.g. Pet) or oneOf
|
172
|
-
klass = Algolia::QuerySuggestions.const_get(type)
|
173
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
|
174
|
-
.build_from_hash(value)
|
175
|
-
end
|
176
|
-
end
|
177
|
-
|
178
|
-
# Returns the string representation of the object
|
179
|
-
# @return [String] String presentation of the object
|
180
|
-
def to_s
|
181
|
-
to_hash.to_s
|
182
|
-
end
|
183
|
-
|
184
|
-
# to_body is an alias to to_hash (backward compatibility)
|
185
|
-
# @return [Hash] Returns the object in the form of hash
|
186
|
-
def to_body
|
187
|
-
to_hash
|
188
|
-
end
|
189
|
-
|
190
|
-
def to_json(*_args)
|
191
|
-
to_hash.to_json
|
192
|
-
end
|
193
|
-
|
194
|
-
# Returns the object in the form of hash
|
195
|
-
# @return [Hash] Returns the object in the form of hash
|
196
|
-
def to_hash
|
197
|
-
hash = {}
|
198
|
-
self.class.attribute_map.each_pair do |attr, param|
|
199
|
-
value = send(attr)
|
200
|
-
if value.nil?
|
201
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
202
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
203
|
-
end
|
204
|
-
|
205
|
-
hash[param] = _to_hash(value)
|
206
|
-
end
|
207
|
-
|
208
|
-
hash
|
209
|
-
end
|
210
|
-
|
211
|
-
# Outputs non-array value in the form of hash
|
212
|
-
# For object, use to_hash. Otherwise, just return the value
|
213
|
-
# @param [Object] value Any valid value
|
214
|
-
# @return [Hash] Returns the value in the form of hash
|
215
|
-
def _to_hash(value)
|
216
|
-
if value.is_a?(Array)
|
217
|
-
value.compact.map { |v| _to_hash(v) }
|
218
|
-
elsif value.is_a?(Hash)
|
219
|
-
{}.tap do |hash|
|
220
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
221
|
-
end
|
222
|
-
elsif value.respond_to?(:to_hash)
|
223
|
-
value.to_hash
|
224
|
-
else
|
225
|
-
value
|
226
|
-
end
|
227
|
-
end
|
228
|
-
end
|
229
|
-
end
|
230
|
-
end
|