algolia 2.3.3 → 3.0.0.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -89
- data/Gemfile +1 -14
- data/Gemfile.lock +64 -0
- data/README.md +4 -6
- data/Rakefile +0 -39
- data/algolia.gemspec +24 -39
- data/lib/algolia/api/abtesting_client.rb +418 -0
- data/lib/algolia/api/analytics_client.rb +1294 -0
- data/lib/algolia/api/ingestion_client.rb +1659 -0
- data/lib/algolia/api/insights_client.rb +252 -0
- data/lib/algolia/api/monitoring_client.rb +555 -0
- data/lib/algolia/api/personalization_client.rb +365 -0
- data/lib/algolia/api/query_suggestions_client.rb +491 -0
- data/lib/algolia/api/recommend_client.rb +460 -0
- data/lib/algolia/api/search_client.rb +2723 -0
- data/lib/algolia/api_client.rb +153 -0
- data/lib/algolia/api_error.rb +48 -0
- data/lib/algolia/configuration.rb +41 -0
- data/lib/algolia/logger_helper.rb +1 -1
- data/lib/algolia/models/abtesting/ab_test.rb +332 -0
- data/lib/algolia/models/abtesting/ab_test_response.rb +219 -0
- data/lib/algolia/models/abtesting/ab_tests_variant.rb +217 -0
- data/lib/algolia/models/abtesting/ab_tests_variant_search_params.rb +236 -0
- data/lib/algolia/models/abtesting/add_ab_tests_request.rb +239 -0
- data/lib/algolia/models/abtesting/add_ab_tests_variant.rb +96 -0
- data/lib/algolia/models/abtesting/currencies_value.rb +223 -0
- data/lib/algolia/models/abtesting/custom_search_params.rb +195 -0
- data/lib/algolia/models/abtesting/error_base.rb +196 -0
- data/lib/algolia/models/abtesting/filter_effects.rb +202 -0
- data/lib/algolia/models/abtesting/filter_effects_empty_search.rb +204 -0
- data/lib/algolia/models/abtesting/filter_effects_outliers.rb +204 -0
- data/lib/algolia/models/abtesting/list_ab_tests_response.rb +221 -0
- data/lib/algolia/models/abtesting/variant.rb +399 -0
- data/lib/algolia/models/analytics/average_click_event.rb +219 -0
- data/lib/algolia/models/analytics/click_position.rb +209 -0
- data/lib/algolia/models/analytics/click_through_rate_event.rb +249 -0
- data/lib/algolia/models/analytics/conversion_rate_event.rb +249 -0
- data/lib/algolia/models/analytics/direction.rb +33 -0
- data/lib/algolia/models/analytics/error_base.rb +196 -0
- data/lib/algolia/models/analytics/get_average_click_position_response.rb +221 -0
- data/lib/algolia/models/analytics/get_click_positions_response.rb +215 -0
- data/lib/algolia/models/analytics/get_click_through_rate_response.rb +251 -0
- data/lib/algolia/models/analytics/get_conversation_rate_response.rb +251 -0
- data/lib/algolia/models/analytics/get_no_click_rate_response.rb +251 -0
- data/lib/algolia/models/analytics/get_no_results_rate_response.rb +251 -0
- data/lib/algolia/models/analytics/get_searches_count_response.rb +209 -0
- data/lib/algolia/models/analytics/get_searches_no_clicks_response.rb +197 -0
- data/lib/algolia/models/analytics/get_searches_no_results_response.rb +197 -0
- data/lib/algolia/models/analytics/get_status_response.rb +195 -0
- data/lib/algolia/models/analytics/get_top_countries_response.rb +197 -0
- data/lib/algolia/models/analytics/get_top_filter_attribute.rb +207 -0
- data/lib/algolia/models/analytics/get_top_filter_attributes_response.rb +197 -0
- data/lib/algolia/models/analytics/get_top_filter_for_attribute.rb +231 -0
- data/lib/algolia/models/analytics/get_top_filter_for_attribute_response.rb +197 -0
- data/lib/algolia/models/analytics/get_top_filters_no_results_response.rb +197 -0
- data/lib/algolia/models/analytics/get_top_filters_no_results_value.rb +219 -0
- data/lib/algolia/models/analytics/get_top_filters_no_results_values.rb +209 -0
- data/lib/algolia/models/analytics/get_top_hits_response.rb +96 -0
- data/lib/algolia/models/analytics/get_top_searches_response.rb +96 -0
- data/lib/algolia/models/analytics/get_users_count_response.rb +209 -0
- data/lib/algolia/models/analytics/no_click_rate_event.rb +249 -0
- data/lib/algolia/models/analytics/no_results_rate_event.rb +249 -0
- data/lib/algolia/models/analytics/order_by.rb +35 -0
- data/lib/algolia/models/analytics/search_event.rb +207 -0
- data/lib/algolia/models/analytics/search_no_click_event.rb +219 -0
- data/lib/algolia/models/analytics/search_no_result_event.rb +219 -0
- data/lib/algolia/models/analytics/top_country.rb +207 -0
- data/lib/algolia/models/analytics/top_hit.rb +207 -0
- data/lib/algolia/models/analytics/top_hit_with_analytics.rb +285 -0
- data/lib/algolia/models/analytics/top_hits_response.rb +197 -0
- data/lib/algolia/models/analytics/top_hits_response_with_analytics.rb +197 -0
- data/lib/algolia/models/analytics/top_search.rb +219 -0
- data/lib/algolia/models/analytics/top_search_with_analytics.rb +309 -0
- data/lib/algolia/models/analytics/top_searches_response.rb +197 -0
- data/lib/algolia/models/analytics/top_searches_response_with_analytics.rb +197 -0
- data/lib/algolia/models/analytics/user_with_date.rb +207 -0
- data/lib/algolia/models/ingestion/action_type.rb +34 -0
- data/lib/algolia/models/ingestion/auth_algolia.rb +207 -0
- data/lib/algolia/models/ingestion/auth_algolia_partial.rb +203 -0
- data/lib/algolia/models/ingestion/auth_api_key.rb +195 -0
- data/lib/algolia/models/ingestion/auth_api_key_partial.rb +193 -0
- data/lib/algolia/models/ingestion/auth_basic.rb +206 -0
- data/lib/algolia/models/ingestion/auth_basic_partial.rb +202 -0
- data/lib/algolia/models/ingestion/auth_google_service_account.rb +208 -0
- data/lib/algolia/models/ingestion/auth_google_service_account_partial.rb +204 -0
- data/lib/algolia/models/ingestion/auth_input.rb +99 -0
- data/lib/algolia/models/ingestion/auth_input_partial.rb +99 -0
- data/lib/algolia/models/ingestion/auth_o_auth.rb +220 -0
- data/lib/algolia/models/ingestion/auth_o_auth_partial.rb +214 -0
- data/lib/algolia/models/ingestion/authentication.rb +283 -0
- data/lib/algolia/models/ingestion/authentication_create.rb +249 -0
- data/lib/algolia/models/ingestion/authentication_create_response.rb +220 -0
- data/lib/algolia/models/ingestion/authentication_search.rb +197 -0
- data/lib/algolia/models/ingestion/authentication_sort_keys.rb +36 -0
- data/lib/algolia/models/ingestion/authentication_type.rb +36 -0
- data/lib/algolia/models/ingestion/authentication_update.rb +243 -0
- data/lib/algolia/models/ingestion/authentication_update_response.rb +220 -0
- data/lib/algolia/models/ingestion/big_commerce_channel.rb +207 -0
- data/lib/algolia/models/ingestion/big_commerce_metafield.rb +207 -0
- data/lib/algolia/models/ingestion/big_query_data_type.rb +33 -0
- data/lib/algolia/models/ingestion/delete_response.rb +195 -0
- data/lib/algolia/models/ingestion/destination.rb +283 -0
- data/lib/algolia/models/ingestion/destination_create.rb +250 -0
- data/lib/algolia/models/ingestion/destination_create_response.rb +220 -0
- data/lib/algolia/models/ingestion/destination_index_name.rb +238 -0
- data/lib/algolia/models/ingestion/destination_index_prefix.rb +195 -0
- data/lib/algolia/models/ingestion/destination_input.rb +96 -0
- data/lib/algolia/models/ingestion/destination_search.rb +197 -0
- data/lib/algolia/models/ingestion/destination_sort_keys.rb +35 -0
- data/lib/algolia/models/ingestion/destination_type.rb +34 -0
- data/lib/algolia/models/ingestion/destination_update.rb +243 -0
- data/lib/algolia/models/ingestion/destination_update_response.rb +220 -0
- data/lib/algolia/models/ingestion/docker_image_type.rb +34 -0
- data/lib/algolia/models/ingestion/docker_registry.rb +33 -0
- data/lib/algolia/models/ingestion/docker_source_discover.rb +207 -0
- data/lib/algolia/models/ingestion/docker_source_streams.rb +196 -0
- data/lib/algolia/models/ingestion/error_base.rb +196 -0
- data/lib/algolia/models/ingestion/event.rb +311 -0
- data/lib/algolia/models/ingestion/event_sort_keys.rb +34 -0
- data/lib/algolia/models/ingestion/event_status.rb +37 -0
- data/lib/algolia/models/ingestion/event_type.rb +35 -0
- data/lib/algolia/models/ingestion/list_authentications_response.rb +207 -0
- data/lib/algolia/models/ingestion/list_destinations_response.rb +207 -0
- data/lib/algolia/models/ingestion/list_events_response.rb +218 -0
- data/lib/algolia/models/ingestion/list_sources_response.rb +207 -0
- data/lib/algolia/models/ingestion/list_tasks_response.rb +208 -0
- data/lib/algolia/models/ingestion/mapping_type_csv.rb +36 -0
- data/lib/algolia/models/ingestion/method_type.rb +33 -0
- data/lib/algolia/models/ingestion/on_demand_date_utils_input.rb +208 -0
- data/lib/algolia/models/ingestion/on_demand_trigger.rb +227 -0
- data/lib/algolia/models/ingestion/on_demand_trigger_input.rb +217 -0
- data/lib/algolia/models/ingestion/on_demand_trigger_type.rb +32 -0
- data/lib/algolia/models/ingestion/order_keys.rb +33 -0
- data/lib/algolia/models/ingestion/pagination.rb +227 -0
- data/lib/algolia/models/ingestion/platform.rb +33 -0
- data/lib/algolia/models/ingestion/platform_none.rb +32 -0
- data/lib/algolia/models/ingestion/platform_with_none.rb +96 -0
- data/lib/algolia/models/ingestion/record_type.rb +33 -0
- data/lib/algolia/models/ingestion/run.rb +359 -0
- data/lib/algolia/models/ingestion/run_list_response.rb +218 -0
- data/lib/algolia/models/ingestion/run_outcome.rb +34 -0
- data/lib/algolia/models/ingestion/run_progress.rb +201 -0
- data/lib/algolia/models/ingestion/run_reason_code.rb +38 -0
- data/lib/algolia/models/ingestion/run_response.rb +208 -0
- data/lib/algolia/models/ingestion/run_sort_keys.rb +34 -0
- data/lib/algolia/models/ingestion/run_status.rb +36 -0
- data/lib/algolia/models/ingestion/run_type.rb +34 -0
- data/lib/algolia/models/ingestion/schedule_date_utils_input.rb +214 -0
- data/lib/algolia/models/ingestion/schedule_trigger.rb +251 -0
- data/lib/algolia/models/ingestion/schedule_trigger_input.rb +229 -0
- data/lib/algolia/models/ingestion/schedule_trigger_type.rb +32 -0
- data/lib/algolia/models/ingestion/source.rb +282 -0
- data/lib/algolia/models/ingestion/source_big_commerce.rb +235 -0
- data/lib/algolia/models/ingestion/source_big_query.rb +278 -0
- data/lib/algolia/models/ingestion/source_commercetools.rb +238 -0
- data/lib/algolia/models/ingestion/source_create.rb +248 -0
- data/lib/algolia/models/ingestion/source_create_response.rb +218 -0
- data/lib/algolia/models/ingestion/source_csv.rb +276 -0
- data/lib/algolia/models/ingestion/source_docker.rb +261 -0
- data/lib/algolia/models/ingestion/source_input.rb +100 -0
- data/lib/algolia/models/ingestion/source_json.rb +236 -0
- data/lib/algolia/models/ingestion/source_search.rb +196 -0
- data/lib/algolia/models/ingestion/source_sort_keys.rb +35 -0
- data/lib/algolia/models/ingestion/source_type.rb +37 -0
- data/lib/algolia/models/ingestion/source_update.rb +211 -0
- data/lib/algolia/models/ingestion/source_update_commercetools.rb +207 -0
- data/lib/algolia/models/ingestion/source_update_docker.rb +246 -0
- data/lib/algolia/models/ingestion/source_update_input.rb +99 -0
- data/lib/algolia/models/ingestion/source_update_response.rb +218 -0
- data/lib/algolia/models/ingestion/subscription_trigger.rb +217 -0
- data/lib/algolia/models/ingestion/subscription_trigger_type.rb +32 -0
- data/lib/algolia/models/ingestion/task.rb +334 -0
- data/lib/algolia/models/ingestion/task_create.rb +299 -0
- data/lib/algolia/models/ingestion/task_create_response.rb +208 -0
- data/lib/algolia/models/ingestion/task_create_trigger.rb +97 -0
- data/lib/algolia/models/ingestion/task_input.rb +96 -0
- data/lib/algolia/models/ingestion/task_search.rb +196 -0
- data/lib/algolia/models/ingestion/task_sort_keys.rb +36 -0
- data/lib/algolia/models/ingestion/task_update.rb +250 -0
- data/lib/algolia/models/ingestion/task_update_response.rb +208 -0
- data/lib/algolia/models/ingestion/trigger.rb +97 -0
- data/lib/algolia/models/ingestion/trigger_type.rb +34 -0
- data/lib/algolia/models/ingestion/trigger_update_input.rb +196 -0
- data/lib/algolia/models/ingestion/window.rb +208 -0
- data/lib/algolia/models/insights/add_to_cart_event.rb +32 -0
- data/lib/algolia/models/insights/added_to_cart_object_ids.rb +384 -0
- data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +419 -0
- data/lib/algolia/models/insights/click_event.rb +32 -0
- data/lib/algolia/models/insights/clicked_filters.rb +351 -0
- data/lib/algolia/models/insights/clicked_object_ids.rb +341 -0
- data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +418 -0
- data/lib/algolia/models/insights/conversion_event.rb +32 -0
- data/lib/algolia/models/insights/converted_filters.rb +350 -0
- data/lib/algolia/models/insights/converted_object_ids.rb +351 -0
- data/lib/algolia/models/insights/converted_object_ids_after_search.rb +386 -0
- data/lib/algolia/models/insights/discount.rb +97 -0
- data/lib/algolia/models/insights/error_base.rb +196 -0
- data/lib/algolia/models/insights/events_items.rb +106 -0
- data/lib/algolia/models/insights/events_response.rb +204 -0
- data/lib/algolia/models/insights/insights_events.rb +215 -0
- data/lib/algolia/models/insights/object_data.rb +211 -0
- data/lib/algolia/models/insights/object_data_after_search.rb +221 -0
- data/lib/algolia/models/insights/price.rb +97 -0
- data/lib/algolia/models/insights/purchase_event.rb +32 -0
- data/lib/algolia/models/insights/purchased_object_ids.rb +384 -0
- data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +419 -0
- data/lib/algolia/models/insights/view_event.rb +32 -0
- data/lib/algolia/models/insights/viewed_filters.rb +351 -0
- data/lib/algolia/models/insights/viewed_object_ids.rb +351 -0
- data/lib/algolia/models/monitoring/error_base.rb +196 -0
- data/lib/algolia/models/monitoring/get_inventory403_response.rb +192 -0
- data/lib/algolia/models/monitoring/incident.rb +225 -0
- data/lib/algolia/models/monitoring/incidents_inner.rb +202 -0
- data/lib/algolia/models/monitoring/incidents_response.rb +194 -0
- data/lib/algolia/models/monitoring/indexing_time_response.rb +192 -0
- data/lib/algolia/models/monitoring/indexing_time_response_metrics.rb +194 -0
- data/lib/algolia/models/monitoring/infrastructure_response.rb +192 -0
- data/lib/algolia/models/monitoring/infrastructure_response_metrics.rb +243 -0
- data/lib/algolia/models/monitoring/inventory_response.rb +194 -0
- data/lib/algolia/models/monitoring/latency_response.rb +192 -0
- data/lib/algolia/models/monitoring/latency_response_metrics.rb +194 -0
- data/lib/algolia/models/monitoring/metric.rb +37 -0
- data/lib/algolia/models/monitoring/period.rb +36 -0
- data/lib/algolia/models/monitoring/probes_metric.rb +203 -0
- data/lib/algolia/models/monitoring/region.rb +46 -0
- data/lib/algolia/models/monitoring/server.rb +272 -0
- data/lib/algolia/models/monitoring/server_status.rb +32 -0
- data/lib/algolia/models/monitoring/status.rb +35 -0
- data/lib/algolia/models/monitoring/status_response.rb +194 -0
- data/lib/algolia/models/monitoring/time_inner.rb +203 -0
- data/lib/algolia/models/monitoring/type.rb +32 -0
- data/lib/algolia/models/personalization/delete_user_profile_response.rb +207 -0
- data/lib/algolia/models/personalization/error_base.rb +196 -0
- data/lib/algolia/models/personalization/event_scoring.rb +219 -0
- data/lib/algolia/models/personalization/facet_scoring.rb +207 -0
- data/lib/algolia/models/personalization/get_user_token_response.rb +219 -0
- data/lib/algolia/models/personalization/personalization_strategy_params.rb +223 -0
- data/lib/algolia/models/personalization/set_personalization_strategy_response.rb +195 -0
- data/lib/algolia/models/query-suggestions/base_query_suggestions_configuration_response.rb +223 -0
- data/lib/algolia/models/query-suggestions/base_query_suggestions_configuration_with_index.rb +195 -0
- data/lib/algolia/models/query-suggestions/base_response.rb +203 -0
- data/lib/algolia/models/query-suggestions/error_base.rb +196 -0
- data/lib/algolia/models/query-suggestions/facet.rb +204 -0
- data/lib/algolia/models/query-suggestions/get_config_status200_response.rb +233 -0
- data/lib/algolia/models/query-suggestions/get_log_file200_response.rb +244 -0
- data/lib/algolia/models/query-suggestions/languages.rb +97 -0
- data/lib/algolia/models/query-suggestions/log_level.rb +34 -0
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration.rb +255 -0
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_response.rb +315 -0
- data/lib/algolia/models/query-suggestions/query_suggestions_configuration_with_index.rb +275 -0
- data/lib/algolia/models/query-suggestions/source_index.rb +305 -0
- data/lib/algolia/models/recommend/advanced_syntax_features.rb +33 -0
- data/lib/algolia/models/recommend/alternatives_as_exact.rb +34 -0
- data/lib/algolia/models/recommend/anchoring.rb +35 -0
- data/lib/algolia/models/recommend/around_precision.rb +97 -0
- data/lib/algolia/models/recommend/around_precision_from_value_inner.rb +201 -0
- data/lib/algolia/models/recommend/around_radius.rb +97 -0
- data/lib/algolia/models/recommend/around_radius_all.rb +32 -0
- data/lib/algolia/models/recommend/automatic_facet_filter.rb +216 -0
- data/lib/algolia/models/recommend/automatic_facet_filters.rb +97 -0
- data/lib/algolia/models/recommend/base_recommend_request.rb +233 -0
- data/lib/algolia/models/recommend/base_recommendations_query.rb +246 -0
- data/lib/algolia/models/recommend/base_recommended_for_you_query.rb +234 -0
- data/lib/algolia/models/recommend/base_recommended_for_you_query_parameters.rb +195 -0
- data/lib/algolia/models/recommend/base_search_params.rb +564 -0
- data/lib/algolia/models/recommend/base_search_params_without_query.rb +546 -0
- data/lib/algolia/models/recommend/base_search_response.rb +517 -0
- data/lib/algolia/models/recommend/base_trending_facets_query.rb +226 -0
- data/lib/algolia/models/recommend/base_trending_items_query.rb +252 -0
- data/lib/algolia/models/recommend/condition.rb +244 -0
- data/lib/algolia/models/recommend/consequence.rb +239 -0
- data/lib/algolia/models/recommend/consequence_hide.rb +196 -0
- data/lib/algolia/models/recommend/consequence_params.rb +1121 -0
- data/lib/algolia/models/recommend/consequence_query.rb +97 -0
- data/lib/algolia/models/recommend/consequence_query_object.rb +207 -0
- data/lib/algolia/models/recommend/deleted_at_response.rb +208 -0
- data/lib/algolia/models/recommend/distinct.rb +97 -0
- data/lib/algolia/models/recommend/edit.rb +234 -0
- data/lib/algolia/models/recommend/edit_type.rb +33 -0
- data/lib/algolia/models/recommend/error_base.rb +196 -0
- data/lib/algolia/models/recommend/exact_on_single_word_query.rb +34 -0
- data/lib/algolia/models/recommend/exhaustive.rb +234 -0
- data/lib/algolia/models/recommend/facet_filters.rb +97 -0
- data/lib/algolia/models/recommend/facet_ordering.rb +205 -0
- data/lib/algolia/models/recommend/facets.rb +196 -0
- data/lib/algolia/models/recommend/facets_stats.rb +223 -0
- data/lib/algolia/models/recommend/get_recommend_task_response.rb +216 -0
- data/lib/algolia/models/recommend/get_recommendations_params.rb +198 -0
- data/lib/algolia/models/recommend/get_recommendations_response.rb +194 -0
- data/lib/algolia/models/recommend/highlight_result.rb +96 -0
- data/lib/algolia/models/recommend/highlight_result_option.rb +253 -0
- data/lib/algolia/models/recommend/ignore_plurals.rb +97 -0
- data/lib/algolia/models/recommend/index_settings_as_search_params.rb +723 -0
- data/lib/algolia/models/recommend/match_level.rb +34 -0
- data/lib/algolia/models/recommend/matched_geo_location.rb +213 -0
- data/lib/algolia/models/recommend/mixed_search_filters.rb +96 -0
- data/lib/algolia/models/recommend/mode.rb +33 -0
- data/lib/algolia/models/recommend/numeric_filters.rb +97 -0
- data/lib/algolia/models/recommend/optional_filters.rb +97 -0
- data/lib/algolia/models/recommend/params.rb +220 -0
- data/lib/algolia/models/recommend/personalization.rb +213 -0
- data/lib/algolia/models/recommend/promote.rb +96 -0
- data/lib/algolia/models/recommend/promote_object_id.rb +208 -0
- data/lib/algolia/models/recommend/promote_object_ids.rb +210 -0
- data/lib/algolia/models/recommend/query_type.rb +34 -0
- data/lib/algolia/models/recommend/ranking_info.rb +328 -0
- data/lib/algolia/models/recommend/re_ranking_apply_filter.rb +97 -0
- data/lib/algolia/models/recommend/recommend_hit.rb +271 -0
- data/lib/algolia/models/recommend/recommend_models.rb +35 -0
- data/lib/algolia/models/recommend/recommendation_models.rb +33 -0
- data/lib/algolia/models/recommend/recommendations_hit.rb +96 -0
- data/lib/algolia/models/recommend/recommendations_hits.rb +216 -0
- data/lib/algolia/models/recommend/recommendations_query.rb +304 -0
- data/lib/algolia/models/recommend/recommendations_request.rb +98 -0
- data/lib/algolia/models/recommend/recommendations_results.rb +553 -0
- data/lib/algolia/models/recommend/recommended_for_you_model.rb +32 -0
- data/lib/algolia/models/recommend/recommended_for_you_query.rb +292 -0
- data/lib/algolia/models/recommend/recommended_for_you_query_parameters.rb +1105 -0
- data/lib/algolia/models/recommend/redirect.rb +195 -0
- data/lib/algolia/models/recommend/redirect_rule_index_metadata.rb +242 -0
- data/lib/algolia/models/recommend/redirect_rule_index_metadata_data.rb +195 -0
- data/lib/algolia/models/recommend/remove_stop_words.rb +97 -0
- data/lib/algolia/models/recommend/remove_words_if_no_results.rb +35 -0
- data/lib/algolia/models/recommend/rendering_content.rb +193 -0
- data/lib/algolia/models/recommend/rule_response.rb +246 -0
- data/lib/algolia/models/recommend/rule_response_metadata.rb +193 -0
- data/lib/algolia/models/recommend/search_params_object.rb +1103 -0
- data/lib/algolia/models/recommend/search_params_query.rb +193 -0
- data/lib/algolia/models/recommend/search_recommend_rules_params.rb +268 -0
- data/lib/algolia/models/recommend/search_recommend_rules_response.rb +233 -0
- data/lib/algolia/models/recommend/semantic_search.rb +198 -0
- data/lib/algolia/models/recommend/snippet_result.rb +96 -0
- data/lib/algolia/models/recommend/snippet_result_option.rb +229 -0
- data/lib/algolia/models/recommend/sort_remaining_by.rb +34 -0
- data/lib/algolia/models/recommend/tag_filters.rb +97 -0
- data/lib/algolia/models/recommend/task_status.rb +33 -0
- data/lib/algolia/models/recommend/trending_facet_hit.rb +238 -0
- data/lib/algolia/models/recommend/trending_facets_model.rb +32 -0
- data/lib/algolia/models/recommend/trending_facets_query.rb +284 -0
- data/lib/algolia/models/recommend/trending_items_model.rb +32 -0
- data/lib/algolia/models/recommend/trending_items_query.rb +310 -0
- data/lib/algolia/models/recommend/typo_tolerance.rb +97 -0
- data/lib/algolia/models/recommend/typo_tolerance_enum.rb +33 -0
- data/lib/algolia/models/recommend/value.rb +226 -0
- data/lib/algolia/models/search/acl.rb +47 -0
- data/lib/algolia/models/search/action.rb +38 -0
- data/lib/algolia/models/search/add_api_key_response.rb +207 -0
- data/lib/algolia/models/search/advanced_syntax_features.rb +33 -0
- data/lib/algolia/models/search/alternatives_as_exact.rb +34 -0
- data/lib/algolia/models/search/anchoring.rb +35 -0
- data/lib/algolia/models/search/api_key.rb +272 -0
- data/lib/algolia/models/search/around_precision.rb +97 -0
- data/lib/algolia/models/search/around_precision_from_value_inner.rb +201 -0
- data/lib/algolia/models/search/around_radius.rb +97 -0
- data/lib/algolia/models/search/around_radius_all.rb +32 -0
- data/lib/algolia/models/search/assign_user_id_params.rb +196 -0
- data/lib/algolia/models/search/attribute_to_update.rb +96 -0
- data/lib/algolia/models/search/automatic_facet_filter.rb +216 -0
- data/lib/algolia/models/search/automatic_facet_filters.rb +97 -0
- data/lib/algolia/models/search/base_get_api_key_response.rb +205 -0
- data/lib/algolia/models/search/base_index_settings.rb +366 -0
- data/lib/algolia/models/search/base_search_params.rb +564 -0
- data/lib/algolia/models/search/base_search_params_without_query.rb +546 -0
- data/lib/algolia/models/search/base_search_response.rb +517 -0
- data/lib/algolia/models/search/batch_assign_user_ids_params.rb +210 -0
- data/lib/algolia/models/search/batch_dictionary_entries_params.rb +208 -0
- data/lib/algolia/models/search/batch_dictionary_entries_request.rb +227 -0
- data/lib/algolia/models/search/batch_params.rb +197 -0
- data/lib/algolia/models/search/batch_request.rb +228 -0
- data/lib/algolia/models/search/batch_response.rb +209 -0
- data/lib/algolia/models/search/batch_write_params.rb +197 -0
- data/lib/algolia/models/search/browse_params.rb +96 -0
- data/lib/algolia/models/search/browse_params_object.rb +1113 -0
- data/lib/algolia/models/search/browse_response.rb +568 -0
- data/lib/algolia/models/search/built_in_operation.rb +229 -0
- data/lib/algolia/models/search/built_in_operation_type.rb +38 -0
- data/lib/algolia/models/search/condition.rb +244 -0
- data/lib/algolia/models/search/consequence.rb +239 -0
- data/lib/algolia/models/search/consequence_hide.rb +196 -0
- data/lib/algolia/models/search/consequence_params.rb +1121 -0
- data/lib/algolia/models/search/consequence_query.rb +97 -0
- data/lib/algolia/models/search/consequence_query_object.rb +207 -0
- data/lib/algolia/models/search/created_at_response.rb +196 -0
- data/lib/algolia/models/search/cursor.rb +193 -0
- data/lib/algolia/models/search/delete_api_key_response.rb +195 -0
- data/lib/algolia/models/search/delete_by_params.rb +263 -0
- data/lib/algolia/models/search/delete_source_response.rb +195 -0
- data/lib/algolia/models/search/deleted_at_response.rb +208 -0
- data/lib/algolia/models/search/dictionary_action.rb +33 -0
- data/lib/algolia/models/search/dictionary_entry.rb +276 -0
- data/lib/algolia/models/search/dictionary_entry_state.rb +33 -0
- data/lib/algolia/models/search/dictionary_language.rb +194 -0
- data/lib/algolia/models/search/dictionary_settings_params.rb +195 -0
- data/lib/algolia/models/search/dictionary_type.rb +34 -0
- data/lib/algolia/models/search/distinct.rb +97 -0
- data/lib/algolia/models/search/edit.rb +234 -0
- data/lib/algolia/models/search/edit_type.rb +33 -0
- data/lib/algolia/models/search/error_base.rb +196 -0
- data/lib/algolia/models/search/exact_on_single_word_query.rb +34 -0
- data/lib/algolia/models/search/exhaustive.rb +234 -0
- data/lib/algolia/models/search/facet_filters.rb +97 -0
- data/lib/algolia/models/search/facet_hits.rb +219 -0
- data/lib/algolia/models/search/facet_ordering.rb +205 -0
- data/lib/algolia/models/search/facets.rb +196 -0
- data/lib/algolia/models/search/facets_stats.rb +223 -0
- data/lib/algolia/models/search/fetched_index.rb +313 -0
- data/lib/algolia/models/search/get_api_key_response.rb +301 -0
- data/lib/algolia/models/search/get_dictionary_settings_response.rb +194 -0
- data/lib/algolia/models/search/get_logs_response.rb +196 -0
- data/lib/algolia/models/search/get_objects_params.rb +197 -0
- data/lib/algolia/models/search/get_objects_request.rb +220 -0
- data/lib/algolia/models/search/get_objects_response.rb +197 -0
- data/lib/algolia/models/search/get_task_response.rb +216 -0
- data/lib/algolia/models/search/get_top_user_ids_response.rb +198 -0
- data/lib/algolia/models/search/has_pending_mappings_response.rb +207 -0
- data/lib/algolia/models/search/highlight_result.rb +96 -0
- data/lib/algolia/models/search/highlight_result_option.rb +253 -0
- data/lib/algolia/models/search/hit.rb +241 -0
- data/lib/algolia/models/search/ignore_plurals.rb +97 -0
- data/lib/algolia/models/search/index_settings.rb +912 -0
- data/lib/algolia/models/search/index_settings_as_search_params.rb +723 -0
- data/lib/algolia/models/search/languages.rb +221 -0
- data/lib/algolia/models/search/list_api_keys_response.rb +197 -0
- data/lib/algolia/models/search/list_clusters_response.rb +198 -0
- data/lib/algolia/models/search/list_indices_response.rb +207 -0
- data/lib/algolia/models/search/list_user_ids_response.rb +198 -0
- data/lib/algolia/models/search/log.rb +358 -0
- data/lib/algolia/models/search/log_query.rb +213 -0
- data/lib/algolia/models/search/log_type.rb +35 -0
- data/lib/algolia/models/search/match_level.rb +34 -0
- data/lib/algolia/models/search/matched_geo_location.rb +213 -0
- data/lib/algolia/models/search/mixed_search_filters.rb +96 -0
- data/lib/algolia/models/search/mode.rb +33 -0
- data/lib/algolia/models/search/multiple_batch_request.rb +240 -0
- data/lib/algolia/models/search/multiple_batch_response.rb +211 -0
- data/lib/algolia/models/search/numeric_filters.rb +97 -0
- data/lib/algolia/models/search/operation_index_params.rb +240 -0
- data/lib/algolia/models/search/operation_type.rb +33 -0
- data/lib/algolia/models/search/optional_filters.rb +97 -0
- data/lib/algolia/models/search/params.rb +220 -0
- data/lib/algolia/models/search/personalization.rb +213 -0
- data/lib/algolia/models/search/promote.rb +96 -0
- data/lib/algolia/models/search/promote_object_id.rb +208 -0
- data/lib/algolia/models/search/promote_object_ids.rb +210 -0
- data/lib/algolia/models/search/query_type.rb +34 -0
- data/lib/algolia/models/search/ranking_info.rb +328 -0
- data/lib/algolia/models/search/re_ranking_apply_filter.rb +97 -0
- data/lib/algolia/models/search/redirect.rb +195 -0
- data/lib/algolia/models/search/redirect_rule_index_metadata.rb +242 -0
- data/lib/algolia/models/search/redirect_rule_index_metadata_data.rb +195 -0
- data/lib/algolia/models/search/remove_stop_words.rb +97 -0
- data/lib/algolia/models/search/remove_user_id_response.rb +195 -0
- data/lib/algolia/models/search/remove_words_if_no_results.rb +35 -0
- data/lib/algolia/models/search/rendering_content.rb +193 -0
- data/lib/algolia/models/search/replace_source_response.rb +195 -0
- data/lib/algolia/models/search/rule.rb +249 -0
- data/lib/algolia/models/search/save_object_response.rb +217 -0
- data/lib/algolia/models/search/save_synonym_response.rb +219 -0
- data/lib/algolia/models/search/scope_type.rb +34 -0
- data/lib/algolia/models/search/search_dictionary_entries_params.rb +244 -0
- data/lib/algolia/models/search/search_for_facet_values_request.rb +227 -0
- data/lib/algolia/models/search/search_for_facet_values_response.rb +218 -0
- data/lib/algolia/models/search/search_for_facets.rb +1158 -0
- data/lib/algolia/models/search/search_for_facets_options.rb +274 -0
- data/lib/algolia/models/search/search_for_hits.rb +1134 -0
- data/lib/algolia/models/search/search_for_hits_options.rb +226 -0
- data/lib/algolia/models/search/search_hits.rb +223 -0
- data/lib/algolia/models/search/search_method_params.rb +227 -0
- data/lib/algolia/models/search/search_params.rb +96 -0
- data/lib/algolia/models/search/search_params_object.rb +1103 -0
- data/lib/algolia/models/search/search_params_query.rb +193 -0
- data/lib/algolia/models/search/search_params_string.rb +193 -0
- data/lib/algolia/models/search/search_query.rb +96 -0
- data/lib/algolia/models/search/search_response.rb +560 -0
- data/lib/algolia/models/search/search_responses.rb +196 -0
- data/lib/algolia/models/search/search_result.rb +96 -0
- data/lib/algolia/models/search/search_rules_params.rb +311 -0
- data/lib/algolia/models/search/search_rules_response.rb +233 -0
- data/lib/algolia/models/search/search_strategy.rb +33 -0
- data/lib/algolia/models/search/search_synonyms_params.rb +193 -0
- data/lib/algolia/models/search/search_synonyms_response.rb +212 -0
- data/lib/algolia/models/search/search_type_default.rb +32 -0
- data/lib/algolia/models/search/search_type_facet.rb +32 -0
- data/lib/algolia/models/search/search_user_ids_params.rb +244 -0
- data/lib/algolia/models/search/search_user_ids_response.rb +264 -0
- data/lib/algolia/models/search/semantic_search.rb +198 -0
- data/lib/algolia/models/search/snippet_result.rb +96 -0
- data/lib/algolia/models/search/snippet_result_option.rb +229 -0
- data/lib/algolia/models/search/sort_remaining_by.rb +34 -0
- data/lib/algolia/models/search/source.rb +206 -0
- data/lib/algolia/models/search/standard_entries.rb +224 -0
- data/lib/algolia/models/search/synonym_hit.rb +295 -0
- data/lib/algolia/models/search/synonym_type.rb +36 -0
- data/lib/algolia/models/search/tag_filters.rb +97 -0
- data/lib/algolia/models/search/task_status.rb +33 -0
- data/lib/algolia/models/search/time_range.rb +207 -0
- data/lib/algolia/models/search/typo_tolerance.rb +97 -0
- data/lib/algolia/models/search/typo_tolerance_enum.rb +33 -0
- data/lib/algolia/models/search/update_api_key_response.rb +207 -0
- data/lib/algolia/models/search/updated_at_response.rb +208 -0
- data/lib/algolia/models/search/updated_at_with_object_id_response.rb +214 -0
- data/lib/algolia/models/search/updated_rule_response.rb +219 -0
- data/lib/algolia/models/search/user_highlight_result.rb +205 -0
- data/lib/algolia/models/search/user_hit.rb +269 -0
- data/lib/algolia/models/search/user_id.rb +247 -0
- data/lib/algolia/models/search/value.rb +226 -0
- data/lib/algolia/transport/echo_requester.rb +10 -0
- data/lib/algolia/{http → transport/http}/http_requester.rb +24 -19
- data/lib/algolia/{http → transport/http}/response.rb +11 -1
- data/lib/algolia/transport/request_options.rb +19 -31
- data/lib/algolia/transport/retry_strategy.rb +5 -8
- data/lib/algolia/transport/stateful_host.rb +1 -2
- data/lib/algolia/transport/transport.rb +33 -73
- data/lib/algolia/user_agent.rb +4 -14
- data/lib/algolia/version.rb +3 -1
- data/lib/algolia.rb +23 -40
- metadata +523 -218
- data/.circleci/config.yml +0 -155
- data/.dockerignore +0 -38
- data/.github/ISSUE_TEMPLATE.md +0 -20
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -22
- data/.gitignore +0 -40
- data/.rubocop.yml +0 -189
- data/.rubocop_todo.yml +0 -14
- data/CODE_OF_CONDUCT.md +0 -74
- data/CONTRIBUTING.MD +0 -184
- data/DOCKER_README.MD +0 -89
- data/Dockerfile +0 -7
- data/LICENSE +0 -21
- data/SECURITY.md +0 -3
- data/Steepfile +0 -6
- data/bin/console +0 -21
- data/bin/setup +0 -8
- data/lib/algolia/account_client.rb +0 -65
- data/lib/algolia/analytics_client.rb +0 -105
- data/lib/algolia/config/analytics_config.rb +0 -20
- data/lib/algolia/config/base_config.rb +0 -43
- data/lib/algolia/config/insights_config.rb +0 -20
- data/lib/algolia/config/personalization_config.rb +0 -20
- data/lib/algolia/config/recommend_config.rb +0 -6
- data/lib/algolia/config/recommendation_config.rb +0 -7
- data/lib/algolia/config/search_config.rb +0 -40
- data/lib/algolia/defaults.rb +0 -35
- data/lib/algolia/helpers.rb +0 -134
- data/lib/algolia/insights_client.rb +0 -238
- data/lib/algolia/iterators/base_iterator.rb +0 -19
- data/lib/algolia/iterators/object_iterator.rb +0 -28
- data/lib/algolia/iterators/paginator_iterator.rb +0 -46
- data/lib/algolia/iterators/rule_iterator.rb +0 -9
- data/lib/algolia/iterators/synonym_iterator.rb +0 -9
- data/lib/algolia/personalization_client.rb +0 -60
- data/lib/algolia/recommend_client.rb +0 -134
- data/lib/algolia/recommendation_client.rb +0 -7
- data/lib/algolia/responses/add_api_key_response.rb +0 -38
- data/lib/algolia/responses/base_response.rb +0 -9
- data/lib/algolia/responses/delete_api_key_response.rb +0 -40
- data/lib/algolia/responses/dictionary_response.rb +0 -33
- data/lib/algolia/responses/indexing_response.rb +0 -28
- data/lib/algolia/responses/multiple_batch_indexing_response.rb +0 -29
- data/lib/algolia/responses/multiple_response.rb +0 -45
- data/lib/algolia/responses/restore_api_key_response.rb +0 -36
- data/lib/algolia/responses/update_api_key_response.rb +0 -39
- data/lib/algolia/search_client.rb +0 -791
- data/lib/algolia/search_index.rb +0 -1059
- data/renovate.json +0 -5
- data/sig/config/algolia_config.rbs +0 -24
- data/sig/config/analytics_config.rbs +0 -11
- data/sig/config/insights_config.rbs +0 -11
- data/sig/config/recommendation_config.rbs +0 -11
- data/sig/config/search_config.rbs +0 -11
- data/sig/enums/call_type.rbs +0 -5
- data/sig/helpers.rbs +0 -12
- data/sig/http/http_requester.rbs +0 -17
- data/sig/http/response.rbs +0 -14
- data/sig/interfaces/_connection.rbs +0 -16
- data/sig/iterators/base_iterator.rbs +0 -15
- data/sig/iterators/object_iterator.rbs +0 -6
- data/sig/iterators/paginator_iterator.rbs +0 -8
- data/sig/iterators/rule_iterator.rbs +0 -5
- data/sig/iterators/synonym_iterator.rbs +0 -5
- data/sig/transport/request_options.rbs +0 -33
- data/sig/transport/stateful_host.rbs +0 -21
- data/test/algolia/integration/account_client_test.rb +0 -47
- data/test/algolia/integration/analytics_client_test.rb +0 -117
- data/test/algolia/integration/base_test.rb +0 -9
- data/test/algolia/integration/insights_client_test.rb +0 -80
- data/test/algolia/integration/mocks/mock_requester.rb +0 -47
- data/test/algolia/integration/personalization_client_test.rb +0 -30
- data/test/algolia/integration/recommend_client_test.rb +0 -70
- data/test/algolia/integration/recommendation_client_test.rb +0 -30
- data/test/algolia/integration/search_client_test.rb +0 -465
- data/test/algolia/integration/search_index_test.rb +0 -729
- data/test/algolia/unit/algolia_config_test.rb +0 -16
- data/test/algolia/unit/helpers_test.rb +0 -88
- data/test/algolia/unit/http_requester_test.rb +0 -27
- data/test/algolia/unit/retry_strategy_test.rb +0 -139
- data/test/algolia/unit/user_agent_test.rb +0 -16
- data/test/test_helper.rb +0 -121
- data/upgrade_guide.md +0 -603
- /data/lib/algolia/{enums → transport}/call_type.rb +0 -0
- /data/lib/algolia/{enums → transport}/retry_outcome_type.rb +0 -0
@@ -0,0 +1,328 @@
|
|
1
|
+
# Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
require 'time'
|
5
|
+
|
6
|
+
module Algolia
|
7
|
+
module Recommend
|
8
|
+
class RankingInfo
|
9
|
+
# This field is reserved for advanced usage.
|
10
|
+
attr_accessor :filters
|
11
|
+
|
12
|
+
# Position of the most important matched attribute in the attributes to index list.
|
13
|
+
attr_accessor :first_matched_word
|
14
|
+
|
15
|
+
# Distance between the geo location in the search query and the best matching geo location in the record, divided by the geo precision (in meters).
|
16
|
+
attr_accessor :geo_distance
|
17
|
+
|
18
|
+
# Precision used when computing the geo distance, in meters.
|
19
|
+
attr_accessor :geo_precision
|
20
|
+
|
21
|
+
attr_accessor :matched_geo_location
|
22
|
+
|
23
|
+
attr_accessor :personalization
|
24
|
+
|
25
|
+
# Number of exactly matched words.
|
26
|
+
attr_accessor :nb_exact_words
|
27
|
+
|
28
|
+
# Number of typos encountered when matching the record.
|
29
|
+
attr_accessor :nb_typos
|
30
|
+
|
31
|
+
# Present and set to true if a Rule promoted the hit.
|
32
|
+
attr_accessor :promoted
|
33
|
+
|
34
|
+
# When the query contains more than one word, the sum of the distances between matched words (in meters).
|
35
|
+
attr_accessor :proximity_distance
|
36
|
+
|
37
|
+
# Custom ranking for the object, expressed as a single integer value.
|
38
|
+
attr_accessor :user_score
|
39
|
+
|
40
|
+
# Number of matched words, including prefixes and typos.
|
41
|
+
attr_accessor :words
|
42
|
+
|
43
|
+
# Wether the record are promoted by the re-ranking strategy.
|
44
|
+
attr_accessor :promoted_by_re_ranking
|
45
|
+
|
46
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
47
|
+
def self.attribute_map
|
48
|
+
{
|
49
|
+
:filters => :filters,
|
50
|
+
:first_matched_word => :firstMatchedWord,
|
51
|
+
:geo_distance => :geoDistance,
|
52
|
+
:geo_precision => :geoPrecision,
|
53
|
+
:matched_geo_location => :matchedGeoLocation,
|
54
|
+
:personalization => :personalization,
|
55
|
+
:nb_exact_words => :nbExactWords,
|
56
|
+
:nb_typos => :nbTypos,
|
57
|
+
:promoted => :promoted,
|
58
|
+
:proximity_distance => :proximityDistance,
|
59
|
+
:user_score => :userScore,
|
60
|
+
:words => :words,
|
61
|
+
:promoted_by_re_ranking => :promotedByReRanking
|
62
|
+
}
|
63
|
+
end
|
64
|
+
|
65
|
+
# Returns all the JSON keys this model knows about
|
66
|
+
def self.acceptable_attributes
|
67
|
+
attribute_map.values
|
68
|
+
end
|
69
|
+
|
70
|
+
# Attribute type mapping.
|
71
|
+
def self.types_mapping
|
72
|
+
{
|
73
|
+
:filters => :Integer,
|
74
|
+
:first_matched_word => :Integer,
|
75
|
+
:geo_distance => :Integer,
|
76
|
+
:geo_precision => :Integer,
|
77
|
+
:matched_geo_location => :MatchedGeoLocation,
|
78
|
+
:personalization => :Personalization,
|
79
|
+
:nb_exact_words => :Integer,
|
80
|
+
:nb_typos => :Integer,
|
81
|
+
:promoted => :Boolean,
|
82
|
+
:proximity_distance => :Integer,
|
83
|
+
:user_score => :Integer,
|
84
|
+
:words => :Integer,
|
85
|
+
:promoted_by_re_ranking => :Boolean
|
86
|
+
}
|
87
|
+
end
|
88
|
+
|
89
|
+
# List of attributes with nullable: true
|
90
|
+
def self.openapi_nullable
|
91
|
+
Set.new([])
|
92
|
+
end
|
93
|
+
|
94
|
+
# Initializes the object
|
95
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
96
|
+
def initialize(attributes = {})
|
97
|
+
unless attributes.is_a?(Hash)
|
98
|
+
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::RankingInfo` initialize method"
|
99
|
+
end
|
100
|
+
|
101
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
102
|
+
attributes = attributes.each_with_object({}) do |(k, v), h|
|
103
|
+
unless self.class.attribute_map.key?(k.to_sym)
|
104
|
+
raise ArgumentError,
|
105
|
+
"`#{k}` is not a valid attribute in `Algolia::RankingInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
106
|
+
end
|
107
|
+
|
108
|
+
h[k.to_sym] = v
|
109
|
+
end
|
110
|
+
|
111
|
+
if attributes.key?(:filters)
|
112
|
+
self.filters = attributes[:filters]
|
113
|
+
else
|
114
|
+
self.filters = nil
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.key?(:first_matched_word)
|
118
|
+
self.first_matched_word = attributes[:first_matched_word]
|
119
|
+
else
|
120
|
+
self.first_matched_word = nil
|
121
|
+
end
|
122
|
+
|
123
|
+
if attributes.key?(:geo_distance)
|
124
|
+
self.geo_distance = attributes[:geo_distance]
|
125
|
+
else
|
126
|
+
self.geo_distance = nil
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.key?(:geo_precision)
|
130
|
+
self.geo_precision = attributes[:geo_precision]
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.key?(:matched_geo_location)
|
134
|
+
self.matched_geo_location = attributes[:matched_geo_location]
|
135
|
+
end
|
136
|
+
|
137
|
+
if attributes.key?(:personalization)
|
138
|
+
self.personalization = attributes[:personalization]
|
139
|
+
end
|
140
|
+
|
141
|
+
if attributes.key?(:nb_exact_words)
|
142
|
+
self.nb_exact_words = attributes[:nb_exact_words]
|
143
|
+
else
|
144
|
+
self.nb_exact_words = nil
|
145
|
+
end
|
146
|
+
|
147
|
+
if attributes.key?(:nb_typos)
|
148
|
+
self.nb_typos = attributes[:nb_typos]
|
149
|
+
else
|
150
|
+
self.nb_typos = nil
|
151
|
+
end
|
152
|
+
|
153
|
+
if attributes.key?(:promoted)
|
154
|
+
self.promoted = attributes[:promoted]
|
155
|
+
else
|
156
|
+
self.promoted = nil
|
157
|
+
end
|
158
|
+
|
159
|
+
if attributes.key?(:proximity_distance)
|
160
|
+
self.proximity_distance = attributes[:proximity_distance]
|
161
|
+
end
|
162
|
+
|
163
|
+
if attributes.key?(:user_score)
|
164
|
+
self.user_score = attributes[:user_score]
|
165
|
+
else
|
166
|
+
self.user_score = nil
|
167
|
+
end
|
168
|
+
|
169
|
+
if attributes.key?(:words)
|
170
|
+
self.words = attributes[:words]
|
171
|
+
else
|
172
|
+
self.words = nil
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.key?(:promoted_by_re_ranking)
|
176
|
+
self.promoted_by_re_ranking = attributes[:promoted_by_re_ranking]
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
# Checks equality by comparing each attribute.
|
181
|
+
# @param [Object] Object to be compared
|
182
|
+
def ==(other)
|
183
|
+
return true if equal?(other)
|
184
|
+
|
185
|
+
self.class == other.class &&
|
186
|
+
filters == other.filters &&
|
187
|
+
first_matched_word == other.first_matched_word &&
|
188
|
+
geo_distance == other.geo_distance &&
|
189
|
+
geo_precision == other.geo_precision &&
|
190
|
+
matched_geo_location == other.matched_geo_location &&
|
191
|
+
personalization == other.personalization &&
|
192
|
+
nb_exact_words == other.nb_exact_words &&
|
193
|
+
nb_typos == other.nb_typos &&
|
194
|
+
promoted == other.promoted &&
|
195
|
+
proximity_distance == other.proximity_distance &&
|
196
|
+
user_score == other.user_score &&
|
197
|
+
words == other.words &&
|
198
|
+
promoted_by_re_ranking == other.promoted_by_re_ranking
|
199
|
+
end
|
200
|
+
|
201
|
+
# @see the `==` method
|
202
|
+
# @param [Object] Object to be compared
|
203
|
+
def eql?(other)
|
204
|
+
self == other
|
205
|
+
end
|
206
|
+
|
207
|
+
# Calculates hash code according to all attributes.
|
208
|
+
# @return [Integer] Hash code
|
209
|
+
def hash
|
210
|
+
[filters, first_matched_word, geo_distance, geo_precision, matched_geo_location, personalization, nb_exact_words, nb_typos, promoted, proximity_distance, user_score, words,
|
211
|
+
promoted_by_re_ranking].hash
|
212
|
+
end
|
213
|
+
|
214
|
+
# Builds the object from hash
|
215
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
216
|
+
# @return [Object] Returns the model itself
|
217
|
+
def self.build_from_hash(attributes)
|
218
|
+
return nil unless attributes.is_a?(Hash)
|
219
|
+
|
220
|
+
attributes = attributes.transform_keys(&:to_sym)
|
221
|
+
transformed_hash = {}
|
222
|
+
types_mapping.each_pair do |key, type|
|
223
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
224
|
+
transformed_hash[key.to_s] = nil
|
225
|
+
elsif type =~ /\AArray<(.*)>/i
|
226
|
+
# check to ensure the input is an array given that the attribute
|
227
|
+
# is documented as an array but the input is not
|
228
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
229
|
+
transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
|
230
|
+
end
|
231
|
+
elsif !attributes[attribute_map[key]].nil?
|
232
|
+
transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
|
233
|
+
end
|
234
|
+
end
|
235
|
+
new(transformed_hash)
|
236
|
+
end
|
237
|
+
|
238
|
+
# Deserializes the data based on type
|
239
|
+
# @param string type Data type
|
240
|
+
# @param string value Value to be deserialized
|
241
|
+
# @return [Object] Deserialized data
|
242
|
+
def self._deserialize(type, value)
|
243
|
+
case type.to_sym
|
244
|
+
when :Time
|
245
|
+
Time.parse(value)
|
246
|
+
when :Date
|
247
|
+
Date.parse(value)
|
248
|
+
when :String
|
249
|
+
value.to_s
|
250
|
+
when :Integer
|
251
|
+
value.to_i
|
252
|
+
when :Float
|
253
|
+
value.to_f
|
254
|
+
when :Boolean
|
255
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
256
|
+
true
|
257
|
+
else
|
258
|
+
false
|
259
|
+
end
|
260
|
+
when :Object
|
261
|
+
# generic object (usually a Hash), return directly
|
262
|
+
value
|
263
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
264
|
+
inner_type = Regexp.last_match[:inner_type]
|
265
|
+
value.map { |v| _deserialize(inner_type, v) }
|
266
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
267
|
+
k_type = Regexp.last_match[:k_type]
|
268
|
+
v_type = Regexp.last_match[:v_type]
|
269
|
+
{}.tap do |hash|
|
270
|
+
value.each do |k, v|
|
271
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
272
|
+
end
|
273
|
+
end
|
274
|
+
else # model
|
275
|
+
# models (e.g. Pet) or oneOf
|
276
|
+
klass = Algolia::Recommend.const_get(type)
|
277
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
278
|
+
end
|
279
|
+
end
|
280
|
+
|
281
|
+
# Returns the string representation of the object
|
282
|
+
# @return [String] String presentation of the object
|
283
|
+
def to_s
|
284
|
+
to_hash.to_s
|
285
|
+
end
|
286
|
+
|
287
|
+
# to_body is an alias to to_hash (backward compatibility)
|
288
|
+
# @return [Hash] Returns the object in the form of hash
|
289
|
+
def to_body
|
290
|
+
to_hash
|
291
|
+
end
|
292
|
+
|
293
|
+
# Returns the object in the form of hash
|
294
|
+
# @return [Hash] Returns the object in the form of hash
|
295
|
+
def to_hash
|
296
|
+
hash = {}
|
297
|
+
self.class.attribute_map.each_pair do |attr, param|
|
298
|
+
value = send(attr)
|
299
|
+
if value.nil?
|
300
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
301
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
302
|
+
end
|
303
|
+
|
304
|
+
hash[param] = _to_hash(value)
|
305
|
+
end
|
306
|
+
hash
|
307
|
+
end
|
308
|
+
|
309
|
+
# Outputs non-array value in the form of hash
|
310
|
+
# For object, use to_hash. Otherwise, just return the value
|
311
|
+
# @param [Object] value Any valid value
|
312
|
+
# @return [Hash] Returns the value in the form of hash
|
313
|
+
def _to_hash(value)
|
314
|
+
if value.is_a?(Array)
|
315
|
+
value.compact.map { |v| _to_hash(v) }
|
316
|
+
elsif value.is_a?(Hash)
|
317
|
+
{}.tap do |hash|
|
318
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
319
|
+
end
|
320
|
+
elsif value.respond_to? :to_hash
|
321
|
+
value.to_hash
|
322
|
+
else
|
323
|
+
value
|
324
|
+
end
|
325
|
+
end
|
326
|
+
end
|
327
|
+
end
|
328
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
# Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
require 'time'
|
5
|
+
|
6
|
+
module Algolia
|
7
|
+
module Recommend
|
8
|
+
# When [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/) is enabled, only records that match these filters will be affected by Dynamic Re-Ranking.
|
9
|
+
module ReRankingApplyFilter
|
10
|
+
class << self
|
11
|
+
# List of class defined in oneOf (OpenAPI v3)
|
12
|
+
def openapi_one_of
|
13
|
+
[
|
14
|
+
:'Array<MixedSearchFilters>',
|
15
|
+
:String
|
16
|
+
]
|
17
|
+
end
|
18
|
+
|
19
|
+
# Builds the object
|
20
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
21
|
+
# @return [Object] Returns the model or the data itself
|
22
|
+
def build(data)
|
23
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
24
|
+
# Note:
|
25
|
+
# - We do not attempt to check whether exactly one item matches.
|
26
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
27
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
28
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
29
|
+
# - TODO: logging when debugging is set.
|
30
|
+
openapi_one_of.each do |klass|
|
31
|
+
next if klass == :AnyType # "nullable: true"
|
32
|
+
|
33
|
+
typed_data = find_and_cast_into_type(klass, data)
|
34
|
+
return typed_data if typed_data
|
35
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
36
|
+
end
|
37
|
+
|
38
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
SchemaMismatchError = Class.new(StandardError)
|
44
|
+
|
45
|
+
# NOTE: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
46
|
+
def find_and_cast_into_type(klass, data)
|
47
|
+
return if data.nil?
|
48
|
+
|
49
|
+
case klass.to_s
|
50
|
+
when 'Boolean'
|
51
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
52
|
+
when 'Float'
|
53
|
+
return data if data.instance_of?(Float)
|
54
|
+
when 'Integer'
|
55
|
+
return data if data.instance_of?(Integer)
|
56
|
+
when 'Time'
|
57
|
+
return Time.parse(data)
|
58
|
+
when 'Date'
|
59
|
+
return Date.parse(data)
|
60
|
+
when 'String'
|
61
|
+
return data if data.instance_of?(String)
|
62
|
+
when 'Object' # "type: object"
|
63
|
+
return data if data.instance_of?(Hash)
|
64
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
65
|
+
if data.instance_of?(Array)
|
66
|
+
sub_type = Regexp.last_match[:sub_type]
|
67
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
68
|
+
end
|
69
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
70
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
71
|
+
sub_type = Regexp.last_match[:sub_type]
|
72
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
73
|
+
end
|
74
|
+
else # model
|
75
|
+
const = Algolia.const_get(klass)
|
76
|
+
if const
|
77
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
78
|
+
model = const.build(data)
|
79
|
+
else
|
80
|
+
# raise if data contains keys that are not known to the model
|
81
|
+
raise unless (data.keys - const.acceptable_attributes).empty?
|
82
|
+
|
83
|
+
model = const.build_from_hash(data)
|
84
|
+
end
|
85
|
+
|
86
|
+
return model if model
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
raise # if no match by now, raise
|
91
|
+
rescue
|
92
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,271 @@
|
|
1
|
+
# Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
require 'time'
|
5
|
+
|
6
|
+
module Algolia
|
7
|
+
module Recommend
|
8
|
+
# Recommend hit.
|
9
|
+
class RecommendHit
|
10
|
+
# Unique object identifier.
|
11
|
+
attr_accessor :object_id
|
12
|
+
|
13
|
+
# Show highlighted section and words matched on a query.
|
14
|
+
attr_accessor :_highlight_result
|
15
|
+
|
16
|
+
# Snippeted attributes show parts of the matched attributes. Only returned when attributesToSnippet is non-empty.
|
17
|
+
attr_accessor :_snippet_result
|
18
|
+
|
19
|
+
attr_accessor :_ranking_info
|
20
|
+
|
21
|
+
attr_accessor :_distinct_seq_id
|
22
|
+
|
23
|
+
# Recommendation score.
|
24
|
+
attr_accessor :_score
|
25
|
+
|
26
|
+
attr_accessor :additional_properties
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:object_id => :objectID,
|
32
|
+
:_highlight_result => :_highlightResult,
|
33
|
+
:_snippet_result => :_snippetResult,
|
34
|
+
:_ranking_info => :_rankingInfo,
|
35
|
+
:_distinct_seq_id => :_distinctSeqID,
|
36
|
+
:_score => :_score
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Returns all the JSON keys this model knows about
|
41
|
+
def self.acceptable_attributes
|
42
|
+
attribute_map.values
|
43
|
+
end
|
44
|
+
|
45
|
+
# Attribute type mapping.
|
46
|
+
def self.types_mapping
|
47
|
+
{
|
48
|
+
:object_id => :String,
|
49
|
+
:_highlight_result => :'Hash<String, HighlightResult>',
|
50
|
+
:_snippet_result => :'Hash<String, SnippetResult>',
|
51
|
+
:_ranking_info => :RankingInfo,
|
52
|
+
:_distinct_seq_id => :Integer,
|
53
|
+
:_score => :Float
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
57
|
+
# List of attributes with nullable: true
|
58
|
+
def self.openapi_nullable
|
59
|
+
Set.new([])
|
60
|
+
end
|
61
|
+
|
62
|
+
# Initializes the object
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
64
|
+
def initialize(attributes = {})
|
65
|
+
unless attributes.is_a?(Hash)
|
66
|
+
raise ArgumentError, "The input argument (attributes) must be a hash in `Algolia::RecommendHit` initialize method"
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.key?(:object_id)
|
70
|
+
self.object_id = attributes[:object_id]
|
71
|
+
else
|
72
|
+
self.object_id = nil
|
73
|
+
end
|
74
|
+
|
75
|
+
if attributes.key?(:_highlight_result)
|
76
|
+
if (value = attributes[:_highlight_result]).is_a?(Hash)
|
77
|
+
self._highlight_result = value
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
if attributes.key?(:_snippet_result)
|
82
|
+
if (value = attributes[:_snippet_result]).is_a?(Hash)
|
83
|
+
self._snippet_result = value
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
if attributes.key?(:_ranking_info)
|
88
|
+
self._ranking_info = attributes[:_ranking_info]
|
89
|
+
end
|
90
|
+
|
91
|
+
if attributes.key?(:_distinct_seq_id)
|
92
|
+
self._distinct_seq_id = attributes[:_distinct_seq_id]
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.key?(:_score)
|
96
|
+
self._score = attributes[:_score]
|
97
|
+
else
|
98
|
+
self._score = nil
|
99
|
+
end
|
100
|
+
|
101
|
+
# add extra attribute to additional_properties
|
102
|
+
self.additional_properties ||= {}
|
103
|
+
self.additional_properties.merge!(attributes.reject { |k, _| self.class.attribute_map.key?(k.to_sym) })
|
104
|
+
end
|
105
|
+
|
106
|
+
# Custom attribute writer method with validation
|
107
|
+
# @param [Object] _score Value to be assigned
|
108
|
+
def _score=(_score)
|
109
|
+
if _score.nil?
|
110
|
+
raise ArgumentError, '_score cannot be nil'
|
111
|
+
end
|
112
|
+
|
113
|
+
if _score > 100
|
114
|
+
raise ArgumentError, 'invalid value for "_score", must be smaller than or equal to 100.'
|
115
|
+
end
|
116
|
+
|
117
|
+
if _score < 0
|
118
|
+
raise ArgumentError, 'invalid value for "_score", must be greater than or equal to 0.'
|
119
|
+
end
|
120
|
+
|
121
|
+
@_score = _score
|
122
|
+
end
|
123
|
+
|
124
|
+
# Checks equality by comparing each attribute.
|
125
|
+
# @param [Object] Object to be compared
|
126
|
+
def ==(other)
|
127
|
+
return true if equal?(other)
|
128
|
+
|
129
|
+
self.class == other.class &&
|
130
|
+
object_id == other.object_id &&
|
131
|
+
_highlight_result == other._highlight_result &&
|
132
|
+
_snippet_result == other._snippet_result &&
|
133
|
+
_ranking_info == other._ranking_info &&
|
134
|
+
_distinct_seq_id == other._distinct_seq_id &&
|
135
|
+
_score == other._score
|
136
|
+
end
|
137
|
+
|
138
|
+
# @see the `==` method
|
139
|
+
# @param [Object] Object to be compared
|
140
|
+
def eql?(other)
|
141
|
+
self == other
|
142
|
+
end
|
143
|
+
|
144
|
+
# Calculates hash code according to all attributes.
|
145
|
+
# @return [Integer] Hash code
|
146
|
+
def hash
|
147
|
+
[object_id, _highlight_result, _snippet_result, _ranking_info, _distinct_seq_id, _score].hash
|
148
|
+
end
|
149
|
+
|
150
|
+
# Builds the object from hash
|
151
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
152
|
+
# @return [Object] Returns the model itself
|
153
|
+
def self.build_from_hash(attributes)
|
154
|
+
return nil unless attributes.is_a?(Hash)
|
155
|
+
|
156
|
+
attributes = attributes.transform_keys(&:to_sym)
|
157
|
+
transformed_hash = {}
|
158
|
+
types_mapping.each_pair do |key, type|
|
159
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
160
|
+
transformed_hash[key.to_s] = nil
|
161
|
+
elsif type =~ /\AArray<(.*)>/i
|
162
|
+
# check to ensure the input is an array given that the attribute
|
163
|
+
# is documented as an array but the input is not
|
164
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
165
|
+
transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
|
166
|
+
end
|
167
|
+
elsif !attributes[attribute_map[key]].nil?
|
168
|
+
transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
transformed_hash.merge!(attributes.reject { |k, _| attribute_map.key?(k.to_sym) })
|
173
|
+
new(transformed_hash)
|
174
|
+
end
|
175
|
+
|
176
|
+
# Deserializes the data based on type
|
177
|
+
# @param string type Data type
|
178
|
+
# @param string value Value to be deserialized
|
179
|
+
# @return [Object] Deserialized data
|
180
|
+
def self._deserialize(type, value)
|
181
|
+
case type.to_sym
|
182
|
+
when :Time
|
183
|
+
Time.parse(value)
|
184
|
+
when :Date
|
185
|
+
Date.parse(value)
|
186
|
+
when :String
|
187
|
+
value.to_s
|
188
|
+
when :Integer
|
189
|
+
value.to_i
|
190
|
+
when :Float
|
191
|
+
value.to_f
|
192
|
+
when :Boolean
|
193
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
194
|
+
true
|
195
|
+
else
|
196
|
+
false
|
197
|
+
end
|
198
|
+
when :Object
|
199
|
+
# generic object (usually a Hash), return directly
|
200
|
+
value
|
201
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
202
|
+
inner_type = Regexp.last_match[:inner_type]
|
203
|
+
value.map { |v| _deserialize(inner_type, v) }
|
204
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
205
|
+
k_type = Regexp.last_match[:k_type]
|
206
|
+
v_type = Regexp.last_match[:v_type]
|
207
|
+
{}.tap do |hash|
|
208
|
+
value.each do |k, v|
|
209
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
210
|
+
end
|
211
|
+
end
|
212
|
+
else # model
|
213
|
+
# models (e.g. Pet) or oneOf
|
214
|
+
klass = Algolia::Recommend.const_get(type)
|
215
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
# Returns the string representation of the object
|
220
|
+
# @return [String] String presentation of the object
|
221
|
+
def to_s
|
222
|
+
to_hash.to_s
|
223
|
+
end
|
224
|
+
|
225
|
+
# to_body is an alias to to_hash (backward compatibility)
|
226
|
+
# @return [Hash] Returns the object in the form of hash
|
227
|
+
def to_body
|
228
|
+
to_hash
|
229
|
+
end
|
230
|
+
|
231
|
+
# Returns the object in the form of hash
|
232
|
+
# @return [Hash] Returns the object in the form of hash
|
233
|
+
def to_hash
|
234
|
+
hash = {}
|
235
|
+
self.class.attribute_map.each_pair do |attr, param|
|
236
|
+
value = send(attr)
|
237
|
+
if value.nil?
|
238
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
239
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
240
|
+
end
|
241
|
+
|
242
|
+
hash[param] = _to_hash(value)
|
243
|
+
end
|
244
|
+
|
245
|
+
# also add attributes from additional_properties to hash
|
246
|
+
self.additional_properties&.each_pair do |k, v|
|
247
|
+
hash[k.to_sym] = _to_hash(v)
|
248
|
+
end
|
249
|
+
hash
|
250
|
+
end
|
251
|
+
|
252
|
+
# Outputs non-array value in the form of hash
|
253
|
+
# For object, use to_hash. Otherwise, just return the value
|
254
|
+
# @param [Object] value Any valid value
|
255
|
+
# @return [Hash] Returns the value in the form of hash
|
256
|
+
def _to_hash(value)
|
257
|
+
if value.is_a?(Array)
|
258
|
+
value.compact.map { |v| _to_hash(v) }
|
259
|
+
elsif value.is_a?(Hash)
|
260
|
+
{}.tap do |hash|
|
261
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
262
|
+
end
|
263
|
+
elsif value.respond_to? :to_hash
|
264
|
+
value.to_hash
|
265
|
+
else
|
266
|
+
value
|
267
|
+
end
|
268
|
+
end
|
269
|
+
end
|
270
|
+
end
|
271
|
+
end
|