algolia 3.45.0 → 3.46.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +2 -2
- data/AGENTS.md +0 -24
- data/CHANGELOG.md +30 -0
- data/Gemfile.lock +1 -1
- data/lib/algolia/api/abtesting_v3_client.rb +196 -7
- data/lib/algolia/api/agent_studio_client.rb +244 -6
- data/lib/algolia/api/recommend_client.rb +2 -2
- data/lib/algolia/api/search_client.rb +17 -3
- data/lib/algolia/configuration.rb +8 -0
- data/lib/algolia/defaults.rb +8 -0
- data/lib/algolia/models/abtesting-v3/ab_test.rb +25 -1
- data/lib/algolia/models/abtesting-v3/ab_test_configuration.rb +22 -4
- data/lib/algolia/models/abtesting-v3/ab_test_settings_response.rb +224 -0
- data/lib/algolia/models/abtesting-v3/add_ab_tests_request.rb +11 -1
- data/lib/algolia/models/abtesting-v3/analysis_method.rb +34 -0
- data/lib/algolia/models/abtesting-v3/bayesian_metric_result.rb +237 -0
- data/lib/algolia/models/abtesting-v3/evidence_status.rb +37 -0
- data/lib/algolia/models/abtesting-v3/feature_settings.rb +224 -0
- data/lib/algolia/models/abtesting-v3/metric_evidence.rb +209 -0
- data/lib/algolia/models/abtesting-v3/metric_metadata.rb +1 -1
- data/lib/algolia/models/abtesting-v3/metric_name.rb +7 -1
- data/lib/algolia/models/abtesting-v3/metric_result.rb +18 -8
- data/lib/algolia/models/abtesting-v3/minimum_detectable_effect.rb +1 -1
- data/lib/algolia/models/abtesting-v3/primary_metric.rb +37 -0
- data/lib/algolia/models/abtesting-v3/save_settings_request.rb +208 -0
- data/lib/algolia/models/abtesting-v3/variant_settings.rb +293 -0
- data/lib/algolia/models/agent-studio/agent_completion_algolia_params.rb +16 -4
- data/lib/algolia/models/agent-studio/agent_completion_request.rb +1 -3
- data/lib/algolia/models/agent-studio/agent_completion_request_union.rb +108 -0
- data/lib/algolia/models/agent-studio/agent_test_configuration.rb +1 -1
- data/lib/algolia/models/agent-studio/agent_with_version_response.rb +1 -1
- data/lib/algolia/models/agent-studio/agui_completion_request.rb +265 -0
- data/lib/algolia/models/agent-studio/agui_resume.rb +231 -0
- data/lib/algolia/models/agent-studio/algolia_grouped_results_compat_tool_config.rb +268 -0
- data/lib/algolia/models/agent-studio/{algolia_display_results_tool_config.rb → algolia_grouped_results_tool_config.rb} +30 -16
- data/lib/algolia/models/agent-studio/{algolia_recommend_tool_config_input.rb → algolia_recommend_tool_config.rb} +3 -3
- data/lib/algolia/models/agent-studio/algolia_search_tool_config.rb +22 -4
- data/lib/algolia/models/agent-studio/assistant_message_agui.rb +280 -0
- data/lib/algolia/models/agent-studio/assistant_message_v4.rb +1 -0
- data/lib/algolia/models/agent-studio/assistant_message_v5.rb +3 -1
- data/lib/algolia/models/agent-studio/assistant_part_v5.rb +2 -0
- data/lib/algolia/models/agent-studio/azure_open_ai_provider_input.rb +1 -1
- data/lib/algolia/models/agent-studio/boolean_param.rb +220 -0
- data/lib/algolia/models/agent-studio/client_side_tool_config.rb +14 -4
- data/lib/algolia/models/agent-studio/compaction_stats.rb +271 -0
- data/lib/algolia/models/agent-studio/compatibility_mode.rb +2 -1
- data/lib/algolia/models/agent-studio/context_compact_request.rb +263 -0
- data/lib/algolia/models/agent-studio/context_response.rb +231 -0
- data/lib/algolia/models/agent-studio/context_stats.rb +258 -0
- data/lib/algolia/models/agent-studio/context_trim_request.rb +239 -0
- data/lib/algolia/models/agent-studio/conversation_base_response.rb +16 -5
- data/lib/algolia/models/agent-studio/conversation_full_response.rb +26 -5
- data/lib/algolia/models/agent-studio/data_guardrail_violation_part_v5.rb +218 -0
- data/lib/algolia/models/agent-studio/data_part_v5.rb +220 -0
- data/lib/algolia/models/agent-studio/facet_filters_union_search_parameters_overrides.rb +108 -0
- data/lib/algolia/models/agent-studio/feedback_update_request.rb +253 -0
- data/lib/algolia/models/agent-studio/forwarded_props.rb +226 -0
- data/lib/algolia/models/agent-studio/function_call_agui.rb +219 -0
- data/lib/algolia/models/agent-studio/guardrail_outcome.rb +231 -0
- data/lib/algolia/models/agent-studio/guardrail_violation_data_v5.rb +230 -0
- data/lib/algolia/models/agent-studio/impact_analytics.rb +242 -0
- data/lib/algolia/models/agent-studio/index_search_parameters.rb +11 -1
- data/lib/algolia/models/agent-studio/input_union.rb +113 -0
- data/lib/algolia/models/agent-studio/items_union.rb +132 -0
- data/lib/algolia/models/agent-studio/items_union_agui_completion_request.rb +123 -0
- data/lib/algolia/models/agent-studio/managed_provider_response_input.rb +209 -0
- data/lib/algolia/models/agent-studio/mcp_server_tool_config.rb +1 -1
- data/lib/algolia/models/agent-studio/memory_record.rb +4 -4
- data/lib/algolia/models/agent-studio/message_event.rb +231 -0
- data/lib/algolia/models/agent-studio/message_part_assistant_message_agui.rb +123 -0
- data/lib/algolia/models/agent-studio/message_response.rb +87 -5
- data/lib/algolia/models/agent-studio/mode_enum.rb +34 -0
- data/lib/algolia/models/agent-studio/one_of_enum.rb +34 -0
- data/lib/algolia/models/agent-studio/open_ai_compatible_provider_input.rb +1 -1
- data/lib/algolia/models/agent-studio/paginated_conversations_response.rb +13 -4
- data/lib/algolia/models/agent-studio/provider_authentication_response.rb +14 -5
- data/lib/algolia/models/agent-studio/provider_input.rb +2 -1
- data/lib/algolia/models/agent-studio/provider_input_nullable.rb +2 -1
- data/lib/algolia/models/agent-studio/provider_name.rb +2 -1
- data/lib/algolia/models/agent-studio/reasoning_message_agui.rb +239 -0
- data/lib/algolia/models/agent-studio/reasoning_part_agui.rb +228 -0
- data/lib/algolia/models/agent-studio/search_parameters.rb +1 -1
- data/lib/algolia/models/agent-studio/search_parameters_overrides.rb +80 -5
- data/lib/algolia/models/agent-studio/status_enum.rb +34 -0
- data/lib/algolia/models/agent-studio/task_kind.rb +33 -0
- data/lib/algolia/models/agent-studio/task_request.rb +240 -0
- data/lib/algolia/models/agent-studio/task_response.rb +211 -0
- data/lib/algolia/models/agent-studio/text_part_agui.rb +219 -0
- data/lib/algolia/models/agent-studio/tool_approval_agui.rb +228 -0
- data/lib/algolia/models/agent-studio/tool_approval_request_part.rb +15 -5
- data/lib/algolia/models/agent-studio/tool_call_agui.rb +237 -0
- data/lib/algolia/models/agent-studio/tool_call_part.rb +13 -1
- data/lib/algolia/models/agent-studio/tool_call_part_agui.rb +272 -0
- data/lib/algolia/models/agent-studio/tool_call_result_part_agui.rb +250 -0
- data/lib/algolia/models/agent-studio/tool_config_input.rb +2 -5
- data/lib/algolia/models/agent-studio/{tool_config.rb → tool_config_or_boolean_union.rb} +1 -1
- data/lib/algolia/models/agent-studio/tool_config_output.rb +126 -0
- data/lib/algolia/models/agent-studio/tool_invocation_v4.rb +10 -2
- data/lib/algolia/models/agent-studio/tool_message_agui.rb +259 -0
- data/lib/algolia/models/agent-studio/tool_part_v5.rb +47 -2
- data/lib/algolia/models/agent-studio/tool_result_part.rb +57 -5
- data/lib/algolia/models/agent-studio/unknown_tool_config.rb +1 -1
- data/lib/algolia/models/agent-studio/user_message_agui.rb +261 -0
- data/lib/algolia/models/agent-studio/user_message_metadata_agui.rb +208 -0
- data/lib/algolia/models/agent-studio/user_message_metadata_v5.rb +4 -2
- data/lib/algolia/models/agent-studio/user_message_v4.rb +4 -1
- data/lib/algolia/models/agent-studio/user_message_v5.rb +4 -1
- data/lib/algolia/models/agent-studio/validation_error.rb +5 -25
- data/lib/algolia/models/agent-studio/xai_provider_input.rb +220 -0
- data/lib/algolia/models/analytics/catalog_entry.rb +1 -1
- data/lib/algolia/models/composition/base_injection_query_parameters.rb +18 -18
- data/lib/algolia/models/composition/distinct.rb +1 -1
- data/lib/algolia/models/composition/external_provider.rb +209 -0
- data/lib/algolia/models/composition/external_provider_ordering.rb +34 -0
- data/lib/algolia/models/composition/hit_metadata.rb +2 -2
- data/lib/algolia/models/composition/injected_item_external.rb +21 -14
- data/lib/algolia/models/composition/injected_item_external_provider.rb +258 -0
- data/lib/algolia/models/composition/injected_item_external_provider_source.rb +216 -0
- data/lib/algolia/models/composition/injected_item_hits_metadata.rb +1 -1
- data/lib/algolia/models/composition/{recommend.rb → injected_item_recommend.rb} +10 -3
- data/lib/algolia/models/composition/injected_item_recommend_source.rb +1 -1
- data/lib/algolia/models/composition/injected_item_search.rb +8 -1
- data/lib/algolia/models/composition/injected_item_source.rb +1 -0
- data/lib/algolia/models/composition/injection_main_external_provider.rb +258 -0
- data/lib/algolia/models/composition/injection_main_external_provider_source.rb +216 -0
- data/lib/algolia/models/composition/{main_recommend.rb → injection_main_recommend.rb} +10 -3
- data/lib/algolia/models/composition/injection_main_recommend_source.rb +1 -1
- data/lib/algolia/models/composition/{main_search.rb → injection_main_search.rb} +11 -4
- data/lib/algolia/models/composition/injection_main_search_source.rb +1 -1
- data/lib/algolia/models/composition/injection_main_source.rb +1 -0
- data/lib/algolia/models/composition/main_injection_query_parameters.rb +22 -22
- data/lib/algolia/models/composition/optional_words.rb +1 -1
- data/lib/algolia/models/composition/params.rb +6 -6
- data/lib/algolia/models/composition/processing_error.rb +209 -0
- data/lib/algolia/models/composition/request_body.rb +13 -4
- data/lib/algolia/models/composition/result_card.rb +208 -0
- data/lib/algolia/models/composition/search_response.rb +16 -4
- data/lib/algolia/models/composition/widgets.rb +13 -4
- data/lib/algolia/models/ingestion/source_update_commercetools.rb +11 -0
- data/lib/algolia/models/recommend/distinct.rb +1 -1
- data/lib/algolia/models/recommend/fallback_params.rb +26 -26
- data/lib/algolia/models/recommend/optional_words.rb +1 -1
- data/lib/algolia/models/recommend/recommend_search_params.rb +26 -26
- data/lib/algolia/models/recommend/result_card.rb +208 -0
- data/lib/algolia/models/recommend/widgets.rb +13 -4
- data/lib/algolia/models/search/api_key.rb +2 -2
- data/lib/algolia/models/search/attribute_criteria_computed_by.rb +35 -0
- data/lib/algolia/models/search/browse_params_object.rb +35 -25
- data/lib/algolia/models/search/consequence_params.rb +35 -25
- data/lib/algolia/models/search/distinct.rb +1 -1
- data/lib/algolia/models/search/get_api_key_response.rb +2 -2
- data/lib/algolia/models/search/index_settings.rb +28 -18
- data/lib/algolia/models/search/optional_words.rb +1 -1
- data/lib/algolia/models/search/result_card.rb +208 -0
- data/lib/algolia/models/search/search_for_facets.rb +35 -25
- data/lib/algolia/models/search/search_for_hits.rb +35 -25
- data/lib/algolia/models/search/search_params_object.rb +35 -25
- data/lib/algolia/models/search/secured_api_key_restrictions.rb +1 -1
- data/lib/algolia/models/search/settings_response.rb +28 -18
- data/lib/algolia/models/search/widgets.rb +13 -4
- data/lib/algolia/transport/transport.rb +82 -10
- data/lib/algolia/version.rb +1 -1
- metadata +72 -8
|
@@ -8,37 +8,37 @@ require "time"
|
|
|
8
8
|
module Algolia
|
|
9
9
|
module Composition
|
|
10
10
|
class MainInjectionQueryParameters
|
|
11
|
-
# Whether to support phrase matching and excluding words from search queries Use the `advancedSyntaxFeatures` parameter to control which feature is supported.
|
|
11
|
+
# Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` parameter to control which feature is supported.
|
|
12
12
|
attr_accessor :advanced_syntax
|
|
13
13
|
|
|
14
|
-
# 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.
|
|
14
|
+
# 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.
|
|
15
15
|
attr_accessor :advanced_syntax_features
|
|
16
16
|
|
|
17
|
-
# Whether to allow typos on numbers in the search query Turn off this setting to reduce the number of irrelevant matches when searching in large sets of similar numbers.
|
|
17
|
+
# Whether to allow typos on numbers in the search query. Turn off this setting to reduce the number of irrelevant matches when searching in large sets of similar numbers.
|
|
18
18
|
attr_accessor :allow_typos_on_numeric_tokens
|
|
19
19
|
|
|
20
|
-
# 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.
|
|
20
|
+
# 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.
|
|
21
21
|
attr_accessor :alternatives_as_exact
|
|
22
22
|
|
|
23
|
-
# Whether the best matching attribute should be determined by minimum proximity This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting.
|
|
23
|
+
# Whether the best matching attribute should be determined by minimum proximity. This setting only affects ranking if the Attribute ranking criterion comes before Proximity in the `ranking` setting. If true, the best matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching attribute is determined by the order in the `searchableAttributes` setting. Prefer `attributeCriteriaComputedBy`, which expresses the same two behaviors and adds the `sum` strategy. If you set both, `attributeCriteriaComputedBy` takes precedence.
|
|
24
24
|
attr_accessor :attribute_criteria_computed_by_min_proximity
|
|
25
25
|
|
|
26
|
-
# Attributes to highlight By default, all searchable attributes are highlighted. Use `*` to highlight all attributes or use an empty array `[]` to turn off highlighting. Attribute names are case-sensitive With highlighting, strings that match the search query are surrounded by HTML tags defined by `highlightPreTag` and `highlightPostTag`. You can use this to visually highlight matching parts of a search query in your UI For more information, see [Highlighting and snippeting](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/highlighting-snippeting/js).
|
|
26
|
+
# Attributes to highlight. By default, all searchable attributes are highlighted. Use `*` to highlight all attributes or use an empty array `[]` to turn off highlighting. Attribute names are case-sensitive With highlighting, strings that match the search query are surrounded by HTML tags defined by `highlightPreTag` and `highlightPostTag`. You can use this to visually highlight matching parts of a search query in your UI For more information, see [Highlighting and snippeting](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/highlighting-snippeting/js).
|
|
27
27
|
attr_accessor :attributes_to_highlight
|
|
28
28
|
|
|
29
|
-
# Attributes to include in the API response To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included.
|
|
29
|
+
# Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. Attribute names are case-sensitive - `*` retrieves all attributes, except attributes included in the `customRanking` and `unretrievableAttributes` settings. - To retrieve all attributes except a specific one, prefix the attribute with a dash and combine it with the `*`: `[\"*\", \"-ATTRIBUTE\"]`. - The `objectID` attribute is always included.
|
|
30
30
|
attr_accessor :attributes_to_retrieve
|
|
31
31
|
|
|
32
32
|
# Attributes for which to enable snippets. Attribute names are case-sensitive Snippets provide additional context to matched words. If you enable snippets, they include 10 words, including the matched word. The matched word will also be wrapped by HTML tags for highlighting. You can adjust the number of words with the following notation: `ATTRIBUTE:NUMBER`, where `NUMBER` is the number of words to be extracted.
|
|
33
33
|
attr_accessor :attributes_to_snippet
|
|
34
34
|
|
|
35
|
-
# Whether to include a `queryID` attribute in the response The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/doc/guides/sending-events/getting-started).
|
|
35
|
+
# Whether to include a `queryID` attribute in the response. The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/doc/guides/sending-events/getting-started).
|
|
36
36
|
attr_accessor :click_analytics
|
|
37
37
|
|
|
38
38
|
# Searchable attributes for which you want to [turn off the Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). Attribute names are case-sensitive This can be useful for attributes with long values, where the likelihood of an exact match is high, such as product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on other attributes. This reduces the impact of individual attributes with a lot of content on ranking.
|
|
39
39
|
attr_accessor :disable_exact_on_attributes
|
|
40
40
|
|
|
41
|
-
# Attributes for which you want to turn off [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance). Attribute names are case-sensitive Returning only exact matches can help when - [Searching in hyphenated attributes](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/how-to/how-to-search-in-hyphenated-attributes). - Reducing the number of matches when you have too many. This can happen with attributes that are long blocks of text, such as product descriptions Consider alternatives such as `disableTypoToleranceOnWords` or adding synonyms if your attributes have intentional unusual spellings that might look like typos.
|
|
41
|
+
# Attributes for which you want to turn off [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance). Attribute names are case-sensitive Returning only exact matches can help when - [Searching in hyphenated attributes](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/how-to/how-to-search-in-hyphenated-attributes). - Reducing the number of matches when you have too many. This can happen with attributes that are long blocks of text, such as product descriptions. Consider alternatives such as `disableTypoToleranceOnWords` or adding synonyms if your attributes have intentional unusual spellings that might look like typos.
|
|
42
42
|
attr_accessor :disable_typo_tolerance_on_attributes
|
|
43
43
|
|
|
44
44
|
attr_accessor :distinct
|
|
@@ -49,7 +49,7 @@ module Algolia
|
|
|
49
49
|
# Whether to enable Personalization.
|
|
50
50
|
attr_accessor :enable_personalization
|
|
51
51
|
|
|
52
|
-
# Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking) This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard.
|
|
52
|
+
# Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking). This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard.
|
|
53
53
|
attr_accessor :enable_re_ranking
|
|
54
54
|
|
|
55
55
|
# Whether to enable rules.
|
|
@@ -73,16 +73,16 @@ module Algolia
|
|
|
73
73
|
|
|
74
74
|
attr_accessor :ignore_plurals
|
|
75
75
|
|
|
76
|
-
# Minimum proximity score for two matching words This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score.
|
|
76
|
+
# Minimum proximity score for two matching words. This adjusts the [Proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity) by equally scoring matches that are farther apart For example, if `minProximity` is 2, neighboring matches and matches with one word between them would have the same score.
|
|
77
77
|
attr_accessor :min_proximity
|
|
78
78
|
|
|
79
|
-
# Minimum number of characters a word in the search query must contain to accept matches with [one typo](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#
|
|
79
|
+
# Minimum number of characters a word in the search query must contain to accept matches with [one typo](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configure-word-size-threshold-for-typos).
|
|
80
80
|
attr_accessor :min_word_sizefor1_typo
|
|
81
81
|
|
|
82
|
-
# Minimum number of characters a word in the search query must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#
|
|
82
|
+
# Minimum number of characters a word in the search query must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configure-word-size-threshold-for-typos).
|
|
83
83
|
attr_accessor :min_word_sizefor2_typos
|
|
84
84
|
|
|
85
|
-
# 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`.
|
|
85
|
+
# 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`.
|
|
86
86
|
attr_accessor :natural_languages
|
|
87
87
|
|
|
88
88
|
attr_accessor :numeric_filters
|
|
@@ -94,7 +94,7 @@ module Algolia
|
|
|
94
94
|
# Whether to include this search when calculating processing-time percentiles.
|
|
95
95
|
attr_accessor :percentile_computation
|
|
96
96
|
|
|
97
|
-
# Impact that Personalization should have on this search The higher this value is, the more Personalization determines the ranking compared to other factors. For more information, see [Understanding Personalization impact](https://www.algolia.com/doc/guides/personalization/personalizing-results/in-depth/configuring-personalization/#understanding-personalization-impact).
|
|
97
|
+
# Impact that Personalization should have on this search. The higher this value is, the more Personalization determines the ranking compared to other factors. For more information, see [Understanding Personalization impact](https://www.algolia.com/doc/guides/personalization/personalizing-results/in-depth/configuring-personalization/#understanding-personalization-impact).
|
|
98
98
|
attr_accessor :personalization_impact
|
|
99
99
|
|
|
100
100
|
# Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings. This setting also sets a dictionary for word detection in the logogram-based [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) languages. To support this, place the CJK language **first**. **Always specify a query language.** If you don't specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations).
|
|
@@ -106,10 +106,10 @@ module Algolia
|
|
|
106
106
|
|
|
107
107
|
attr_accessor :remove_words_if_no_results
|
|
108
108
|
|
|
109
|
-
# Whether to replace a highlighted word with the matched synonym By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response.
|
|
109
|
+
# Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are highlighted With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, but all occurrences of \"house\" are replaced by \"home\" in the highlighted response.
|
|
110
110
|
attr_accessor :replace_synonyms_in_highlight
|
|
111
111
|
|
|
112
|
-
# Properties to include in the API response of search and browse requests By default, all response properties are included. To reduce the response size, you can select which properties should be included An empty list may lead to an empty API response (except properties you can't exclude) You can't exclude these properties: `message`, `warning`, `cursor`, `abTestVariantID`, or any property added by setting `getRankingInfo` to true Your search depends on the `hits` field. If you omit this field, searches won't return any results. Your UI might also depend on other properties, for example, for pagination. Before restricting the response size, check the impact on your search experience.
|
|
112
|
+
# Properties to include in the API response of search and browse requests. By default, all response properties are included. To reduce the response size, you can select which properties should be included An empty list may lead to an empty API response (except properties you can't exclude) You can't exclude these properties: `message`, `warning`, `cursor`, `abTestVariantID`, or any property added by setting `getRankingInfo` to true Your search depends on the `hits` field. If you omit this field, searches won't return any results. Your UI might also depend on other properties, for example, for pagination. Before restricting the response size, check the impact on your search experience.
|
|
113
113
|
attr_accessor :response_fields
|
|
114
114
|
|
|
115
115
|
# Whether to restrict highlighting and snippeting to items that at least partially matched the search query. By default, all items are highlighted and snippeted.
|
|
@@ -118,7 +118,7 @@ module Algolia
|
|
|
118
118
|
# Restricts a search to a subset of your searchable attributes. Attribute names are case-sensitive.
|
|
119
119
|
attr_accessor :restrict_searchable_attributes
|
|
120
120
|
|
|
121
|
-
# Assigns a rule context to the search query [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#
|
|
121
|
+
# Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#assign-context) are strings that you can use to trigger matching rules.
|
|
122
122
|
attr_accessor :rule_contexts
|
|
123
123
|
|
|
124
124
|
# String used as an ellipsis indicator when a snippet is truncated.
|
|
@@ -129,10 +129,10 @@ module Algolia
|
|
|
129
129
|
|
|
130
130
|
attr_accessor :typo_tolerance
|
|
131
131
|
|
|
132
|
-
# Whether faceting should be applied after deduplication with `distinct
|
|
132
|
+
# Whether faceting should be applied after deduplication with `distinct`. This leads to accurate facet counts when using faceting in combination with `distinct`. It's usually better to use `afterDistinct` modifiers in the `attributesForFaceting` setting, as `facetingAfterDistinct` only computes correct facet counts if all records have the same facet values for the `attributeForDistinct`.
|
|
133
133
|
attr_accessor :faceting_after_distinct
|
|
134
134
|
|
|
135
|
-
# 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 `*`. To retrieve disjunctive facets lists, annotate any facets with the `disjunctive` modifier. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts) and [disjunctive faceting for Smart Groups](https://www.algolia.com/doc/guides/managing-results/compositions/search-based-groups#facets-including-disjunctive-faceting).
|
|
135
|
+
# 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 `*`. To retrieve disjunctive facets lists, annotate any facets with the `disjunctive` modifier. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts) and [disjunctive faceting for Smart Groups](https://www.algolia.com/doc/guides/managing-results/compositions/search-based-groups#facets-including-disjunctive-faceting).
|
|
136
136
|
attr_accessor :facets
|
|
137
137
|
|
|
138
138
|
# Number of hits per page.
|
|
@@ -143,10 +143,10 @@ module Algolia
|
|
|
143
143
|
|
|
144
144
|
attr_accessor :rendering_content
|
|
145
145
|
|
|
146
|
-
# Order in which to retrieve facet values - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value - `alpha`. Retrieve facet values alphabetically This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js).
|
|
146
|
+
# Order in which to retrieve facet values. - `count`. Facet values are retrieved by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Retrieve facet values alphabetically. This setting doesn't influence how facet values are displayed in your UI (see `renderingContent`). For more information, see [facet value display](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/facet-display/js).
|
|
147
147
|
attr_accessor :sort_facet_values_by
|
|
148
148
|
|
|
149
|
-
# 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/#
|
|
149
|
+
# 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/#accumulate-scores-with-sumorfiltersscores).
|
|
150
150
|
attr_accessor :sum_or_filters_scores
|
|
151
151
|
|
|
152
152
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -7,7 +7,7 @@ require "time"
|
|
|
7
7
|
|
|
8
8
|
module Algolia
|
|
9
9
|
module Composition
|
|
10
|
-
# Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is optional, the search engine runs two queries: one for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has fewer than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word; results 1,001 to 2,000 need 2 matched words. - If `optionalWords` has 10 or more words, the required number of matched words increases by the number of optional words divided by 5 (rounded down). Example: with 18 optional words, results 1 to 1,000 require 1 matched word; results 1,001 to 2,000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#
|
|
10
|
+
# Words that should be considered optional when found in the query. By default, records must match all words in the search query to be included in the search results. Adding optional words can increase the number of search results by running an additional search query that doesn't include the optional words. For example, if the search query is \"action video\" and \"video\" is optional, the search engine runs two queries: one for \"action video\" and one for \"action\". Records that match all words are ranked higher. For a search query with 4 or more words **and** all its words are optional, the number of matched words required for a record to be included in the search results increases for every 1,000 records: - If `optionalWords` has fewer than 10 words, the required number of matched words increases by 1: results 1 to 1,000 require 1 matched word; results 1,001 to 2,000 need 2 matched words. - If `optionalWords` has 10 or more words, the required number of matched words increases by the number of optional words divided by 5 (rounded down). Example: with 18 optional words, results 1 to 1,000 require 1 matched word; results 1,001 to 2,000 need 4 matched words. For more information, see [Optional words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#create-a-list-of-optional-words).
|
|
11
11
|
module OptionalWords
|
|
12
12
|
class << self
|
|
13
13
|
# List of class defined in oneOf (OpenAPI v3)
|
|
@@ -24,7 +24,7 @@ module Algolia
|
|
|
24
24
|
|
|
25
25
|
attr_accessor :around_precision
|
|
26
26
|
|
|
27
|
-
# Whether to include a `queryID` attribute in the response The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/doc/guides/sending-events/getting-started).
|
|
27
|
+
# Whether to include a `queryID` attribute in the response. The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/doc/guides/sending-events/getting-started).
|
|
28
28
|
attr_accessor :click_analytics
|
|
29
29
|
|
|
30
30
|
# Whether to enable index level A/B testing for this run request. If the composition mixes multiple indices, the A/B test is ignored.
|
|
@@ -33,7 +33,7 @@ module Algolia
|
|
|
33
33
|
# Whether to enable Personalization.
|
|
34
34
|
attr_accessor :enable_personalization
|
|
35
35
|
|
|
36
|
-
# Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking) This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard.
|
|
36
|
+
# Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking). This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard.
|
|
37
37
|
attr_accessor :enable_re_ranking
|
|
38
38
|
|
|
39
39
|
# Whether to enable composition rules.
|
|
@@ -41,7 +41,7 @@ module Algolia
|
|
|
41
41
|
|
|
42
42
|
attr_accessor :facet_filters
|
|
43
43
|
|
|
44
|
-
# 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 `*`. To retrieve disjunctive facets lists, annotate any facets with the `disjunctive` modifier. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts) and [disjunctive faceting for Smart Groups](https://www.algolia.com/doc/guides/managing-results/compositions/search-based-groups#facets-including-disjunctive-faceting).
|
|
44
|
+
# 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 `*`. To retrieve disjunctive facets lists, annotate any facets with the `disjunctive` modifier. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts) and [disjunctive faceting for Smart Groups](https://www.algolia.com/doc/guides/managing-results/compositions/search-based-groups#facets-including-disjunctive-faceting).
|
|
45
45
|
attr_accessor :facets
|
|
46
46
|
|
|
47
47
|
# Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>`, where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>`, where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can't use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can't combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes if the facet attribute name or facet value contains spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering).
|
|
@@ -64,7 +64,7 @@ module Algolia
|
|
|
64
64
|
# Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set.
|
|
65
65
|
attr_accessor :minimum_around_radius
|
|
66
66
|
|
|
67
|
-
# 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`.
|
|
67
|
+
# 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`.
|
|
68
68
|
attr_accessor :natural_languages
|
|
69
69
|
|
|
70
70
|
attr_accessor :numeric_filters
|
|
@@ -80,10 +80,10 @@ module Algolia
|
|
|
80
80
|
# Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings. This setting also sets a dictionary for word detection in the logogram-based [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) languages. To support this, place the CJK language **first**. **Always specify a query language.** If you don't specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations).
|
|
81
81
|
attr_accessor :query_languages
|
|
82
82
|
|
|
83
|
-
# Relevancy threshold below which less relevant results aren't included in the results You can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#
|
|
83
|
+
# Relevancy threshold below which less relevant results aren't included in the results. You can only set `relevancyStrictness` on [virtual replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas/#standard-and-virtual-replicas). Use this setting to strike a balance between the relevance and number of returned results.
|
|
84
84
|
attr_accessor :relevancy_strictness
|
|
85
85
|
|
|
86
|
-
# Assigns a rule context to the run query [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#
|
|
86
|
+
# Assigns a rule context to the run query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#assign-context) are strings that you can use to trigger matching rules.
|
|
87
87
|
attr_accessor :rule_contexts
|
|
88
88
|
|
|
89
89
|
# Indicates which sorting strategy to apply for the request. The value must match one of the labels defined in the \"sortingStrategy\" mapping. For example, \"Price (asc)\", see Upsert Composition. At runtime, this label is used to look up the corresponding index or replica configured in \"sortingStrategy\", and the query is executed using that index instead of main's. In addition to \"sortingStrategy\", this parameter is also used to apply a matching Composition Rule that contains a condition defined to trigger on \"sortBy\", see Composition Rules. If no value is provided or an invalid value, no sorting strategy is applied.
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# 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.
|
|
4
|
+
|
|
5
|
+
require "date"
|
|
6
|
+
require "time"
|
|
7
|
+
|
|
8
|
+
module Algolia
|
|
9
|
+
module Composition
|
|
10
|
+
class ProcessingError
|
|
11
|
+
# Description of the non-critical error.
|
|
12
|
+
attr_accessor :message
|
|
13
|
+
|
|
14
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
15
|
+
def self.attribute_map
|
|
16
|
+
{
|
|
17
|
+
:message => :message
|
|
18
|
+
}
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Attribute type mapping.
|
|
22
|
+
def self.types_mapping
|
|
23
|
+
{
|
|
24
|
+
:message => :"String"
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# List of attributes with nullable: true
|
|
29
|
+
def self.openapi_nullable
|
|
30
|
+
Set.new(
|
|
31
|
+
[]
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Initializes the object
|
|
36
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
37
|
+
def initialize(attributes = {})
|
|
38
|
+
if (!attributes.is_a?(Hash))
|
|
39
|
+
raise(
|
|
40
|
+
ArgumentError,
|
|
41
|
+
"The input argument (attributes) must be a hash in `Algolia::ProcessingError` initialize method"
|
|
42
|
+
)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
46
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
47
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
48
|
+
raise(
|
|
49
|
+
ArgumentError,
|
|
50
|
+
"`#{k}` is not a valid attribute in `Algolia::ProcessingError`. Please check the name to make sure it's valid. List of attributes: " +
|
|
51
|
+
self.class.attribute_map.keys.inspect
|
|
52
|
+
)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
h[k.to_sym] = v
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if attributes.key?(:message)
|
|
59
|
+
self.message = attributes[:message]
|
|
60
|
+
else
|
|
61
|
+
self.message = nil
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Checks equality by comparing each attribute.
|
|
66
|
+
# @param [Object] Object to be compared
|
|
67
|
+
def ==(other)
|
|
68
|
+
return true if self.equal?(other)
|
|
69
|
+
self.class == other.class &&
|
|
70
|
+
message == other.message
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# @see the `==` method
|
|
74
|
+
# @param [Object] Object to be compared
|
|
75
|
+
def eql?(other)
|
|
76
|
+
self == other
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Calculates hash code according to all attributes.
|
|
80
|
+
# @return [Integer] Hash code
|
|
81
|
+
def hash
|
|
82
|
+
[message].hash
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Builds the object from hash
|
|
86
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
87
|
+
# @return [Object] Returns the model itself
|
|
88
|
+
def self.build_from_hash(attributes)
|
|
89
|
+
return nil unless attributes.is_a?(Hash)
|
|
90
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
91
|
+
transformed_hash = {}
|
|
92
|
+
types_mapping.each_pair do |key, type|
|
|
93
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
94
|
+
transformed_hash[key.to_sym] = nil
|
|
95
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
96
|
+
# check to ensure the input is an array given that the attribute
|
|
97
|
+
# is documented as an array but the input is not
|
|
98
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
99
|
+
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
|
|
100
|
+
_deserialize(::Regexp.last_match(1), v)
|
|
101
|
+
}
|
|
102
|
+
end
|
|
103
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
104
|
+
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
new(transformed_hash)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Deserializes the data based on type
|
|
112
|
+
# @param string type Data type
|
|
113
|
+
# @param string value Value to be deserialized
|
|
114
|
+
# @return [Object] Deserialized data
|
|
115
|
+
def self._deserialize(type, value)
|
|
116
|
+
case type.to_sym
|
|
117
|
+
when :Time
|
|
118
|
+
Time.parse(value)
|
|
119
|
+
when :Date
|
|
120
|
+
Date.parse(value)
|
|
121
|
+
when :String
|
|
122
|
+
value.to_s
|
|
123
|
+
when :Integer
|
|
124
|
+
value.to_i
|
|
125
|
+
when :Float
|
|
126
|
+
value.to_f
|
|
127
|
+
when :Boolean
|
|
128
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
129
|
+
true
|
|
130
|
+
else
|
|
131
|
+
false
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
when :Object
|
|
135
|
+
# generic object (usually a Hash), return directly
|
|
136
|
+
value
|
|
137
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
138
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
139
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
140
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
141
|
+
k_type = Regexp.last_match[:k_type]
|
|
142
|
+
v_type = Regexp.last_match[:v_type]
|
|
143
|
+
{}.tap do |hash|
|
|
144
|
+
value.each do |k, v|
|
|
145
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
# model
|
|
149
|
+
else
|
|
150
|
+
# models (e.g. Pet) or oneOf
|
|
151
|
+
klass = Algolia::Composition.const_get(type)
|
|
152
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
|
|
153
|
+
.build_from_hash(value)
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Returns the string representation of the object
|
|
158
|
+
# @return [String] String presentation of the object
|
|
159
|
+
def to_s
|
|
160
|
+
to_hash.to_s
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
164
|
+
# @return [Hash] Returns the object in the form of hash
|
|
165
|
+
def to_body
|
|
166
|
+
to_hash
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
def to_json(*_args)
|
|
170
|
+
to_hash.to_json
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Returns the object in the form of hash
|
|
174
|
+
# @return [Hash] Returns the object in the form of hash
|
|
175
|
+
def to_hash
|
|
176
|
+
hash = {}
|
|
177
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
178
|
+
value = send(attr)
|
|
179
|
+
if value.nil?
|
|
180
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
181
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
hash[param] = _to_hash(value)
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
hash
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Outputs non-array value in the form of hash
|
|
191
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
192
|
+
# @param [Object] value Any valid value
|
|
193
|
+
# @return [Hash] Returns the value in the form of hash
|
|
194
|
+
def _to_hash(value)
|
|
195
|
+
if value.is_a?(Array)
|
|
196
|
+
value.map { |v| _to_hash(v) }
|
|
197
|
+
elsif value.is_a?(Hash)
|
|
198
|
+
{}.tap do |hash|
|
|
199
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
200
|
+
end
|
|
201
|
+
elsif value.respond_to?(:to_hash)
|
|
202
|
+
value.to_hash
|
|
203
|
+
else
|
|
204
|
+
value
|
|
205
|
+
end
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
end
|
|
@@ -13,11 +13,14 @@ module Algolia
|
|
|
13
13
|
# A list of Feed IDs that specifies the order in which to order the results in the response. The IDs should be a subset of those in the `feeds` object of the targeted `multifeed` Composition / Composition Rule, and only those specified will be processed. The value overrides the value in the defined behavior, and when unspecified, the value defined in the behavior is used. When neither value is present, all feeds are processed.
|
|
14
14
|
attr_accessor :feeds_order
|
|
15
15
|
|
|
16
|
+
attr_accessor :external_provider
|
|
17
|
+
|
|
16
18
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
17
19
|
def self.attribute_map
|
|
18
20
|
{
|
|
19
21
|
:params => :params,
|
|
20
|
-
:feeds_order => :feedsOrder
|
|
22
|
+
:feeds_order => :feedsOrder,
|
|
23
|
+
:external_provider => :externalProvider
|
|
21
24
|
}
|
|
22
25
|
end
|
|
23
26
|
|
|
@@ -25,7 +28,8 @@ module Algolia
|
|
|
25
28
|
def self.types_mapping
|
|
26
29
|
{
|
|
27
30
|
:params => :"Params",
|
|
28
|
-
:feeds_order => :"Array<String>"
|
|
31
|
+
:feeds_order => :"Array<String>",
|
|
32
|
+
:external_provider => :"ExternalProvider"
|
|
29
33
|
}
|
|
30
34
|
end
|
|
31
35
|
|
|
@@ -68,6 +72,10 @@ module Algolia
|
|
|
68
72
|
self.feeds_order = value
|
|
69
73
|
end
|
|
70
74
|
end
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:external_provider)
|
|
77
|
+
self.external_provider = attributes[:external_provider]
|
|
78
|
+
end
|
|
71
79
|
end
|
|
72
80
|
|
|
73
81
|
# Checks equality by comparing each attribute.
|
|
@@ -76,7 +84,8 @@ module Algolia
|
|
|
76
84
|
return true if self.equal?(other)
|
|
77
85
|
self.class == other.class &&
|
|
78
86
|
params == other.params &&
|
|
79
|
-
feeds_order == other.feeds_order
|
|
87
|
+
feeds_order == other.feeds_order &&
|
|
88
|
+
external_provider == other.external_provider
|
|
80
89
|
end
|
|
81
90
|
|
|
82
91
|
# @see the `==` method
|
|
@@ -88,7 +97,7 @@ module Algolia
|
|
|
88
97
|
# Calculates hash code according to all attributes.
|
|
89
98
|
# @return [Integer] Hash code
|
|
90
99
|
def hash
|
|
91
|
-
[params, feeds_order].hash
|
|
100
|
+
[params, feeds_order, external_provider].hash
|
|
92
101
|
end
|
|
93
102
|
|
|
94
103
|
# Builds the object from hash
|