algolia 3.40.0 → 3.41.0

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.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/Bug_report.yml +1 -0
  3. data/CHANGELOG.md +5 -0
  4. data/Gemfile.lock +4 -4
  5. data/lib/algolia/api/agent_studio_client.rb +2364 -0
  6. data/lib/algolia/models/agent-studio/advanced_syntax_features.rb +34 -0
  7. data/lib/algolia/models/agent-studio/agent_completion_algolia_params.rb +221 -0
  8. data/lib/algolia/models/agent-studio/agent_completion_request.rb +247 -0
  9. data/lib/algolia/models/agent-studio/agent_config_create.rb +288 -0
  10. data/lib/algolia/models/agent-studio/agent_config_update.rb +294 -0
  11. data/lib/algolia/models/agent-studio/agent_status.rb +34 -0
  12. data/lib/algolia/models/agent-studio/agent_test_configuration.rb +271 -0
  13. data/lib/algolia/models/agent-studio/agent_with_version_response.rb +370 -0
  14. data/lib/algolia/models/agent-studio/algolia_display_results_tool_config.rb +254 -0
  15. data/lib/algolia/models/agent-studio/algolia_recommend_tool_config_input.rb +242 -0
  16. data/lib/algolia/models/agent-studio/algolia_recommend_tool_index_config.rb +228 -0
  17. data/lib/algolia/models/agent-studio/algolia_search_tool_config.rb +232 -0
  18. data/lib/algolia/models/agent-studio/algolia_search_tool_index_config.rb +249 -0
  19. data/lib/algolia/models/agent-studio/allowed_domain_bulk_delete.rb +212 -0
  20. data/lib/algolia/models/agent-studio/allowed_domain_bulk_insert.rb +212 -0
  21. data/lib/algolia/models/agent-studio/allowed_domain_create.rb +210 -0
  22. data/lib/algolia/models/agent-studio/allowed_domain_list_response.rb +211 -0
  23. data/lib/algolia/models/agent-studio/allowed_domain_response.rb +264 -0
  24. data/lib/algolia/models/agent-studio/alternatives_as_exact.rb +36 -0
  25. data/lib/algolia/models/agent-studio/anthropic_provider_input.rb +220 -0
  26. data/lib/algolia/models/agent-studio/application_config_patch.rb +209 -0
  27. data/lib/algolia/models/agent-studio/application_config_response.rb +208 -0
  28. data/lib/algolia/models/agent-studio/around_precision_union.rb +108 -0
  29. data/lib/algolia/models/agent-studio/around_radius_union.rb +108 -0
  30. data/lib/algolia/models/agent-studio/assistant_message_v4.rb +252 -0
  31. data/lib/algolia/models/agent-studio/assistant_message_v5.rb +228 -0
  32. data/lib/algolia/models/agent-studio/assistant_part_v4.rb +110 -0
  33. data/lib/algolia/models/agent-studio/assistant_part_v5.rb +110 -0
  34. data/lib/algolia/models/agent-studio/azure_open_ai_provider_input.rb +243 -0
  35. data/lib/algolia/models/agent-studio/base_provider_input.rb +209 -0
  36. data/lib/algolia/models/agent-studio/client_side_tool_config.rb +241 -0
  37. data/lib/algolia/models/agent-studio/client_tools_args_schema.rb +228 -0
  38. data/lib/algolia/models/agent-studio/compatibility_mode.rb +34 -0
  39. data/lib/algolia/models/agent-studio/conversation_base_response.rb +355 -0
  40. data/lib/algolia/models/agent-studio/conversation_full_response.rb +369 -0
  41. data/lib/algolia/models/agent-studio/conversation_metadata.rb +209 -0
  42. data/lib/algolia/models/agent-studio/distinct_union.rb +108 -0
  43. data/lib/algolia/models/agent-studio/episode.rb +243 -0
  44. data/lib/algolia/models/agent-studio/error_base.rb +207 -0
  45. data/lib/algolia/models/agent-studio/exact_on_single_word_query.rb +35 -0
  46. data/lib/algolia/models/agent-studio/facet_filters_union.rb +108 -0
  47. data/lib/algolia/models/agent-studio/facets.rb +208 -0
  48. data/lib/algolia/models/agent-studio/facets_param.rb +220 -0
  49. data/lib/algolia/models/agent-studio/facets_union.rb +108 -0
  50. data/lib/algolia/models/agent-studio/feedback_creation_request.rb +251 -0
  51. data/lib/algolia/models/agent-studio/feedback_response.rb +297 -0
  52. data/lib/algolia/models/agent-studio/ignore_plurals_union.rb +108 -0
  53. data/lib/algolia/models/agent-studio/index_search_parameters.rb +267 -0
  54. data/lib/algolia/models/agent-studio/inside_bounding_box_union.rb +108 -0
  55. data/lib/algolia/models/agent-studio/inside_polygon_union.rb +108 -0
  56. data/lib/algolia/models/agent-studio/location_item_union.rb +108 -0
  57. data/lib/algolia/models/agent-studio/mcp_server_tool_config.rb +276 -0
  58. data/lib/algolia/models/agent-studio/mcp_tool_config.rb +218 -0
  59. data/lib/algolia/models/agent-studio/memory_record.rb +368 -0
  60. data/lib/algolia/models/agent-studio/memory_type.rb +34 -0
  61. data/lib/algolia/models/agent-studio/message_part.rb +132 -0
  62. data/lib/algolia/models/agent-studio/message_response.rb +309 -0
  63. data/lib/algolia/models/agent-studio/message_role.rb +34 -0
  64. data/lib/algolia/models/agent-studio/message_v4.rb +117 -0
  65. data/lib/algolia/models/agent-studio/message_v5.rb +117 -0
  66. data/lib/algolia/models/agent-studio/messages_union.rb +108 -0
  67. data/lib/algolia/models/agent-studio/number_param.rb +230 -0
  68. data/lib/algolia/models/agent-studio/number_param_constraint.rb +219 -0
  69. data/lib/algolia/models/agent-studio/numeric_filters_union.rb +108 -0
  70. data/lib/algolia/models/agent-studio/open_ai_compatible_provider_input.rb +232 -0
  71. data/lib/algolia/models/agent-studio/open_ai_provider_input.rb +220 -0
  72. data/lib/algolia/models/agent-studio/optional_filters_union.rb +108 -0
  73. data/lib/algolia/models/agent-studio/optional_words_union.rb +108 -0
  74. data/lib/algolia/models/agent-studio/paginated_agents_response.rb +221 -0
  75. data/lib/algolia/models/agent-studio/paginated_conversations_response.rb +221 -0
  76. data/lib/algolia/models/agent-studio/paginated_provider_authentications_response.rb +221 -0
  77. data/lib/algolia/models/agent-studio/paginated_secret_keys_response.rb +221 -0
  78. data/lib/algolia/models/agent-studio/pagination_metadata.rb +241 -0
  79. data/lib/algolia/models/agent-studio/provider_authentication_create.rb +230 -0
  80. data/lib/algolia/models/agent-studio/provider_authentication_patch.rb +218 -0
  81. data/lib/algolia/models/agent-studio/provider_authentication_response.rb +274 -0
  82. data/lib/algolia/models/agent-studio/provider_input.rb +111 -0
  83. data/lib/algolia/models/agent-studio/provider_input_nullable.rb +111 -0
  84. data/lib/algolia/models/agent-studio/provider_name.rb +38 -0
  85. data/lib/algolia/models/agent-studio/query_type.rb +35 -0
  86. data/lib/algolia/models/agent-studio/re_ranking_apply_filter_union.rb +108 -0
  87. data/lib/algolia/models/agent-studio/reasoning_part.rb +219 -0
  88. data/lib/algolia/models/agent-studio/reasoning_part_v4.rb +217 -0
  89. data/lib/algolia/models/agent-studio/reasoning_part_v5.rb +217 -0
  90. data/lib/algolia/models/agent-studio/remove_stop_words_union.rb +108 -0
  91. data/lib/algolia/models/agent-studio/remove_words_if_no_results.rb +36 -0
  92. data/lib/algolia/models/agent-studio/search_parameters.rb +950 -0
  93. data/lib/algolia/models/agent-studio/search_parameters_overrides.rb +286 -0
  94. data/lib/algolia/models/agent-studio/secret_key_create.rb +222 -0
  95. data/lib/algolia/models/agent-studio/secret_key_patch.rb +223 -0
  96. data/lib/algolia/models/agent-studio/secret_key_response.rb +287 -0
  97. data/lib/algolia/models/agent-studio/start_part.rb +208 -0
  98. data/lib/algolia/models/agent-studio/start_step_part.rb +208 -0
  99. data/lib/algolia/models/agent-studio/step_start_part_v4.rb +206 -0
  100. data/lib/algolia/models/agent-studio/step_start_part_v5.rb +206 -0
  101. data/lib/algolia/models/agent-studio/string_array_param.rb +242 -0
  102. data/lib/algolia/models/agent-studio/string_array_param_constraint.rb +211 -0
  103. data/lib/algolia/models/agent-studio/supported_language.rb +169 -0
  104. data/lib/algolia/models/agent-studio/tag_filters_union.rb +108 -0
  105. data/lib/algolia/models/agent-studio/text_param.rb +220 -0
  106. data/lib/algolia/models/agent-studio/text_part.rb +216 -0
  107. data/lib/algolia/models/agent-studio/text_part_v4.rb +217 -0
  108. data/lib/algolia/models/agent-studio/text_part_v5.rb +217 -0
  109. data/lib/algolia/models/agent-studio/tool_approval_request_part.rb +285 -0
  110. data/lib/algolia/models/agent-studio/tool_call_part.rb +265 -0
  111. data/lib/algolia/models/agent-studio/tool_config.rb +108 -0
  112. data/lib/algolia/models/agent-studio/tool_config_input.rb +129 -0
  113. data/lib/algolia/models/agent-studio/tool_invocation_part_v4.rb +217 -0
  114. data/lib/algolia/models/agent-studio/tool_invocation_v4.rb +309 -0
  115. data/lib/algolia/models/agent-studio/tool_part_v5.rb +309 -0
  116. data/lib/algolia/models/agent-studio/tool_result_output.rb +221 -0
  117. data/lib/algolia/models/agent-studio/tool_result_output_type.rb +37 -0
  118. data/lib/algolia/models/agent-studio/tool_result_part.rb +254 -0
  119. data/lib/algolia/models/agent-studio/tool_state.rb +36 -0
  120. data/lib/algolia/models/agent-studio/typo_tolerance_enum.rb +36 -0
  121. data/lib/algolia/models/agent-studio/typo_tolerance_union.rb +108 -0
  122. data/lib/algolia/models/agent-studio/unknown_tool_config.rb +220 -0
  123. data/lib/algolia/models/agent-studio/user_data_response.rb +223 -0
  124. data/lib/algolia/models/agent-studio/user_message_metadata_v5.rb +209 -0
  125. data/lib/algolia/models/agent-studio/user_message_v4.rb +250 -0
  126. data/lib/algolia/models/agent-studio/user_message_v5.rb +237 -0
  127. data/lib/algolia/models/agent-studio/validation_error.rb +252 -0
  128. data/lib/algolia/models/agent-studio/vote_enum.rb +34 -0
  129. data/lib/algolia/version.rb +1 -1
  130. metadata +125 -1
@@ -0,0 +1,950 @@
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 AgentStudio
10
+ # Algolia Search API parameters that can be predefined for the search tool. Reference: https://www.algolia.com/doc/api-reference/search-api-parameters/ The parameters that seemed irrelevant for the search tool have been commented out. Uses types from algoliasearch.search.models for better type safety.
11
+ class SearchParameters
12
+ attr_accessor :query_type
13
+
14
+ attr_accessor :similar_query
15
+
16
+ attr_accessor :query_languages
17
+
18
+ attr_accessor :advanced_syntax
19
+
20
+ attr_accessor :advanced_syntax_features
21
+
22
+ attr_accessor :alternatives_as_exact
23
+
24
+ attr_accessor :decompound_query
25
+
26
+ attr_accessor :typo_tolerance
27
+
28
+ attr_accessor :allow_typos_on_numeric_tokens
29
+
30
+ attr_accessor :min_word_size_for1_typo
31
+
32
+ attr_accessor :min_word_size_for2_typos
33
+
34
+ attr_accessor :disable_typo_tolerance_on_attributes
35
+
36
+ attr_accessor :filters
37
+
38
+ attr_accessor :facet_filters
39
+
40
+ attr_accessor :facets
41
+
42
+ attr_accessor :max_values_per_facet
43
+
44
+ attr_accessor :max_facet_hits
45
+
46
+ attr_accessor :faceting_after_distinct
47
+
48
+ attr_accessor :sort_facet_values_by
49
+
50
+ attr_accessor :numeric_filters
51
+
52
+ attr_accessor :tag_filters
53
+
54
+ attr_accessor :sum_or_filters_scores
55
+
56
+ attr_accessor :around_lat_lng
57
+
58
+ attr_accessor :around_lat_lng_via_ip
59
+
60
+ attr_accessor :around_radius
61
+
62
+ attr_accessor :around_precision
63
+
64
+ attr_accessor :minimum_around_radius
65
+
66
+ attr_accessor :inside_bounding_box
67
+
68
+ attr_accessor :inside_polygon
69
+
70
+ attr_accessor :attributes_to_retrieve
71
+
72
+ attr_accessor :attributes_to_snippet
73
+
74
+ attr_accessor :snippet_ellipsis_text
75
+
76
+ attr_accessor :restrict_highlight_and_snippet_arrays
77
+
78
+ attr_accessor :page
79
+
80
+ attr_accessor :offset
81
+
82
+ attr_accessor :hits_per_page
83
+
84
+ attr_accessor :length
85
+
86
+ attr_accessor :get_ranking_info
87
+
88
+ attr_accessor :relevancy_strictness
89
+
90
+ attr_accessor :min_proximity
91
+
92
+ attr_accessor :attribute_criteria_computed_by_min_proximity
93
+
94
+ attr_accessor :distinct
95
+
96
+ attr_accessor :enable_rules
97
+
98
+ attr_accessor :enable_personalization
99
+
100
+ attr_accessor :personalization_impact
101
+
102
+ attr_accessor :enable_ab_test
103
+
104
+ attr_accessor :enable_re_ranking
105
+
106
+ attr_accessor :re_ranking_apply_filter
107
+
108
+ attr_accessor :rule_contexts
109
+
110
+ attr_accessor :remove_stop_words
111
+
112
+ attr_accessor :ignore_plurals
113
+
114
+ attr_accessor :remove_words_if_no_results
115
+
116
+ attr_accessor :optional_words
117
+
118
+ attr_accessor :optional_filters
119
+
120
+ attr_accessor :synonyms
121
+
122
+ attr_accessor :replace_synonyms_in_highlight
123
+
124
+ attr_accessor :analytics
125
+
126
+ attr_accessor :analytics_tags
127
+
128
+ attr_accessor :click_analytics
129
+
130
+ attr_accessor :user_token
131
+
132
+ attr_accessor :restrict_searchable_attributes
133
+
134
+ attr_accessor :disable_exact_on_attributes
135
+
136
+ attr_accessor :exact_on_single_word_query
137
+
138
+ attr_accessor :natural_languages
139
+
140
+ attr_accessor :percentile_computation
141
+
142
+ attr_accessor :explain
143
+
144
+ # Attribute mapping from ruby-style variable name to JSON key.
145
+ def self.attribute_map
146
+ {
147
+ :query_type => :queryType,
148
+ :similar_query => :similarQuery,
149
+ :query_languages => :queryLanguages,
150
+ :advanced_syntax => :advancedSyntax,
151
+ :advanced_syntax_features => :advancedSyntaxFeatures,
152
+ :alternatives_as_exact => :alternativesAsExact,
153
+ :decompound_query => :decompoundQuery,
154
+ :typo_tolerance => :typoTolerance,
155
+ :allow_typos_on_numeric_tokens => :allowTyposOnNumericTokens,
156
+ :min_word_size_for1_typo => :minWordSizeFor1Typo,
157
+ :min_word_size_for2_typos => :minWordSizeFor2Typos,
158
+ :disable_typo_tolerance_on_attributes => :disableTypoToleranceOnAttributes,
159
+ :filters => :filters,
160
+ :facet_filters => :facetFilters,
161
+ :facets => :facets,
162
+ :max_values_per_facet => :maxValuesPerFacet,
163
+ :max_facet_hits => :maxFacetHits,
164
+ :faceting_after_distinct => :facetingAfterDistinct,
165
+ :sort_facet_values_by => :sortFacetValuesBy,
166
+ :numeric_filters => :numericFilters,
167
+ :tag_filters => :tagFilters,
168
+ :sum_or_filters_scores => :sumOrFiltersScores,
169
+ :around_lat_lng => :aroundLatLng,
170
+ :around_lat_lng_via_ip => :aroundLatLngViaIp,
171
+ :around_radius => :aroundRadius,
172
+ :around_precision => :aroundPrecision,
173
+ :minimum_around_radius => :minimumAroundRadius,
174
+ :inside_bounding_box => :insideBoundingBox,
175
+ :inside_polygon => :insidePolygon,
176
+ :attributes_to_retrieve => :attributesToRetrieve,
177
+ :attributes_to_snippet => :attributesToSnippet,
178
+ :snippet_ellipsis_text => :snippetEllipsisText,
179
+ :restrict_highlight_and_snippet_arrays => :restrictHighlightAndSnippetArrays,
180
+ :page => :page,
181
+ :offset => :offset,
182
+ :hits_per_page => :hitsPerPage,
183
+ :length => :length,
184
+ :get_ranking_info => :getRankingInfo,
185
+ :relevancy_strictness => :relevancyStrictness,
186
+ :min_proximity => :minProximity,
187
+ :attribute_criteria_computed_by_min_proximity => :attributeCriteriaComputedByMinProximity,
188
+ :distinct => :distinct,
189
+ :enable_rules => :enableRules,
190
+ :enable_personalization => :enablePersonalization,
191
+ :personalization_impact => :personalizationImpact,
192
+ :enable_ab_test => :enableAbTest,
193
+ :enable_re_ranking => :enableReRanking,
194
+ :re_ranking_apply_filter => :reRankingApplyFilter,
195
+ :rule_contexts => :ruleContexts,
196
+ :remove_stop_words => :removeStopWords,
197
+ :ignore_plurals => :ignorePlurals,
198
+ :remove_words_if_no_results => :removeWordsIfNoResults,
199
+ :optional_words => :optionalWords,
200
+ :optional_filters => :optionalFilters,
201
+ :synonyms => :synonyms,
202
+ :replace_synonyms_in_highlight => :replaceSynonymsInHighlight,
203
+ :analytics => :analytics,
204
+ :analytics_tags => :analyticsTags,
205
+ :click_analytics => :clickAnalytics,
206
+ :user_token => :userToken,
207
+ :restrict_searchable_attributes => :restrictSearchableAttributes,
208
+ :disable_exact_on_attributes => :disableExactOnAttributes,
209
+ :exact_on_single_word_query => :exactOnSingleWordQuery,
210
+ :natural_languages => :naturalLanguages,
211
+ :percentile_computation => :percentileComputation,
212
+ :explain => :explain
213
+ }
214
+ end
215
+
216
+ # Attribute type mapping.
217
+ def self.types_mapping
218
+ {
219
+ :query_type => :"QueryType",
220
+ :similar_query => :"String",
221
+ :query_languages => :"Array<SupportedLanguage>",
222
+ :advanced_syntax => :"Boolean",
223
+ :advanced_syntax_features => :"Array<AdvancedSyntaxFeatures>",
224
+ :alternatives_as_exact => :"Array<AlternativesAsExact>",
225
+ :decompound_query => :"Boolean",
226
+ :typo_tolerance => :"TypoToleranceUnion",
227
+ :allow_typos_on_numeric_tokens => :"Boolean",
228
+ :min_word_size_for1_typo => :"Integer",
229
+ :min_word_size_for2_typos => :"Integer",
230
+ :disable_typo_tolerance_on_attributes => :"Array<String>",
231
+ :filters => :"String",
232
+ :facet_filters => :"FacetFiltersUnion",
233
+ :facets => :"FacetsUnion",
234
+ :max_values_per_facet => :"Integer",
235
+ :max_facet_hits => :"Integer",
236
+ :faceting_after_distinct => :"Boolean",
237
+ :sort_facet_values_by => :"String",
238
+ :numeric_filters => :"NumericFiltersUnion",
239
+ :tag_filters => :"TagFiltersUnion",
240
+ :sum_or_filters_scores => :"Boolean",
241
+ :around_lat_lng => :"String",
242
+ :around_lat_lng_via_ip => :"Boolean",
243
+ :around_radius => :"AroundRadiusUnion",
244
+ :around_precision => :"AroundPrecisionUnion",
245
+ :minimum_around_radius => :"Integer",
246
+ :inside_bounding_box => :"InsideBoundingBoxUnion",
247
+ :inside_polygon => :"InsidePolygonUnion",
248
+ :attributes_to_retrieve => :"Array<String>",
249
+ :attributes_to_snippet => :"Array<String>",
250
+ :snippet_ellipsis_text => :"String",
251
+ :restrict_highlight_and_snippet_arrays => :"Boolean",
252
+ :page => :"Integer",
253
+ :offset => :"Integer",
254
+ :hits_per_page => :"Integer",
255
+ :length => :"Integer",
256
+ :get_ranking_info => :"Boolean",
257
+ :relevancy_strictness => :"Integer",
258
+ :min_proximity => :"Integer",
259
+ :attribute_criteria_computed_by_min_proximity => :"Boolean",
260
+ :distinct => :"DistinctUnion",
261
+ :enable_rules => :"Boolean",
262
+ :enable_personalization => :"Boolean",
263
+ :personalization_impact => :"Integer",
264
+ :enable_ab_test => :"Boolean",
265
+ :enable_re_ranking => :"Boolean",
266
+ :re_ranking_apply_filter => :"ReRankingApplyFilterUnion",
267
+ :rule_contexts => :"Array<String>",
268
+ :remove_stop_words => :"RemoveStopWordsUnion",
269
+ :ignore_plurals => :"IgnorePluralsUnion",
270
+ :remove_words_if_no_results => :"RemoveWordsIfNoResults",
271
+ :optional_words => :"OptionalWordsUnion",
272
+ :optional_filters => :"OptionalFiltersUnion",
273
+ :synonyms => :"Boolean",
274
+ :replace_synonyms_in_highlight => :"Boolean",
275
+ :analytics => :"Boolean",
276
+ :analytics_tags => :"Array<String>",
277
+ :click_analytics => :"Boolean",
278
+ :user_token => :"String",
279
+ :restrict_searchable_attributes => :"Array<String>",
280
+ :disable_exact_on_attributes => :"Array<String>",
281
+ :exact_on_single_word_query => :"ExactOnSingleWordQuery",
282
+ :natural_languages => :"Array<SupportedLanguage>",
283
+ :percentile_computation => :"Boolean",
284
+ :explain => :"Array<String>"
285
+ }
286
+ end
287
+
288
+ # List of attributes with nullable: true
289
+ def self.openapi_nullable
290
+ Set.new(
291
+ [
292
+ :query_type,
293
+ :similar_query,
294
+ :query_languages,
295
+ :advanced_syntax,
296
+ :advanced_syntax_features,
297
+ :alternatives_as_exact,
298
+ :decompound_query,
299
+ :typo_tolerance,
300
+ :allow_typos_on_numeric_tokens,
301
+ :min_word_size_for1_typo,
302
+ :min_word_size_for2_typos,
303
+ :disable_typo_tolerance_on_attributes,
304
+ :filters,
305
+ :facet_filters,
306
+ :facets,
307
+ :max_values_per_facet,
308
+ :max_facet_hits,
309
+ :faceting_after_distinct,
310
+ :sort_facet_values_by,
311
+ :numeric_filters,
312
+ :tag_filters,
313
+ :sum_or_filters_scores,
314
+ :around_lat_lng,
315
+ :around_lat_lng_via_ip,
316
+ :around_radius,
317
+ :around_precision,
318
+ :minimum_around_radius,
319
+ :inside_bounding_box,
320
+ :inside_polygon,
321
+ :attributes_to_retrieve,
322
+ :attributes_to_snippet,
323
+ :snippet_ellipsis_text,
324
+ :restrict_highlight_and_snippet_arrays,
325
+ :page,
326
+ :offset,
327
+ :hits_per_page,
328
+ :length,
329
+ :get_ranking_info,
330
+ :relevancy_strictness,
331
+ :min_proximity,
332
+ :attribute_criteria_computed_by_min_proximity,
333
+ :distinct,
334
+ :enable_rules,
335
+ :enable_personalization,
336
+ :personalization_impact,
337
+ :enable_ab_test,
338
+ :enable_re_ranking,
339
+ :re_ranking_apply_filter,
340
+ :rule_contexts,
341
+ :remove_stop_words,
342
+ :ignore_plurals,
343
+ :remove_words_if_no_results,
344
+ :optional_words,
345
+ :optional_filters,
346
+ :synonyms,
347
+ :replace_synonyms_in_highlight,
348
+ :analytics,
349
+ :analytics_tags,
350
+ :click_analytics,
351
+ :user_token,
352
+ :restrict_searchable_attributes,
353
+ :disable_exact_on_attributes,
354
+ :exact_on_single_word_query,
355
+ :natural_languages,
356
+ :percentile_computation,
357
+ :explain
358
+ ]
359
+ )
360
+ end
361
+
362
+ # Initializes the object
363
+ # @param [Hash] attributes Model attributes in the form of hash
364
+ def initialize(attributes = {})
365
+ if (!attributes.is_a?(Hash))
366
+ raise(
367
+ ArgumentError,
368
+ "The input argument (attributes) must be a hash in `Algolia::SearchParameters` initialize method"
369
+ )
370
+ end
371
+
372
+ # check to see if the attribute exists and convert string to symbol for hash key
373
+ attributes = attributes.each_with_object({}) { |(k, v), h|
374
+ if (!self.class.attribute_map.key?(k.to_sym))
375
+ raise(
376
+ ArgumentError,
377
+ "`#{k}` is not a valid attribute in `Algolia::SearchParameters`. Please check the name to make sure it's valid. List of attributes: " +
378
+ self.class.attribute_map.keys.inspect
379
+ )
380
+ end
381
+
382
+ h[k.to_sym] = v
383
+ }
384
+
385
+ if attributes.key?(:query_type)
386
+ self.query_type = attributes[:query_type]
387
+ end
388
+
389
+ if attributes.key?(:similar_query)
390
+ self.similar_query = attributes[:similar_query]
391
+ end
392
+
393
+ if attributes.key?(:query_languages)
394
+ if (value = attributes[:query_languages]).is_a?(Array)
395
+ self.query_languages = value
396
+ end
397
+ end
398
+
399
+ if attributes.key?(:advanced_syntax)
400
+ self.advanced_syntax = attributes[:advanced_syntax]
401
+ end
402
+
403
+ if attributes.key?(:advanced_syntax_features)
404
+ if (value = attributes[:advanced_syntax_features]).is_a?(Array)
405
+ self.advanced_syntax_features = value
406
+ end
407
+ end
408
+
409
+ if attributes.key?(:alternatives_as_exact)
410
+ if (value = attributes[:alternatives_as_exact]).is_a?(Array)
411
+ self.alternatives_as_exact = value
412
+ end
413
+ end
414
+
415
+ if attributes.key?(:decompound_query)
416
+ self.decompound_query = attributes[:decompound_query]
417
+ end
418
+
419
+ if attributes.key?(:typo_tolerance)
420
+ self.typo_tolerance = attributes[:typo_tolerance]
421
+ end
422
+
423
+ if attributes.key?(:allow_typos_on_numeric_tokens)
424
+ self.allow_typos_on_numeric_tokens = attributes[:allow_typos_on_numeric_tokens]
425
+ end
426
+
427
+ if attributes.key?(:min_word_size_for1_typo)
428
+ self.min_word_size_for1_typo = attributes[:min_word_size_for1_typo]
429
+ end
430
+
431
+ if attributes.key?(:min_word_size_for2_typos)
432
+ self.min_word_size_for2_typos = attributes[:min_word_size_for2_typos]
433
+ end
434
+
435
+ if attributes.key?(:disable_typo_tolerance_on_attributes)
436
+ if (value = attributes[:disable_typo_tolerance_on_attributes]).is_a?(Array)
437
+ self.disable_typo_tolerance_on_attributes = value
438
+ end
439
+ end
440
+
441
+ if attributes.key?(:filters)
442
+ self.filters = attributes[:filters]
443
+ end
444
+
445
+ if attributes.key?(:facet_filters)
446
+ self.facet_filters = attributes[:facet_filters]
447
+ end
448
+
449
+ if attributes.key?(:facets)
450
+ self.facets = attributes[:facets]
451
+ end
452
+
453
+ if attributes.key?(:max_values_per_facet)
454
+ self.max_values_per_facet = attributes[:max_values_per_facet]
455
+ end
456
+
457
+ if attributes.key?(:max_facet_hits)
458
+ self.max_facet_hits = attributes[:max_facet_hits]
459
+ end
460
+
461
+ if attributes.key?(:faceting_after_distinct)
462
+ self.faceting_after_distinct = attributes[:faceting_after_distinct]
463
+ end
464
+
465
+ if attributes.key?(:sort_facet_values_by)
466
+ self.sort_facet_values_by = attributes[:sort_facet_values_by]
467
+ end
468
+
469
+ if attributes.key?(:numeric_filters)
470
+ self.numeric_filters = attributes[:numeric_filters]
471
+ end
472
+
473
+ if attributes.key?(:tag_filters)
474
+ self.tag_filters = attributes[:tag_filters]
475
+ end
476
+
477
+ if attributes.key?(:sum_or_filters_scores)
478
+ self.sum_or_filters_scores = attributes[:sum_or_filters_scores]
479
+ end
480
+
481
+ if attributes.key?(:around_lat_lng)
482
+ self.around_lat_lng = attributes[:around_lat_lng]
483
+ end
484
+
485
+ if attributes.key?(:around_lat_lng_via_ip)
486
+ self.around_lat_lng_via_ip = attributes[:around_lat_lng_via_ip]
487
+ end
488
+
489
+ if attributes.key?(:around_radius)
490
+ self.around_radius = attributes[:around_radius]
491
+ end
492
+
493
+ if attributes.key?(:around_precision)
494
+ self.around_precision = attributes[:around_precision]
495
+ end
496
+
497
+ if attributes.key?(:minimum_around_radius)
498
+ self.minimum_around_radius = attributes[:minimum_around_radius]
499
+ end
500
+
501
+ if attributes.key?(:inside_bounding_box)
502
+ self.inside_bounding_box = attributes[:inside_bounding_box]
503
+ end
504
+
505
+ if attributes.key?(:inside_polygon)
506
+ self.inside_polygon = attributes[:inside_polygon]
507
+ end
508
+
509
+ if attributes.key?(:attributes_to_retrieve)
510
+ if (value = attributes[:attributes_to_retrieve]).is_a?(Array)
511
+ self.attributes_to_retrieve = value
512
+ end
513
+ end
514
+
515
+ if attributes.key?(:attributes_to_snippet)
516
+ if (value = attributes[:attributes_to_snippet]).is_a?(Array)
517
+ self.attributes_to_snippet = value
518
+ end
519
+ end
520
+
521
+ if attributes.key?(:snippet_ellipsis_text)
522
+ self.snippet_ellipsis_text = attributes[:snippet_ellipsis_text]
523
+ end
524
+
525
+ if attributes.key?(:restrict_highlight_and_snippet_arrays)
526
+ self.restrict_highlight_and_snippet_arrays = attributes[:restrict_highlight_and_snippet_arrays]
527
+ end
528
+
529
+ if attributes.key?(:page)
530
+ self.page = attributes[:page]
531
+ end
532
+
533
+ if attributes.key?(:offset)
534
+ self.offset = attributes[:offset]
535
+ end
536
+
537
+ if attributes.key?(:hits_per_page)
538
+ self.hits_per_page = attributes[:hits_per_page]
539
+ end
540
+
541
+ if attributes.key?(:length)
542
+ self.length = attributes[:length]
543
+ end
544
+
545
+ if attributes.key?(:get_ranking_info)
546
+ self.get_ranking_info = attributes[:get_ranking_info]
547
+ end
548
+
549
+ if attributes.key?(:relevancy_strictness)
550
+ self.relevancy_strictness = attributes[:relevancy_strictness]
551
+ end
552
+
553
+ if attributes.key?(:min_proximity)
554
+ self.min_proximity = attributes[:min_proximity]
555
+ end
556
+
557
+ if attributes.key?(:attribute_criteria_computed_by_min_proximity)
558
+ self.attribute_criteria_computed_by_min_proximity = attributes[:attribute_criteria_computed_by_min_proximity]
559
+ end
560
+
561
+ if attributes.key?(:distinct)
562
+ self.distinct = attributes[:distinct]
563
+ end
564
+
565
+ if attributes.key?(:enable_rules)
566
+ self.enable_rules = attributes[:enable_rules]
567
+ end
568
+
569
+ if attributes.key?(:enable_personalization)
570
+ self.enable_personalization = attributes[:enable_personalization]
571
+ end
572
+
573
+ if attributes.key?(:personalization_impact)
574
+ self.personalization_impact = attributes[:personalization_impact]
575
+ end
576
+
577
+ if attributes.key?(:enable_ab_test)
578
+ self.enable_ab_test = attributes[:enable_ab_test]
579
+ end
580
+
581
+ if attributes.key?(:enable_re_ranking)
582
+ self.enable_re_ranking = attributes[:enable_re_ranking]
583
+ end
584
+
585
+ if attributes.key?(:re_ranking_apply_filter)
586
+ self.re_ranking_apply_filter = attributes[:re_ranking_apply_filter]
587
+ end
588
+
589
+ if attributes.key?(:rule_contexts)
590
+ if (value = attributes[:rule_contexts]).is_a?(Array)
591
+ self.rule_contexts = value
592
+ end
593
+ end
594
+
595
+ if attributes.key?(:remove_stop_words)
596
+ self.remove_stop_words = attributes[:remove_stop_words]
597
+ end
598
+
599
+ if attributes.key?(:ignore_plurals)
600
+ self.ignore_plurals = attributes[:ignore_plurals]
601
+ end
602
+
603
+ if attributes.key?(:remove_words_if_no_results)
604
+ self.remove_words_if_no_results = attributes[:remove_words_if_no_results]
605
+ end
606
+
607
+ if attributes.key?(:optional_words)
608
+ self.optional_words = attributes[:optional_words]
609
+ end
610
+
611
+ if attributes.key?(:optional_filters)
612
+ self.optional_filters = attributes[:optional_filters]
613
+ end
614
+
615
+ if attributes.key?(:synonyms)
616
+ self.synonyms = attributes[:synonyms]
617
+ end
618
+
619
+ if attributes.key?(:replace_synonyms_in_highlight)
620
+ self.replace_synonyms_in_highlight = attributes[:replace_synonyms_in_highlight]
621
+ end
622
+
623
+ if attributes.key?(:analytics)
624
+ self.analytics = attributes[:analytics]
625
+ end
626
+
627
+ if attributes.key?(:analytics_tags)
628
+ if (value = attributes[:analytics_tags]).is_a?(Array)
629
+ self.analytics_tags = value
630
+ end
631
+ end
632
+
633
+ if attributes.key?(:click_analytics)
634
+ self.click_analytics = attributes[:click_analytics]
635
+ end
636
+
637
+ if attributes.key?(:user_token)
638
+ self.user_token = attributes[:user_token]
639
+ end
640
+
641
+ if attributes.key?(:restrict_searchable_attributes)
642
+ if (value = attributes[:restrict_searchable_attributes]).is_a?(Array)
643
+ self.restrict_searchable_attributes = value
644
+ end
645
+ end
646
+
647
+ if attributes.key?(:disable_exact_on_attributes)
648
+ if (value = attributes[:disable_exact_on_attributes]).is_a?(Array)
649
+ self.disable_exact_on_attributes = value
650
+ end
651
+ end
652
+
653
+ if attributes.key?(:exact_on_single_word_query)
654
+ self.exact_on_single_word_query = attributes[:exact_on_single_word_query]
655
+ end
656
+
657
+ if attributes.key?(:natural_languages)
658
+ if (value = attributes[:natural_languages]).is_a?(Array)
659
+ self.natural_languages = value
660
+ end
661
+ end
662
+
663
+ if attributes.key?(:percentile_computation)
664
+ self.percentile_computation = attributes[:percentile_computation]
665
+ end
666
+
667
+ if attributes.key?(:explain)
668
+ if (value = attributes[:explain]).is_a?(Array)
669
+ self.explain = value
670
+ end
671
+ end
672
+ end
673
+
674
+ # Checks equality by comparing each attribute.
675
+ # @param [Object] Object to be compared
676
+ def ==(other)
677
+ return true if self.equal?(other)
678
+ self.class == other.class &&
679
+ query_type == other.query_type &&
680
+ similar_query == other.similar_query &&
681
+ query_languages == other.query_languages &&
682
+ advanced_syntax == other.advanced_syntax &&
683
+ advanced_syntax_features == other.advanced_syntax_features &&
684
+ alternatives_as_exact == other.alternatives_as_exact &&
685
+ decompound_query == other.decompound_query &&
686
+ typo_tolerance == other.typo_tolerance &&
687
+ allow_typos_on_numeric_tokens == other.allow_typos_on_numeric_tokens &&
688
+ min_word_size_for1_typo == other.min_word_size_for1_typo &&
689
+ min_word_size_for2_typos == other.min_word_size_for2_typos &&
690
+ disable_typo_tolerance_on_attributes == other.disable_typo_tolerance_on_attributes &&
691
+ filters == other.filters &&
692
+ facet_filters == other.facet_filters &&
693
+ facets == other.facets &&
694
+ max_values_per_facet == other.max_values_per_facet &&
695
+ max_facet_hits == other.max_facet_hits &&
696
+ faceting_after_distinct == other.faceting_after_distinct &&
697
+ sort_facet_values_by == other.sort_facet_values_by &&
698
+ numeric_filters == other.numeric_filters &&
699
+ tag_filters == other.tag_filters &&
700
+ sum_or_filters_scores == other.sum_or_filters_scores &&
701
+ around_lat_lng == other.around_lat_lng &&
702
+ around_lat_lng_via_ip == other.around_lat_lng_via_ip &&
703
+ around_radius == other.around_radius &&
704
+ around_precision == other.around_precision &&
705
+ minimum_around_radius == other.minimum_around_radius &&
706
+ inside_bounding_box == other.inside_bounding_box &&
707
+ inside_polygon == other.inside_polygon &&
708
+ attributes_to_retrieve == other.attributes_to_retrieve &&
709
+ attributes_to_snippet == other.attributes_to_snippet &&
710
+ snippet_ellipsis_text == other.snippet_ellipsis_text &&
711
+ restrict_highlight_and_snippet_arrays == other.restrict_highlight_and_snippet_arrays &&
712
+ page == other.page &&
713
+ offset == other.offset &&
714
+ hits_per_page == other.hits_per_page &&
715
+ length == other.length &&
716
+ get_ranking_info == other.get_ranking_info &&
717
+ relevancy_strictness == other.relevancy_strictness &&
718
+ min_proximity == other.min_proximity &&
719
+ attribute_criteria_computed_by_min_proximity == other.attribute_criteria_computed_by_min_proximity &&
720
+ distinct == other.distinct &&
721
+ enable_rules == other.enable_rules &&
722
+ enable_personalization == other.enable_personalization &&
723
+ personalization_impact == other.personalization_impact &&
724
+ enable_ab_test == other.enable_ab_test &&
725
+ enable_re_ranking == other.enable_re_ranking &&
726
+ re_ranking_apply_filter == other.re_ranking_apply_filter &&
727
+ rule_contexts == other.rule_contexts &&
728
+ remove_stop_words == other.remove_stop_words &&
729
+ ignore_plurals == other.ignore_plurals &&
730
+ remove_words_if_no_results == other.remove_words_if_no_results &&
731
+ optional_words == other.optional_words &&
732
+ optional_filters == other.optional_filters &&
733
+ synonyms == other.synonyms &&
734
+ replace_synonyms_in_highlight == other.replace_synonyms_in_highlight &&
735
+ analytics == other.analytics &&
736
+ analytics_tags == other.analytics_tags &&
737
+ click_analytics == other.click_analytics &&
738
+ user_token == other.user_token &&
739
+ restrict_searchable_attributes == other.restrict_searchable_attributes &&
740
+ disable_exact_on_attributes == other.disable_exact_on_attributes &&
741
+ exact_on_single_word_query == other.exact_on_single_word_query &&
742
+ natural_languages == other.natural_languages &&
743
+ percentile_computation == other.percentile_computation &&
744
+ explain == other.explain
745
+ end
746
+
747
+ # @see the `==` method
748
+ # @param [Object] Object to be compared
749
+ def eql?(other)
750
+ self == other
751
+ end
752
+
753
+ # Calculates hash code according to all attributes.
754
+ # @return [Integer] Hash code
755
+ def hash
756
+ [
757
+ query_type,
758
+ similar_query,
759
+ query_languages,
760
+ advanced_syntax,
761
+ advanced_syntax_features,
762
+ alternatives_as_exact,
763
+ decompound_query,
764
+ typo_tolerance,
765
+ allow_typos_on_numeric_tokens,
766
+ min_word_size_for1_typo,
767
+ min_word_size_for2_typos,
768
+ disable_typo_tolerance_on_attributes,
769
+ filters,
770
+ facet_filters,
771
+ facets,
772
+ max_values_per_facet,
773
+ max_facet_hits,
774
+ faceting_after_distinct,
775
+ sort_facet_values_by,
776
+ numeric_filters,
777
+ tag_filters,
778
+ sum_or_filters_scores,
779
+ around_lat_lng,
780
+ around_lat_lng_via_ip,
781
+ around_radius,
782
+ around_precision,
783
+ minimum_around_radius,
784
+ inside_bounding_box,
785
+ inside_polygon,
786
+ attributes_to_retrieve,
787
+ attributes_to_snippet,
788
+ snippet_ellipsis_text,
789
+ restrict_highlight_and_snippet_arrays,
790
+ page,
791
+ offset,
792
+ hits_per_page,
793
+ length,
794
+ get_ranking_info,
795
+ relevancy_strictness,
796
+ min_proximity,
797
+ attribute_criteria_computed_by_min_proximity,
798
+ distinct,
799
+ enable_rules,
800
+ enable_personalization,
801
+ personalization_impact,
802
+ enable_ab_test,
803
+ enable_re_ranking,
804
+ re_ranking_apply_filter,
805
+ rule_contexts,
806
+ remove_stop_words,
807
+ ignore_plurals,
808
+ remove_words_if_no_results,
809
+ optional_words,
810
+ optional_filters,
811
+ synonyms,
812
+ replace_synonyms_in_highlight,
813
+ analytics,
814
+ analytics_tags,
815
+ click_analytics,
816
+ user_token,
817
+ restrict_searchable_attributes,
818
+ disable_exact_on_attributes,
819
+ exact_on_single_word_query,
820
+ natural_languages,
821
+ percentile_computation,
822
+ explain
823
+ ].hash
824
+ end
825
+
826
+ # Builds the object from hash
827
+ # @param [Hash] attributes Model attributes in the form of hash
828
+ # @return [Object] Returns the model itself
829
+ def self.build_from_hash(attributes)
830
+ return nil unless attributes.is_a?(Hash)
831
+ attributes = attributes.transform_keys(&:to_sym)
832
+ transformed_hash = {}
833
+ types_mapping.each_pair do |key, type|
834
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
835
+ transformed_hash[key.to_sym] = nil
836
+ elsif type =~ /\AArray<(.*)>/i
837
+ # check to ensure the input is an array given that the attribute
838
+ # is documented as an array but the input is not
839
+ if attributes[attribute_map[key]].is_a?(Array)
840
+ transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
841
+ _deserialize(::Regexp.last_match(1), v)
842
+ }
843
+ end
844
+ elsif !attributes[attribute_map[key]].nil?
845
+ transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
846
+ end
847
+ end
848
+
849
+ new(transformed_hash)
850
+ end
851
+
852
+ # Deserializes the data based on type
853
+ # @param string type Data type
854
+ # @param string value Value to be deserialized
855
+ # @return [Object] Deserialized data
856
+ def self._deserialize(type, value)
857
+ case type.to_sym
858
+ when :Time
859
+ Time.parse(value)
860
+ when :Date
861
+ Date.parse(value)
862
+ when :String
863
+ value.to_s
864
+ when :Integer
865
+ value.to_i
866
+ when :Float
867
+ value.to_f
868
+ when :Boolean
869
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
870
+ true
871
+ else
872
+ false
873
+ end
874
+
875
+ when :Object
876
+ # generic object (usually a Hash), return directly
877
+ value
878
+ when /\AArray<(?<inner_type>.+)>\z/
879
+ inner_type = Regexp.last_match[:inner_type]
880
+ value.map { |v| _deserialize(inner_type, v) }
881
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
882
+ k_type = Regexp.last_match[:k_type]
883
+ v_type = Regexp.last_match[:v_type]
884
+ {}.tap do |hash|
885
+ value.each do |k, v|
886
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
887
+ end
888
+ end
889
+ # model
890
+ else
891
+ # models (e.g. Pet) or oneOf
892
+ klass = Algolia::AgentStudio.const_get(type)
893
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
894
+ .build_from_hash(value)
895
+ end
896
+ end
897
+
898
+ # Returns the string representation of the object
899
+ # @return [String] String presentation of the object
900
+ def to_s
901
+ to_hash.to_s
902
+ end
903
+
904
+ # to_body is an alias to to_hash (backward compatibility)
905
+ # @return [Hash] Returns the object in the form of hash
906
+ def to_body
907
+ to_hash
908
+ end
909
+
910
+ def to_json(*_args)
911
+ to_hash.to_json
912
+ end
913
+
914
+ # Returns the object in the form of hash
915
+ # @return [Hash] Returns the object in the form of hash
916
+ def to_hash
917
+ hash = {}
918
+ self.class.attribute_map.each_pair do |attr, param|
919
+ value = send(attr)
920
+ if value.nil?
921
+ is_nullable = self.class.openapi_nullable.include?(attr)
922
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
923
+ end
924
+
925
+ hash[param] = _to_hash(value)
926
+ end
927
+
928
+ hash
929
+ end
930
+
931
+ # Outputs non-array value in the form of hash
932
+ # For object, use to_hash. Otherwise, just return the value
933
+ # @param [Object] value Any valid value
934
+ # @return [Hash] Returns the value in the form of hash
935
+ def _to_hash(value)
936
+ if value.is_a?(Array)
937
+ value.compact.map { |v| _to_hash(v) }
938
+ elsif value.is_a?(Hash)
939
+ {}.tap do |hash|
940
+ value.each { |k, v| hash[k] = _to_hash(v) }
941
+ end
942
+ elsif value.respond_to?(:to_hash)
943
+ value.to_hash
944
+ else
945
+ value
946
+ end
947
+ end
948
+ end
949
+ end
950
+ end