algolia 3.10.1 → 3.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/Bug_report.yml +1 -1
- data/.github/workflows/do-not-edit-this-repository.yml +1 -1
- data/.github/workflows/release.yml +1 -1
- data/CHANGELOG.md +18 -0
- data/Gemfile.lock +1 -1
- data/lib/algolia/api/ingestion_client.rb +12 -2
- data/lib/algolia/api/search_client.rb +79 -68
- data/lib/algolia/models/abtesting/ab_test.rb +0 -5
- data/lib/algolia/models/abtesting/ab_test_configuration.rb +0 -5
- data/lib/algolia/models/abtesting/ab_test_response.rb +0 -5
- data/lib/algolia/models/abtesting/ab_tests_variant.rb +0 -5
- data/lib/algolia/models/abtesting/ab_tests_variant_search_params.rb +5 -3
- data/lib/algolia/models/abtesting/add_ab_tests_request.rb +0 -5
- data/lib/algolia/models/abtesting/add_ab_tests_variant.rb +5 -6
- data/lib/algolia/models/abtesting/currency.rb +0 -5
- data/lib/algolia/models/abtesting/empty_search.rb +0 -5
- data/lib/algolia/models/abtesting/empty_search_filter.rb +0 -5
- data/lib/algolia/models/abtesting/error_base.rb +0 -5
- data/lib/algolia/models/abtesting/estimate_ab_test_request.rb +0 -5
- data/lib/algolia/models/abtesting/estimate_ab_test_response.rb +0 -5
- data/lib/algolia/models/abtesting/estimate_configuration.rb +0 -5
- data/lib/algolia/models/abtesting/filter_effects.rb +0 -5
- data/lib/algolia/models/abtesting/list_ab_tests_response.rb +0 -5
- data/lib/algolia/models/abtesting/minimum_detectable_effect.rb +0 -5
- data/lib/algolia/models/abtesting/outliers.rb +0 -5
- data/lib/algolia/models/abtesting/outliers_filter.rb +0 -5
- data/lib/algolia/models/abtesting/schedule_ab_test_response.rb +0 -5
- data/lib/algolia/models/abtesting/schedule_ab_tests_request.rb +0 -5
- data/lib/algolia/models/abtesting/variant.rb +0 -5
- data/lib/algolia/models/analytics/click_position.rb +0 -5
- data/lib/algolia/models/analytics/currency_code.rb +0 -5
- data/lib/algolia/models/analytics/daily_add_to_cart_rates.rb +0 -5
- data/lib/algolia/models/analytics/daily_average_clicks.rb +0 -5
- data/lib/algolia/models/analytics/daily_click_through_rates.rb +0 -5
- data/lib/algolia/models/analytics/daily_conversion_rates.rb +0 -5
- data/lib/algolia/models/analytics/daily_no_click_rates.rb +0 -5
- data/lib/algolia/models/analytics/daily_no_results_rates.rb +0 -5
- data/lib/algolia/models/analytics/daily_purchase_rates.rb +0 -5
- data/lib/algolia/models/analytics/daily_revenue.rb +0 -5
- data/lib/algolia/models/analytics/daily_searches.rb +0 -5
- data/lib/algolia/models/analytics/daily_searches_no_clicks.rb +0 -5
- data/lib/algolia/models/analytics/daily_searches_no_results.rb +0 -5
- data/lib/algolia/models/analytics/daily_users.rb +0 -5
- data/lib/algolia/models/analytics/error_base.rb +0 -5
- data/lib/algolia/models/analytics/get_add_to_cart_rate_response.rb +0 -5
- data/lib/algolia/models/analytics/get_average_click_position_response.rb +0 -5
- data/lib/algolia/models/analytics/get_click_positions_response.rb +0 -5
- data/lib/algolia/models/analytics/get_click_through_rate_response.rb +0 -5
- data/lib/algolia/models/analytics/get_conversion_rate_response.rb +0 -5
- data/lib/algolia/models/analytics/get_no_click_rate_response.rb +0 -5
- data/lib/algolia/models/analytics/get_no_results_rate_response.rb +0 -5
- data/lib/algolia/models/analytics/get_purchase_rate_response.rb +0 -5
- data/lib/algolia/models/analytics/get_revenue.rb +0 -5
- data/lib/algolia/models/analytics/get_searches_count_response.rb +0 -5
- data/lib/algolia/models/analytics/get_searches_no_clicks_response.rb +0 -5
- data/lib/algolia/models/analytics/get_searches_no_results_response.rb +0 -5
- data/lib/algolia/models/analytics/get_status_response.rb +0 -5
- data/lib/algolia/models/analytics/get_top_countries_response.rb +0 -5
- data/lib/algolia/models/analytics/get_top_filter_attribute.rb +0 -5
- data/lib/algolia/models/analytics/get_top_filter_attributes_response.rb +0 -5
- data/lib/algolia/models/analytics/get_top_filter_for_attribute.rb +0 -5
- data/lib/algolia/models/analytics/get_top_filter_for_attribute_response.rb +0 -5
- data/lib/algolia/models/analytics/get_top_filters_no_results_response.rb +0 -5
- data/lib/algolia/models/analytics/get_top_filters_no_results_value.rb +0 -5
- data/lib/algolia/models/analytics/get_top_filters_no_results_values.rb +0 -5
- data/lib/algolia/models/analytics/get_top_hits_response.rb +5 -6
- data/lib/algolia/models/analytics/get_top_searches_response.rb +5 -6
- data/lib/algolia/models/analytics/get_users_count_response.rb +0 -5
- data/lib/algolia/models/analytics/top_country.rb +0 -5
- data/lib/algolia/models/analytics/top_hit.rb +0 -5
- data/lib/algolia/models/analytics/top_hit_with_analytics.rb +0 -5
- data/lib/algolia/models/analytics/top_hit_with_revenue_analytics.rb +0 -5
- data/lib/algolia/models/analytics/top_hits_response.rb +0 -5
- data/lib/algolia/models/analytics/top_hits_response_with_analytics.rb +0 -5
- data/lib/algolia/models/analytics/top_hits_response_with_revenue_analytics.rb +0 -5
- data/lib/algolia/models/analytics/top_search.rb +0 -5
- data/lib/algolia/models/analytics/top_search_with_analytics.rb +0 -5
- data/lib/algolia/models/analytics/top_search_with_revenue_analytics.rb +0 -5
- data/lib/algolia/models/analytics/top_searches_response.rb +0 -5
- data/lib/algolia/models/analytics/top_searches_response_with_analytics.rb +0 -5
- data/lib/algolia/models/analytics/top_searches_response_with_revenue_analytics.rb +0 -5
- data/lib/algolia/models/ingestion/auth_algolia.rb +0 -5
- data/lib/algolia/models/ingestion/auth_algolia_insights.rb +0 -5
- data/lib/algolia/models/ingestion/auth_algolia_insights_partial.rb +0 -5
- data/lib/algolia/models/ingestion/auth_algolia_partial.rb +0 -5
- data/lib/algolia/models/ingestion/auth_api_key.rb +5 -3
- data/lib/algolia/models/ingestion/auth_api_key_partial.rb +5 -3
- data/lib/algolia/models/ingestion/auth_basic.rb +6 -3
- data/lib/algolia/models/ingestion/auth_basic_partial.rb +5 -3
- data/lib/algolia/models/ingestion/auth_google_service_account.rb +6 -3
- data/lib/algolia/models/ingestion/auth_google_service_account_partial.rb +5 -3
- data/lib/algolia/models/ingestion/auth_input.rb +5 -6
- data/lib/algolia/models/ingestion/auth_input_partial.rb +5 -6
- data/lib/algolia/models/ingestion/auth_o_auth.rb +7 -3
- data/lib/algolia/models/ingestion/auth_o_auth_partial.rb +5 -3
- data/lib/algolia/models/ingestion/authentication.rb +0 -5
- data/lib/algolia/models/ingestion/authentication_create.rb +0 -5
- data/lib/algolia/models/ingestion/authentication_create_response.rb +0 -5
- data/lib/algolia/models/ingestion/authentication_search.rb +0 -5
- data/lib/algolia/models/ingestion/authentication_update.rb +0 -5
- data/lib/algolia/models/ingestion/authentication_update_response.rb +0 -5
- data/lib/algolia/models/ingestion/big_commerce_channel.rb +0 -5
- data/lib/algolia/models/ingestion/big_commerce_metafield.rb +0 -5
- data/lib/algolia/models/ingestion/commercetools_custom_fields.rb +0 -5
- data/lib/algolia/models/ingestion/delete_response.rb +0 -5
- data/lib/algolia/models/ingestion/destination.rb +0 -5
- data/lib/algolia/models/ingestion/destination_create.rb +0 -5
- data/lib/algolia/models/ingestion/destination_create_response.rb +0 -5
- data/lib/algolia/models/ingestion/destination_index_name.rb +0 -5
- data/lib/algolia/models/ingestion/destination_input.rb +5 -6
- data/lib/algolia/models/ingestion/destination_search.rb +0 -5
- data/lib/algolia/models/ingestion/destination_update.rb +0 -5
- data/lib/algolia/models/ingestion/destination_update_response.rb +0 -5
- data/lib/algolia/models/ingestion/docker_image_type.rb +1 -2
- data/lib/algolia/models/ingestion/docker_streams.rb +0 -5
- data/lib/algolia/models/ingestion/docker_streams_input.rb +6 -4
- data/lib/algolia/models/ingestion/email_notifications.rb +207 -0
- data/lib/algolia/models/ingestion/error_base.rb +0 -5
- data/lib/algolia/models/ingestion/event.rb +0 -5
- data/lib/algolia/models/ingestion/list_authentications_response.rb +0 -5
- data/lib/algolia/models/ingestion/list_destinations_response.rb +0 -5
- data/lib/algolia/models/ingestion/list_events_response.rb +0 -5
- data/lib/algolia/models/ingestion/list_sources_response.rb +0 -5
- data/lib/algolia/models/ingestion/list_tasks_response.rb +0 -5
- data/lib/algolia/models/ingestion/list_tasks_response_v1.rb +0 -5
- data/lib/algolia/models/ingestion/list_transformations_response.rb +0 -5
- data/lib/algolia/models/ingestion/mapping_field_directive.rb +0 -5
- data/lib/algolia/models/ingestion/mapping_input.rb +6 -3
- data/lib/algolia/models/ingestion/mapping_kit_action.rb +0 -5
- data/lib/algolia/models/ingestion/notifications.rb +209 -0
- data/lib/algolia/models/ingestion/on_demand_trigger.rb +0 -5
- data/lib/algolia/models/ingestion/on_demand_trigger_input.rb +0 -5
- data/lib/algolia/models/ingestion/pagination.rb +0 -5
- data/lib/algolia/models/ingestion/platform_with_none.rb +5 -6
- data/lib/algolia/models/ingestion/policies.rb +205 -0
- data/lib/algolia/models/ingestion/push_task_payload.rb +0 -5
- data/lib/algolia/models/ingestion/push_task_records.rb +0 -5
- data/lib/algolia/models/ingestion/run.rb +0 -5
- data/lib/algolia/models/ingestion/run_list_response.rb +0 -5
- data/lib/algolia/models/ingestion/run_progress.rb +0 -5
- data/lib/algolia/models/ingestion/run_response.rb +0 -5
- data/lib/algolia/models/ingestion/run_source_payload.rb +0 -5
- data/lib/algolia/models/ingestion/run_source_response.rb +0 -5
- data/lib/algolia/models/ingestion/schedule_trigger.rb +0 -5
- data/lib/algolia/models/ingestion/schedule_trigger_input.rb +5 -3
- data/lib/algolia/models/ingestion/shopify_input.rb +0 -5
- data/lib/algolia/models/ingestion/shopify_market.rb +0 -5
- data/lib/algolia/models/ingestion/shopify_metafield.rb +0 -5
- data/lib/algolia/models/ingestion/source.rb +0 -5
- data/lib/algolia/models/ingestion/source_big_commerce.rb +5 -3
- data/lib/algolia/models/ingestion/source_big_query.rb +5 -3
- data/lib/algolia/models/ingestion/source_commercetools.rb +5 -3
- data/lib/algolia/models/ingestion/source_create.rb +0 -5
- data/lib/algolia/models/ingestion/source_create_response.rb +0 -5
- data/lib/algolia/models/ingestion/source_csv.rb +0 -5
- data/lib/algolia/models/ingestion/source_docker.rb +8 -3
- data/lib/algolia/models/ingestion/source_ga4_big_query_export.rb +7 -3
- data/lib/algolia/models/ingestion/source_input.rb +5 -6
- data/lib/algolia/models/ingestion/source_json.rb +0 -5
- data/lib/algolia/models/ingestion/source_search.rb +0 -5
- data/lib/algolia/models/ingestion/source_shopify.rb +5 -3
- data/lib/algolia/models/ingestion/source_update.rb +0 -5
- data/lib/algolia/models/ingestion/source_update_commercetools.rb +0 -5
- data/lib/algolia/models/ingestion/source_update_docker.rb +5 -3
- data/lib/algolia/models/ingestion/source_update_input.rb +5 -6
- data/lib/algolia/models/ingestion/source_update_response.rb +0 -5
- data/lib/algolia/models/ingestion/source_update_shopify.rb +0 -5
- data/lib/algolia/models/ingestion/streaming_input.rb +5 -3
- data/lib/algolia/models/ingestion/streaming_trigger.rb +0 -5
- data/lib/algolia/models/ingestion/subscription_trigger.rb +0 -5
- data/lib/algolia/models/ingestion/task.rb +20 -5
- data/lib/algolia/models/ingestion/task_create.rb +22 -9
- data/lib/algolia/models/ingestion/task_create_response.rb +0 -5
- data/lib/algolia/models/ingestion/task_create_trigger.rb +5 -6
- data/lib/algolia/models/ingestion/task_create_v1.rb +0 -5
- data/lib/algolia/models/ingestion/task_input.rb +5 -6
- data/lib/algolia/models/ingestion/task_search.rb +0 -5
- data/lib/algolia/models/ingestion/task_update.rb +22 -9
- data/lib/algolia/models/ingestion/task_update_response.rb +0 -5
- data/lib/algolia/models/ingestion/task_update_v1.rb +0 -5
- data/lib/algolia/models/ingestion/task_v1.rb +20 -5
- data/lib/algolia/models/ingestion/transformation.rb +0 -5
- data/lib/algolia/models/ingestion/transformation_create.rb +0 -5
- data/lib/algolia/models/ingestion/transformation_create_response.rb +0 -5
- data/lib/algolia/models/ingestion/transformation_error.rb +0 -5
- data/lib/algolia/models/ingestion/transformation_search.rb +0 -5
- data/lib/algolia/models/ingestion/transformation_try.rb +0 -5
- data/lib/algolia/models/ingestion/transformation_try_response.rb +0 -5
- data/lib/algolia/models/ingestion/transformation_update_response.rb +0 -5
- data/lib/algolia/models/ingestion/trigger.rb +5 -6
- data/lib/algolia/models/ingestion/trigger_update_input.rb +0 -5
- data/lib/algolia/models/ingestion/watch_response.rb +0 -5
- data/lib/algolia/models/ingestion/window.rb +0 -5
- data/lib/algolia/models/insights/added_to_cart_object_ids.rb +7 -3
- data/lib/algolia/models/insights/added_to_cart_object_ids_after_search.rb +8 -3
- data/lib/algolia/models/insights/clicked_filters.rb +6 -3
- data/lib/algolia/models/insights/clicked_object_ids.rb +6 -3
- data/lib/algolia/models/insights/clicked_object_ids_after_search.rb +7 -3
- data/lib/algolia/models/insights/converted_filters.rb +6 -3
- data/lib/algolia/models/insights/converted_object_ids.rb +6 -3
- data/lib/algolia/models/insights/converted_object_ids_after_search.rb +6 -3
- data/lib/algolia/models/insights/discount.rb +5 -6
- data/lib/algolia/models/insights/error_base.rb +0 -5
- data/lib/algolia/models/insights/events_items.rb +5 -6
- data/lib/algolia/models/insights/events_response.rb +0 -5
- data/lib/algolia/models/insights/insights_events.rb +0 -5
- data/lib/algolia/models/insights/object_data.rb +0 -5
- data/lib/algolia/models/insights/object_data_after_search.rb +0 -5
- data/lib/algolia/models/insights/price.rb +5 -6
- data/lib/algolia/models/insights/purchased_object_ids.rb +7 -3
- data/lib/algolia/models/insights/purchased_object_ids_after_search.rb +8 -3
- data/lib/algolia/models/insights/value.rb +5 -6
- data/lib/algolia/models/insights/viewed_filters.rb +6 -3
- data/lib/algolia/models/insights/viewed_object_ids.rb +6 -3
- data/lib/algolia/models/monitoring/error_base.rb +0 -5
- data/lib/algolia/models/monitoring/incident.rb +0 -5
- data/lib/algolia/models/monitoring/incident_entry.rb +0 -5
- data/lib/algolia/models/monitoring/incidents_response.rb +0 -5
- data/lib/algolia/models/monitoring/indexing_metric.rb +0 -5
- data/lib/algolia/models/monitoring/indexing_time_response.rb +0 -5
- data/lib/algolia/models/monitoring/infrastructure_response.rb +0 -5
- data/lib/algolia/models/monitoring/inventory_response.rb +0 -5
- data/lib/algolia/models/monitoring/latency_metric.rb +0 -5
- data/lib/algolia/models/monitoring/latency_response.rb +0 -5
- data/lib/algolia/models/monitoring/metrics.rb +0 -5
- data/lib/algolia/models/monitoring/probes_metric.rb +0 -5
- data/lib/algolia/models/monitoring/server.rb +0 -5
- data/lib/algolia/models/monitoring/status_response.rb +0 -5
- data/lib/algolia/models/monitoring/time_entry.rb +0 -5
- data/lib/algolia/models/personalization/delete_user_profile_response.rb +0 -5
- data/lib/algolia/models/personalization/error_base.rb +0 -5
- data/lib/algolia/models/personalization/{event_scoring.rb → events_scoring.rb} +3 -8
- data/lib/algolia/models/personalization/{facet_scoring.rb → facets_scoring.rb} +3 -8
- data/lib/algolia/models/personalization/get_user_token_response.rb +0 -5
- data/lib/algolia/models/personalization/personalization_strategy_params.rb +17 -22
- data/lib/algolia/models/personalization/set_personalization_strategy_response.rb +0 -5
- data/lib/algolia/models/query-suggestions/base_response.rb +0 -5
- data/lib/algolia/models/query-suggestions/config_status.rb +0 -5
- data/lib/algolia/models/query-suggestions/configuration.rb +0 -5
- data/lib/algolia/models/query-suggestions/configuration_response.rb +0 -5
- data/lib/algolia/models/query-suggestions/configuration_with_index.rb +0 -5
- data/lib/algolia/models/query-suggestions/error_base.rb +0 -5
- data/lib/algolia/models/query-suggestions/facet.rb +0 -5
- data/lib/algolia/models/query-suggestions/languages.rb +5 -6
- data/lib/algolia/models/query-suggestions/log_file.rb +0 -5
- data/lib/algolia/models/query-suggestions/source_index.rb +0 -5
- data/lib/algolia/models/recommend/around_precision.rb +5 -6
- data/lib/algolia/models/recommend/around_radius.rb +5 -6
- data/lib/algolia/models/recommend/auto_facet_filter.rb +0 -5
- data/lib/algolia/models/recommend/banner.rb +0 -5
- data/lib/algolia/models/recommend/banner_image.rb +0 -5
- data/lib/algolia/models/recommend/banner_image_url.rb +0 -5
- data/lib/algolia/models/recommend/banner_link.rb +0 -5
- data/lib/algolia/models/recommend/bought_together_query.rb +0 -5
- data/lib/algolia/models/recommend/condition.rb +0 -5
- data/lib/algolia/models/recommend/consequence.rb +0 -5
- data/lib/algolia/models/recommend/deleted_at_response.rb +0 -5
- data/lib/algolia/models/recommend/distinct.rb +5 -6
- data/lib/algolia/models/recommend/error_base.rb +0 -5
- data/lib/algolia/models/recommend/exhaustive.rb +0 -5
- data/lib/algolia/models/recommend/facet_filters.rb +5 -6
- data/lib/algolia/models/recommend/facet_ordering.rb +0 -5
- data/lib/algolia/models/recommend/facet_stats.rb +0 -5
- data/lib/algolia/models/recommend/fallback_params.rb +0 -5
- data/lib/algolia/models/recommend/get_recommend_task_response.rb +0 -5
- data/lib/algolia/models/recommend/get_recommendations_params.rb +0 -5
- data/lib/algolia/models/recommend/get_recommendations_response.rb +0 -5
- data/lib/algolia/models/recommend/hide_consequence_object.rb +0 -5
- data/lib/algolia/models/recommend/highlight_result.rb +5 -6
- data/lib/algolia/models/recommend/highlight_result_option.rb +6 -3
- data/lib/algolia/models/recommend/ignore_plurals.rb +5 -6
- data/lib/algolia/models/recommend/index_settings_facets.rb +0 -5
- data/lib/algolia/models/recommend/inside_bounding_box.rb +5 -6
- data/lib/algolia/models/recommend/looking_similar_query.rb +0 -5
- data/lib/algolia/models/recommend/matched_geo_location.rb +0 -5
- data/lib/algolia/models/recommend/numeric_filters.rb +5 -6
- data/lib/algolia/models/recommend/optional_filters.rb +5 -6
- data/lib/algolia/models/recommend/optional_words.rb +5 -6
- data/lib/algolia/models/recommend/params_consequence.rb +0 -5
- data/lib/algolia/models/recommend/personalization.rb +0 -5
- data/lib/algolia/models/recommend/promote_consequence_object.rb +0 -5
- data/lib/algolia/models/recommend/range.rb +0 -5
- data/lib/algolia/models/recommend/ranking_info.rb +0 -5
- data/lib/algolia/models/recommend/re_ranking_apply_filter.rb +5 -6
- data/lib/algolia/models/recommend/recommend_hit.rb +5 -3
- data/lib/algolia/models/recommend/recommend_rule.rb +0 -5
- data/lib/algolia/models/recommend/recommend_search_params.rb +0 -5
- data/lib/algolia/models/recommend/recommend_updated_at_response.rb +0 -5
- data/lib/algolia/models/recommend/recommendations_hit.rb +5 -6
- data/lib/algolia/models/recommend/recommendations_request.rb +5 -6
- data/lib/algolia/models/recommend/recommendations_results.rb +0 -5
- data/lib/algolia/models/recommend/redirect.rb +0 -5
- data/lib/algolia/models/recommend/redirect_rule_index_data.rb +0 -5
- data/lib/algolia/models/recommend/redirect_rule_index_metadata.rb +0 -5
- data/lib/algolia/models/recommend/redirect_url.rb +0 -5
- data/lib/algolia/models/recommend/related_query.rb +0 -5
- data/lib/algolia/models/recommend/remove_stop_words.rb +5 -6
- data/lib/algolia/models/recommend/rendering_content.rb +0 -5
- data/lib/algolia/models/recommend/rule_metadata.rb +0 -5
- data/lib/algolia/models/recommend/search_recommend_rules_params.rb +0 -5
- data/lib/algolia/models/recommend/search_recommend_rules_response.rb +0 -5
- data/lib/algolia/models/recommend/snippet_result.rb +5 -6
- data/lib/algolia/models/recommend/snippet_result_option.rb +5 -3
- data/lib/algolia/models/recommend/tag_filters.rb +5 -6
- data/lib/algolia/models/recommend/time_range.rb +0 -5
- data/lib/algolia/models/recommend/trending_facet_hit.rb +6 -3
- data/lib/algolia/models/recommend/trending_facets_query.rb +0 -5
- data/lib/algolia/models/recommend/trending_items_query.rb +0 -5
- data/lib/algolia/models/recommend/typo_tolerance.rb +5 -6
- data/lib/algolia/models/recommend/value.rb +0 -5
- data/lib/algolia/models/recommend/widgets.rb +0 -5
- data/lib/algolia/models/search/add_api_key_response.rb +0 -5
- data/lib/algolia/models/search/api_key.rb +0 -5
- data/lib/algolia/models/search/around_precision.rb +5 -6
- data/lib/algolia/models/search/around_radius.rb +5 -6
- data/lib/algolia/models/search/assign_user_id_params.rb +0 -5
- data/lib/algolia/models/search/attribute_to_update.rb +5 -6
- data/lib/algolia/models/search/automatic_facet_filter.rb +0 -5
- data/lib/algolia/models/search/automatic_facet_filters.rb +5 -6
- data/lib/algolia/models/search/banner.rb +0 -5
- data/lib/algolia/models/search/banner_image.rb +0 -5
- data/lib/algolia/models/search/banner_image_url.rb +0 -5
- data/lib/algolia/models/search/banner_link.rb +0 -5
- data/lib/algolia/models/search/batch_assign_user_ids_params.rb +0 -5
- data/lib/algolia/models/search/batch_dictionary_entries_params.rb +0 -5
- data/lib/algolia/models/search/batch_dictionary_entries_request.rb +0 -5
- data/lib/algolia/models/search/batch_params.rb +0 -5
- data/lib/algolia/models/search/batch_request.rb +0 -5
- data/lib/algolia/models/search/batch_response.rb +0 -5
- data/lib/algolia/models/search/batch_write_params.rb +0 -5
- data/lib/algolia/models/search/browse_params.rb +5 -6
- data/lib/algolia/models/search/browse_params_object.rb +0 -5
- data/lib/algolia/models/search/browse_response.rb +0 -5
- data/lib/algolia/models/search/built_in_operation.rb +0 -5
- data/lib/algolia/models/search/built_in_operation_value.rb +5 -6
- data/lib/algolia/models/search/condition.rb +0 -5
- data/lib/algolia/models/search/consequence.rb +0 -5
- data/lib/algolia/models/search/consequence_hide.rb +0 -5
- data/lib/algolia/models/search/consequence_params.rb +0 -5
- data/lib/algolia/models/search/consequence_query.rb +5 -6
- data/lib/algolia/models/search/consequence_query_object.rb +0 -5
- data/lib/algolia/models/search/created_at_response.rb +0 -5
- data/lib/algolia/models/search/delete_api_key_response.rb +0 -5
- data/lib/algolia/models/search/delete_by_params.rb +0 -5
- data/lib/algolia/models/search/delete_source_response.rb +0 -5
- data/lib/algolia/models/search/deleted_at_response.rb +0 -5
- data/lib/algolia/models/search/dictionary_entry.rb +0 -5
- data/lib/algolia/models/search/dictionary_language.rb +0 -5
- data/lib/algolia/models/search/dictionary_settings_params.rb +0 -5
- data/lib/algolia/models/search/distinct.rb +5 -6
- data/lib/algolia/models/search/edit.rb +0 -5
- data/lib/algolia/models/search/error_base.rb +0 -5
- data/lib/algolia/models/search/exhaustive.rb +0 -5
- data/lib/algolia/models/search/facet_filters.rb +5 -6
- data/lib/algolia/models/search/facet_hits.rb +0 -5
- data/lib/algolia/models/search/facet_ordering.rb +0 -5
- data/lib/algolia/models/search/facet_stats.rb +0 -5
- data/lib/algolia/models/search/facets.rb +0 -5
- data/lib/algolia/models/search/fetched_index.rb +0 -5
- data/lib/algolia/models/search/get_api_key_response.rb +0 -5
- data/lib/algolia/models/search/get_dictionary_settings_response.rb +0 -5
- data/lib/algolia/models/search/get_logs_response.rb +0 -5
- data/lib/algolia/models/search/get_objects_params.rb +0 -5
- data/lib/algolia/models/search/get_objects_request.rb +0 -5
- data/lib/algolia/models/search/get_objects_response.rb +0 -5
- data/lib/algolia/models/search/get_task_response.rb +0 -5
- data/lib/algolia/models/search/get_top_user_ids_response.rb +0 -5
- data/lib/algolia/models/search/has_pending_mappings_response.rb +0 -5
- data/lib/algolia/models/search/highlight_result.rb +5 -6
- data/lib/algolia/models/search/highlight_result_option.rb +6 -3
- data/lib/algolia/models/search/hit.rb +0 -5
- data/lib/algolia/models/search/ignore_plurals.rb +5 -6
- data/lib/algolia/models/search/index_settings.rb +0 -5
- data/lib/algolia/models/search/inside_bounding_box.rb +5 -6
- data/lib/algolia/models/search/languages.rb +0 -5
- data/lib/algolia/models/search/list_api_keys_response.rb +0 -5
- data/lib/algolia/models/search/list_clusters_response.rb +0 -5
- data/lib/algolia/models/search/list_indices_response.rb +0 -5
- data/lib/algolia/models/search/list_user_ids_response.rb +0 -5
- data/lib/algolia/models/search/log.rb +0 -5
- data/lib/algolia/models/search/log_query.rb +0 -5
- data/lib/algolia/models/search/matched_geo_location.rb +0 -5
- data/lib/algolia/models/search/multiple_batch_request.rb +0 -5
- data/lib/algolia/models/search/multiple_batch_response.rb +0 -5
- data/lib/algolia/models/search/numeric_filters.rb +5 -6
- data/lib/algolia/models/search/operation_index_params.rb +0 -5
- data/lib/algolia/models/search/optional_filters.rb +5 -6
- data/lib/algolia/models/search/optional_words.rb +5 -6
- data/lib/algolia/models/search/personalization.rb +0 -5
- data/lib/algolia/models/search/promote.rb +5 -6
- data/lib/algolia/models/search/promote_object_id.rb +5 -3
- data/lib/algolia/models/search/promote_object_ids.rb +5 -3
- data/lib/algolia/models/search/range.rb +0 -5
- data/lib/algolia/models/search/ranking_info.rb +0 -5
- data/lib/algolia/models/search/re_ranking_apply_filter.rb +5 -6
- data/lib/algolia/models/search/redirect.rb +0 -5
- data/lib/algolia/models/search/redirect_rule_index_data.rb +0 -5
- data/lib/algolia/models/search/redirect_rule_index_metadata.rb +0 -5
- data/lib/algolia/models/search/redirect_url.rb +0 -5
- data/lib/algolia/models/search/remove_stop_words.rb +5 -6
- data/lib/algolia/models/search/remove_user_id_response.rb +0 -5
- data/lib/algolia/models/search/rendering_content.rb +0 -5
- data/lib/algolia/models/search/replace_all_objects_response.rb +0 -5
- data/lib/algolia/models/search/replace_source_response.rb +0 -5
- data/lib/algolia/models/search/rule.rb +0 -5
- data/lib/algolia/models/search/save_object_response.rb +0 -5
- data/lib/algolia/models/search/save_synonym_response.rb +0 -5
- data/lib/algolia/models/search/search_dictionary_entries_params.rb +0 -5
- data/lib/algolia/models/search/search_dictionary_entries_response.rb +0 -5
- data/lib/algolia/models/search/search_for_facet_values_request.rb +0 -5
- data/lib/algolia/models/search/search_for_facet_values_response.rb +5 -3
- data/lib/algolia/models/search/search_for_facets.rb +6 -3
- data/lib/algolia/models/search/search_for_hits.rb +0 -5
- data/lib/algolia/models/search/search_method_params.rb +0 -5
- data/lib/algolia/models/search/search_params.rb +5 -6
- data/lib/algolia/models/search/search_params_object.rb +0 -5
- data/lib/algolia/models/search/search_params_string.rb +5 -3
- data/lib/algolia/models/search/search_query.rb +5 -6
- data/lib/algolia/models/search/search_response.rb +0 -5
- data/lib/algolia/models/search/search_responses.rb +0 -5
- data/lib/algolia/models/search/search_result.rb +5 -6
- data/lib/algolia/models/search/search_rules_params.rb +0 -5
- data/lib/algolia/models/search/search_rules_response.rb +0 -5
- data/lib/algolia/models/search/search_synonyms_params.rb +0 -5
- data/lib/algolia/models/search/search_synonyms_response.rb +0 -5
- data/lib/algolia/models/search/search_user_ids_params.rb +0 -5
- data/lib/algolia/models/search/search_user_ids_response.rb +0 -5
- data/lib/algolia/models/search/secured_api_key_restrictions.rb +0 -5
- data/lib/algolia/models/search/semantic_search.rb +0 -5
- data/lib/algolia/models/search/settings_response.rb +0 -5
- data/lib/algolia/models/search/snippet_result.rb +5 -6
- data/lib/algolia/models/search/snippet_result_option.rb +5 -3
- data/lib/algolia/models/search/source.rb +0 -5
- data/lib/algolia/models/search/standard_entries.rb +0 -5
- data/lib/algolia/models/search/synonym_hit.rb +0 -5
- data/lib/algolia/models/search/tag_filters.rb +5 -6
- data/lib/algolia/models/search/time_range.rb +0 -5
- data/lib/algolia/models/search/typo_tolerance.rb +5 -6
- data/lib/algolia/models/search/update_api_key_response.rb +0 -5
- data/lib/algolia/models/search/updated_at_response.rb +0 -5
- data/lib/algolia/models/search/updated_at_with_object_id_response.rb +0 -5
- data/lib/algolia/models/search/user_highlight_result.rb +0 -5
- data/lib/algolia/models/search/user_hit.rb +0 -5
- data/lib/algolia/models/search/user_id.rb +0 -5
- data/lib/algolia/models/search/value.rb +0 -5
- data/lib/algolia/models/search/widgets.rb +0 -5
- data/lib/algolia/version.rb +1 -1
- metadata +8 -9
@@ -0,0 +1,207 @@
|
|
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 Ingestion
|
8
|
+
class EmailNotifications
|
9
|
+
# Whether to send email notifications, note that this doesn't prevent the task from being blocked.
|
10
|
+
attr_accessor :enabled
|
11
|
+
|
12
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
13
|
+
def self.attribute_map
|
14
|
+
{
|
15
|
+
:enabled => :enabled
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
# Attribute type mapping.
|
20
|
+
def self.types_mapping
|
21
|
+
{
|
22
|
+
:enabled => :"Boolean"
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# List of attributes with nullable: true
|
27
|
+
def self.openapi_nullable
|
28
|
+
Set.new(
|
29
|
+
[]
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
# Initializes the object
|
34
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
35
|
+
def initialize(attributes = {})
|
36
|
+
if (!attributes.is_a?(Hash))
|
37
|
+
raise(
|
38
|
+
ArgumentError,
|
39
|
+
"The input argument (attributes) must be a hash in `Algolia::EmailNotifications` initialize method"
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
43
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
44
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
45
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
46
|
+
raise(
|
47
|
+
ArgumentError,
|
48
|
+
"`#{k}` is not a valid attribute in `Algolia::EmailNotifications`. Please check the name to make sure it's valid. List of attributes: " +
|
49
|
+
self.class.attribute_map.keys.inspect
|
50
|
+
)
|
51
|
+
end
|
52
|
+
|
53
|
+
h[k.to_sym] = v
|
54
|
+
}
|
55
|
+
|
56
|
+
if attributes.key?(:enabled)
|
57
|
+
self.enabled = attributes[:enabled]
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# Checks equality by comparing each attribute.
|
62
|
+
# @param [Object] Object to be compared
|
63
|
+
def ==(other)
|
64
|
+
return true if self.equal?(other)
|
65
|
+
self.class == other.class &&
|
66
|
+
enabled == other.enabled
|
67
|
+
end
|
68
|
+
|
69
|
+
# @see the `==` method
|
70
|
+
# @param [Object] Object to be compared
|
71
|
+
def eql?(other)
|
72
|
+
self == other
|
73
|
+
end
|
74
|
+
|
75
|
+
# Calculates hash code according to all attributes.
|
76
|
+
# @return [Integer] Hash code
|
77
|
+
def hash
|
78
|
+
[enabled].hash
|
79
|
+
end
|
80
|
+
|
81
|
+
# Builds the object from hash
|
82
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
83
|
+
# @return [Object] Returns the model itself
|
84
|
+
def self.build_from_hash(attributes)
|
85
|
+
return nil unless attributes.is_a?(Hash)
|
86
|
+
attributes = attributes.transform_keys(&:to_sym)
|
87
|
+
transformed_hash = {}
|
88
|
+
types_mapping.each_pair do |key, type|
|
89
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
90
|
+
transformed_hash[key.to_sym] = nil
|
91
|
+
elsif type =~ /\AArray<(.*)>/i
|
92
|
+
# check to ensure the input is an array given that the attribute
|
93
|
+
# is documented as an array but the input is not
|
94
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
95
|
+
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
|
96
|
+
_deserialize(::Regexp.last_match(1), v)
|
97
|
+
}
|
98
|
+
end
|
99
|
+
elsif !attributes[attribute_map[key]].nil?
|
100
|
+
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
new(transformed_hash)
|
105
|
+
end
|
106
|
+
|
107
|
+
# Deserializes the data based on type
|
108
|
+
# @param string type Data type
|
109
|
+
# @param string value Value to be deserialized
|
110
|
+
# @return [Object] Deserialized data
|
111
|
+
def self._deserialize(type, value)
|
112
|
+
case type.to_sym
|
113
|
+
when :Time
|
114
|
+
Time.parse(value)
|
115
|
+
when :Date
|
116
|
+
Date.parse(value)
|
117
|
+
when :String
|
118
|
+
value.to_s
|
119
|
+
when :Integer
|
120
|
+
value.to_i
|
121
|
+
when :Float
|
122
|
+
value.to_f
|
123
|
+
when :Boolean
|
124
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
125
|
+
true
|
126
|
+
else
|
127
|
+
false
|
128
|
+
end
|
129
|
+
|
130
|
+
when :Object
|
131
|
+
# generic object (usually a Hash), return directly
|
132
|
+
value
|
133
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
134
|
+
inner_type = Regexp.last_match[:inner_type]
|
135
|
+
value.map { |v| _deserialize(inner_type, v) }
|
136
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
137
|
+
k_type = Regexp.last_match[:k_type]
|
138
|
+
v_type = Regexp.last_match[:v_type]
|
139
|
+
{}.tap do |hash|
|
140
|
+
value.each do |k, v|
|
141
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
# model
|
145
|
+
else
|
146
|
+
# models (e.g. Pet) or oneOf
|
147
|
+
klass = Algolia::Ingestion.const_get(type)
|
148
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
|
149
|
+
.build_from_hash(value)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
# Returns the string representation of the object
|
154
|
+
# @return [String] String presentation of the object
|
155
|
+
def to_s
|
156
|
+
to_hash.to_s
|
157
|
+
end
|
158
|
+
|
159
|
+
# to_body is an alias to to_hash (backward compatibility)
|
160
|
+
# @return [Hash] Returns the object in the form of hash
|
161
|
+
def to_body
|
162
|
+
to_hash
|
163
|
+
end
|
164
|
+
|
165
|
+
def to_json(*_args)
|
166
|
+
to_hash.to_json
|
167
|
+
end
|
168
|
+
|
169
|
+
# Returns the object in the form of hash
|
170
|
+
# @return [Hash] Returns the object in the form of hash
|
171
|
+
def to_hash
|
172
|
+
hash = {}
|
173
|
+
self.class.attribute_map.each_pair do |attr, param|
|
174
|
+
value = send(attr)
|
175
|
+
if value.nil?
|
176
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
177
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
178
|
+
end
|
179
|
+
|
180
|
+
hash[param] = _to_hash(value)
|
181
|
+
end
|
182
|
+
|
183
|
+
hash
|
184
|
+
end
|
185
|
+
|
186
|
+
# Outputs non-array value in the form of hash
|
187
|
+
# For object, use to_hash. Otherwise, just return the value
|
188
|
+
# @param [Object] value Any valid value
|
189
|
+
# @return [Hash] Returns the value in the form of hash
|
190
|
+
def _to_hash(value)
|
191
|
+
if value.is_a?(Array)
|
192
|
+
value.compact.map { |v| _to_hash(v) }
|
193
|
+
elsif value.is_a?(Hash)
|
194
|
+
{}.tap do |hash|
|
195
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
196
|
+
end
|
197
|
+
elsif value.respond_to?(:to_hash)
|
198
|
+
value.to_hash
|
199
|
+
else
|
200
|
+
value
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
end
|
205
|
+
|
206
|
+
end
|
207
|
+
end
|
@@ -19,9 +19,12 @@ module Algolia
|
|
19
19
|
}
|
20
20
|
end
|
21
21
|
|
22
|
-
# Returns
|
23
|
-
def self.
|
24
|
-
|
22
|
+
# Returns the keys that uniquely identify this oneOf variant when present
|
23
|
+
def self.discriminator_attributes
|
24
|
+
[
|
25
|
+
:format,
|
26
|
+
:actions
|
27
|
+
]
|
25
28
|
end
|
26
29
|
|
27
30
|
# Attribute type mapping.
|
@@ -0,0 +1,209 @@
|
|
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 Ingestion
|
8
|
+
# Notifications settings for a task.
|
9
|
+
class Notifications
|
10
|
+
attr_accessor :email
|
11
|
+
|
12
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
13
|
+
def self.attribute_map
|
14
|
+
{
|
15
|
+
:email => :email
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
# Attribute type mapping.
|
20
|
+
def self.types_mapping
|
21
|
+
{
|
22
|
+
:email => :"EmailNotifications"
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# List of attributes with nullable: true
|
27
|
+
def self.openapi_nullable
|
28
|
+
Set.new(
|
29
|
+
[]
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
# Initializes the object
|
34
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
35
|
+
def initialize(attributes = {})
|
36
|
+
if (!attributes.is_a?(Hash))
|
37
|
+
raise(
|
38
|
+
ArgumentError,
|
39
|
+
"The input argument (attributes) must be a hash in `Algolia::Notifications` initialize method"
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
43
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
44
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
45
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
46
|
+
raise(
|
47
|
+
ArgumentError,
|
48
|
+
"`#{k}` is not a valid attribute in `Algolia::Notifications`. Please check the name to make sure it's valid. List of attributes: " +
|
49
|
+
self.class.attribute_map.keys.inspect
|
50
|
+
)
|
51
|
+
end
|
52
|
+
|
53
|
+
h[k.to_sym] = v
|
54
|
+
}
|
55
|
+
|
56
|
+
if attributes.key?(:email)
|
57
|
+
self.email = attributes[:email]
|
58
|
+
else
|
59
|
+
self.email = nil
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Checks equality by comparing each attribute.
|
64
|
+
# @param [Object] Object to be compared
|
65
|
+
def ==(other)
|
66
|
+
return true if self.equal?(other)
|
67
|
+
self.class == other.class &&
|
68
|
+
email == other.email
|
69
|
+
end
|
70
|
+
|
71
|
+
# @see the `==` method
|
72
|
+
# @param [Object] Object to be compared
|
73
|
+
def eql?(other)
|
74
|
+
self == other
|
75
|
+
end
|
76
|
+
|
77
|
+
# Calculates hash code according to all attributes.
|
78
|
+
# @return [Integer] Hash code
|
79
|
+
def hash
|
80
|
+
[email].hash
|
81
|
+
end
|
82
|
+
|
83
|
+
# Builds the object from hash
|
84
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
85
|
+
# @return [Object] Returns the model itself
|
86
|
+
def self.build_from_hash(attributes)
|
87
|
+
return nil unless attributes.is_a?(Hash)
|
88
|
+
attributes = attributes.transform_keys(&:to_sym)
|
89
|
+
transformed_hash = {}
|
90
|
+
types_mapping.each_pair do |key, type|
|
91
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
92
|
+
transformed_hash[key.to_sym] = nil
|
93
|
+
elsif type =~ /\AArray<(.*)>/i
|
94
|
+
# check to ensure the input is an array given that the attribute
|
95
|
+
# is documented as an array but the input is not
|
96
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
97
|
+
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
|
98
|
+
_deserialize(::Regexp.last_match(1), v)
|
99
|
+
}
|
100
|
+
end
|
101
|
+
elsif !attributes[attribute_map[key]].nil?
|
102
|
+
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
new(transformed_hash)
|
107
|
+
end
|
108
|
+
|
109
|
+
# Deserializes the data based on type
|
110
|
+
# @param string type Data type
|
111
|
+
# @param string value Value to be deserialized
|
112
|
+
# @return [Object] Deserialized data
|
113
|
+
def self._deserialize(type, value)
|
114
|
+
case type.to_sym
|
115
|
+
when :Time
|
116
|
+
Time.parse(value)
|
117
|
+
when :Date
|
118
|
+
Date.parse(value)
|
119
|
+
when :String
|
120
|
+
value.to_s
|
121
|
+
when :Integer
|
122
|
+
value.to_i
|
123
|
+
when :Float
|
124
|
+
value.to_f
|
125
|
+
when :Boolean
|
126
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
127
|
+
true
|
128
|
+
else
|
129
|
+
false
|
130
|
+
end
|
131
|
+
|
132
|
+
when :Object
|
133
|
+
# generic object (usually a Hash), return directly
|
134
|
+
value
|
135
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
136
|
+
inner_type = Regexp.last_match[:inner_type]
|
137
|
+
value.map { |v| _deserialize(inner_type, v) }
|
138
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
139
|
+
k_type = Regexp.last_match[:k_type]
|
140
|
+
v_type = Regexp.last_match[:v_type]
|
141
|
+
{}.tap do |hash|
|
142
|
+
value.each do |k, v|
|
143
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
144
|
+
end
|
145
|
+
end
|
146
|
+
# model
|
147
|
+
else
|
148
|
+
# models (e.g. Pet) or oneOf
|
149
|
+
klass = Algolia::Ingestion.const_get(type)
|
150
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
|
151
|
+
.build_from_hash(value)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
# Returns the string representation of the object
|
156
|
+
# @return [String] String presentation of the object
|
157
|
+
def to_s
|
158
|
+
to_hash.to_s
|
159
|
+
end
|
160
|
+
|
161
|
+
# to_body is an alias to to_hash (backward compatibility)
|
162
|
+
# @return [Hash] Returns the object in the form of hash
|
163
|
+
def to_body
|
164
|
+
to_hash
|
165
|
+
end
|
166
|
+
|
167
|
+
def to_json(*_args)
|
168
|
+
to_hash.to_json
|
169
|
+
end
|
170
|
+
|
171
|
+
# Returns the object in the form of hash
|
172
|
+
# @return [Hash] Returns the object in the form of hash
|
173
|
+
def to_hash
|
174
|
+
hash = {}
|
175
|
+
self.class.attribute_map.each_pair do |attr, param|
|
176
|
+
value = send(attr)
|
177
|
+
if value.nil?
|
178
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
179
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
180
|
+
end
|
181
|
+
|
182
|
+
hash[param] = _to_hash(value)
|
183
|
+
end
|
184
|
+
|
185
|
+
hash
|
186
|
+
end
|
187
|
+
|
188
|
+
# Outputs non-array value in the form of hash
|
189
|
+
# For object, use to_hash. Otherwise, just return the value
|
190
|
+
# @param [Object] value Any valid value
|
191
|
+
# @return [Hash] Returns the value in the form of hash
|
192
|
+
def _to_hash(value)
|
193
|
+
if value.is_a?(Array)
|
194
|
+
value.compact.map { |v| _to_hash(v) }
|
195
|
+
elsif value.is_a?(Hash)
|
196
|
+
{}.tap do |hash|
|
197
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
198
|
+
end
|
199
|
+
elsif value.respond_to?(:to_hash)
|
200
|
+
value.to_hash
|
201
|
+
else
|
202
|
+
value
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
end
|
207
|
+
|
208
|
+
end
|
209
|
+
end
|
@@ -44,7 +44,6 @@ module Algolia
|
|
44
44
|
|
45
45
|
SchemaMismatchError = Class.new(StandardError)
|
46
46
|
|
47
|
-
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
48
47
|
def find_and_cast_into_type(klass, data)
|
49
48
|
return if data.nil?
|
50
49
|
|
@@ -83,12 +82,12 @@ module Algolia
|
|
83
82
|
if const.respond_to?(:openapi_one_of)
|
84
83
|
# nested oneOf model
|
85
84
|
model = const.build(data)
|
86
|
-
elsif const.respond_to?(:
|
87
|
-
|
88
|
-
|
89
|
-
|
85
|
+
elsif const.respond_to?(:discriminator_attributes)
|
86
|
+
if const.discriminator_attributes.all? { |attr| data.key?(attr) }
|
87
|
+
model = const.build_from_hash(data)
|
88
|
+
end
|
90
89
|
else
|
91
|
-
# maybe it's an enum
|
90
|
+
# maybe it's an enum, or doens't have discriminators
|
92
91
|
model = const.build_from_hash(data)
|
93
92
|
end
|
94
93
|
|