From d8adcf0f2cec04b5102d248e3e820db7c19fc271 Mon Sep 17 00:00:00 2001 From: algolia-bot Date: Tue, 1 Aug 2023 10:33:54 +0000 Subject: [PATCH] chore: generated code for commit 280228be1b63c84b83619232d8d86ae9ab9c4595. [skip ci] Co-authored-by: Mouaad Aallam --- .../lib/src/api/search_client.dart | 8 +- .../algoliasearch/lib/src/deserialize.dart | 52 + .../algoliasearch/lib/src/model/acl.dart | 7 + .../algoliasearch/lib/src/model/action.dart | 7 + .../src/model/advanced_syntax_features.dart | 7 + .../lib/src/model/alternatives_as_exact.dart | 7 + .../lib/src/model/anchoring.dart | 7 + .../lib/src/model/around_radius_all.dart | 7 + .../lib/src/model/base_search_params.dart | 23 + .../base_search_params_without_query.dart | 23 + .../lib/src/model/browse_params_object.dart | 35 + .../src/model/built_in_operation_type.dart | 7 + .../lib/src/model/consequence.dart | 3 + .../lib/src/model/consequence_params.dart | 44 + .../lib/src/model/delete_by_params.dart | 15 + .../lib/src/model/dictionary_action.dart | 7 + .../lib/src/model/dictionary_entry_state.dart | 7 + .../lib/src/model/dictionary_type.dart | 7 + .../lib/src/model/edit_type.dart | 7 + .../src/model/exact_on_single_word_query.dart | 7 + .../lib/src/model/index_settings.dart | 12 + .../index_settings_as_search_params.dart | 12 + .../algoliasearch/lib/src/model/log_type.dart | 7 + .../lib/src/model/match_level.dart | 7 + .../algoliasearch/lib/src/model/mode.dart | 7 + .../lib/src/model/operation_type.dart | 7 + .../algoliasearch/lib/src/model/params.dart | 9 + .../lib/src/model/query_type.dart | 7 + .../src/model/remove_words_if_no_results.dart | 7 + .../lib/src/model/scope_type.dart | 7 + .../lib/src/model/search_for_facets.dart | 35 + .../lib/src/model/search_for_hits.dart | 35 + .../lib/src/model/search_method_params.dart | 3 + .../lib/src/model/search_params_object.dart | 35 + .../lib/src/model/search_responses.dart | 3 + .../lib/src/model/search_strategy.dart | 7 + .../lib/src/model/search_type_default.dart | 7 + .../lib/src/model/search_type_facet.dart | 7 + .../lib/src/model/sort_remaining_by.dart | 7 + .../lib/src/model/synonym_type.dart | 7 + .../lib/src/model/task_status.dart | 7 + .../lib/src/model/typo_tolerance_enum.dart | 7 + .../packages/algoliasearch/pubspec.yaml | 2 +- .../packages/client_abtesting/build.yaml | 14 + .../lib/algolia_client_abtesting.dart | 18 + .../lib/src/api/abtesting_client.dart | 337 +++++ .../client_abtesting/lib/src/deserialize.dart | 88 ++ .../lib/src/model/ab_test.dart | 87 ++ .../lib/src/model/ab_test.g.dart | 42 + .../lib/src/model/ab_test_response.dart | 49 + .../lib/src/model/ab_test_response.g.dart | 28 + .../lib/src/model/ab_tests_variant.dart | 50 + .../lib/src/model/ab_tests_variant.g.dart | 38 + .../model/ab_tests_variant_search_params.dart | 58 + .../ab_tests_variant_search_params.g.dart | 43 + .../lib/src/model/add_ab_tests_request.dart | 52 + .../lib/src/model/add_ab_tests_request.g.dart | 28 + .../lib/src/model/custom_search_params.dart | 36 + .../lib/src/model/custom_search_params.g.dart | 25 + .../lib/src/model/error_base.dart | 47 + .../lib/src/model/error_base.g.dart | 35 + .../lib/src/model/list_ab_tests_response.dart | 50 + .../src/model/list_ab_tests_response.g.dart | 33 + .../lib/src/model/variant.dart | 129 ++ .../lib/src/model/variant.g.dart | 55 + .../client_abtesting/lib/src/version.dart | 2 + .../packages/client_abtesting/pubspec.yaml | 24 + .../packages/client_analytics/build.yaml | 14 + .../lib/algolia_client_analytics.dart | 50 + .../lib/src/api/analytics_client.dart | 988 +++++++++++++ .../client_analytics/lib/src/deserialize.dart | 211 +++ .../lib/src/model/average_click_event.dart | 49 + .../lib/src/model/average_click_event.g.dart | 28 + .../lib/src/model/click_position.dart | 43 + .../lib/src/model/click_position.g.dart | 27 + .../src/model/click_through_rate_event.dart | 61 + .../src/model/click_through_rate_event.g.dart | 33 + .../lib/src/model/conversion_rate_event.dart | 61 + .../src/model/conversion_rate_event.g.dart | 32 + .../lib/src/model/direction.dart | 24 + .../lib/src/model/error_base.dart | 47 + .../lib/src/model/error_base.g.dart | 35 + .../get_average_click_position_response.dart | 51 + ...get_average_click_position_response.g.dart | 35 + .../model/get_click_positions_response.dart | 37 + .../model/get_click_positions_response.g.dart | 30 + .../get_click_through_rate_response.dart | 62 + .../get_click_through_rate_response.g.dart | 38 + .../model/get_conversation_rate_response.dart | 62 + .../get_conversation_rate_response.g.dart | 38 + .../src/model/get_no_click_rate_response.dart | 59 + .../model/get_no_click_rate_response.g.dart | 37 + .../model/get_no_results_rate_response.dart | 59 + .../model/get_no_results_rate_response.g.dart | 37 + .../model/get_searches_count_response.dart | 44 + .../model/get_searches_count_response.g.dart | 32 + .../get_searches_no_clicks_response.dart | 37 + .../get_searches_no_clicks_response.g.dart | 31 + .../get_searches_no_results_response.dart | 37 + .../get_searches_no_results_response.g.dart | 31 + .../lib/src/model/get_status_response.dart | 36 + .../lib/src/model/get_status_response.g.dart | 24 + .../src/model/get_top_countries_response.dart | 37 + .../model/get_top_countries_response.g.dart | 30 + .../src/model/get_top_filter_attribute.dart | 43 + .../src/model/get_top_filter_attribute.g.dart | 28 + .../get_top_filter_attributes_response.dart | 37 + .../get_top_filter_attributes_response.g.dart | 31 + .../model/get_top_filter_for_attribute.dart | 56 + .../model/get_top_filter_for_attribute.g.dart | 32 + ...get_top_filter_for_attribute_response.dart | 39 + ...t_top_filter_for_attribute_response.g.dart | 31 + .../get_top_filters_no_results_response.dart | 37 + ...get_top_filters_no_results_response.g.dart | 31 + .../get_top_filters_no_results_value.dart | 49 + .../get_top_filters_no_results_value.g.dart | 30 + .../get_top_filters_no_results_values.dart | 44 + .../get_top_filters_no_results_values.g.dart | 33 + .../src/model/get_users_count_response.dart | 44 + .../src/model/get_users_count_response.g.dart | 32 + .../lib/src/model/no_click_rate_event.dart | 58 + .../lib/src/model/no_click_rate_event.g.dart | 30 + .../lib/src/model/no_results_rate_event.dart | 58 + .../src/model/no_results_rate_event.g.dart | 30 + .../lib/src/model/order_by.dart | 34 + .../lib/src/model/search_event.dart | 41 + .../lib/src/model/search_event.g.dart | 25 + .../lib/src/model/search_no_click_event.dart | 50 + .../src/model/search_no_click_event.g.dart | 28 + .../lib/src/model/search_no_result_event.dart | 49 + .../src/model/search_no_result_event.g.dart | 29 + .../lib/src/model/top_country.dart | 41 + .../lib/src/model/top_country.g.dart | 25 + .../lib/src/model/top_hit.dart | 40 + .../lib/src/model/top_hit.g.dart | 24 + .../lib/src/model/top_hit_with_analytics.dart | 82 ++ .../src/model/top_hit_with_analytics.g.dart | 40 + .../lib/src/model/top_hits_response.dart | 36 + .../lib/src/model/top_hits_response.g.dart | 28 + .../top_hits_response_with_analytics.dart | 37 + .../top_hits_response_with_analytics.g.dart | 31 + .../lib/src/model/top_search.dart | 49 + .../lib/src/model/top_search.g.dart | 26 + .../src/model/top_search_with_analytics.dart | 96 ++ .../model/top_search_with_analytics.g.dart | 46 + .../lib/src/model/top_searches_response.dart | 37 + .../src/model/top_searches_response.g.dart | 29 + .../top_searches_response_with_analytics.dart | 39 + ...op_searches_response_with_analytics.g.dart | 31 + .../lib/src/model/user_with_date.dart | 41 + .../lib/src/model/user_with_date.g.dart | 26 + .../client_analytics/lib/src/version.dart | 2 + .../packages/client_analytics/pubspec.yaml | 24 + .../packages/client_ingestion/build.yaml | 14 + .../lib/algolia_client_ingestion.dart | 102 ++ .../lib/src/api/ingestion_client.dart | 1268 +++++++++++++++++ .../client_ingestion/lib/src/deserialize.dart | 376 +++++ .../lib/src/model/action_type.dart | 28 + .../lib/src/model/auth_algolia.dart | 41 + .../lib/src/model/auth_algolia.g.dart | 25 + .../lib/src/model/auth_algolia_partial.dart | 43 + .../lib/src/model/auth_algolia_partial.g.dart | 34 + .../lib/src/model/auth_api_key.dart | 34 + .../lib/src/model/auth_api_key.g.dart | 23 + .../lib/src/model/auth_api_key_partial.dart | 34 + .../lib/src/model/auth_api_key_partial.g.dart | 32 + .../lib/src/model/auth_basic.dart | 41 + .../lib/src/model/auth_basic.g.dart | 24 + .../lib/src/model/auth_basic_partial.dart | 41 + .../lib/src/model/auth_basic_partial.g.dart | 34 + .../model/auth_google_service_account.dart | 43 + .../model/auth_google_service_account.g.dart | 28 + .../auth_google_service_account_partial.dart | 44 + ...auth_google_service_account_partial.g.dart | 36 + .../lib/src/model/auth_o_auth.dart | 49 + .../lib/src/model/auth_o_auth.g.dart | 30 + .../lib/src/model/auth_o_auth_partial.dart | 49 + .../lib/src/model/auth_o_auth_partial.g.dart | 40 + .../lib/src/model/authentication.dart | 85 ++ .../lib/src/model/authentication.g.dart | 61 + .../lib/src/model/authentication_create.dart | 61 + .../src/model/authentication_create.g.dart | 56 + .../model/authentication_create_response.dart | 50 + .../authentication_create_response.g.dart | 31 + .../lib/src/model/authentication_search.dart | 36 + .../src/model/authentication_search.g.dart | 27 + .../src/model/authentication_sort_keys.dart | 37 + .../lib/src/model/authentication_type.dart | 37 + .../lib/src/model/authentication_update.dart | 61 + .../src/model/authentication_update.g.dart | 55 + .../model/authentication_update_response.dart | 50 + .../authentication_update_response.g.dart | 31 + .../lib/src/model/big_commerce_channel.dart | 43 + .../lib/src/model/big_commerce_channel.g.dart | 36 + .../lib/src/model/big_query_data_type.dart | 24 + .../lib/src/model/delete_response.dart | 36 + .../lib/src/model/delete_response.g.dart | 24 + .../lib/src/model/destination.dart | 81 ++ .../lib/src/model/destination.g.dart | 53 + .../lib/src/model/destination_create.dart | 61 + .../lib/src/model/destination_create.g.dart | 48 + .../model/destination_create_response.dart | 50 + .../model/destination_create_response.g.dart | 30 + .../lib/src/model/destination_index_name.dart | 36 + .../src/model/destination_index_name.g.dart | 26 + .../src/model/destination_index_prefix.dart | 36 + .../src/model/destination_index_prefix.g.dart | 26 + .../lib/src/model/destination_search.dart | 35 + .../lib/src/model/destination_search.g.dart | 25 + .../lib/src/model/destination_sort_keys.dart | 34 + .../lib/src/model/destination_type.dart | 34 + .../lib/src/model/destination_update.dart | 60 + .../lib/src/model/destination_update.g.dart | 47 + .../model/destination_update_response.dart | 50 + .../model/destination_update_response.g.dart | 30 + .../lib/src/model/docker_image_type.dart | 31 + .../lib/src/model/docker_registry.dart | 28 + .../lib/src/model/error_base.dart | 47 + .../lib/src/model/error_base.g.dart | 35 + .../client_ingestion/lib/src/model/event.dart | 78 + .../lib/src/model/event.g.dart | 65 + .../lib/src/model/event_sort_keys.dart | 31 + .../lib/src/model/event_status.dart | 27 + .../lib/src/model/event_type.dart | 26 + .../model/list_authentications_response.dart | 43 + .../list_authentications_response.g.dart | 35 + .../src/model/list_destinations_response.dart | 43 + .../model/list_destinations_response.g.dart | 33 + .../lib/src/model/list_events_response.dart | 43 + .../lib/src/model/list_events_response.g.dart | 31 + .../lib/src/model/list_sources_response.dart | 43 + .../src/model/list_sources_response.g.dart | 32 + .../lib/src/model/list_tasks_response.dart | 43 + .../lib/src/model/list_tasks_response.g.dart | 31 + .../lib/src/model/mapping_type_csv.dart | 27 + .../lib/src/model/method_type.dart | 24 + .../src/model/on_demand_date_utils_input.dart | 43 + .../model/on_demand_date_utils_input.g.dart | 28 + .../lib/src/model/on_demand_trigger.dart | 43 + .../lib/src/model/on_demand_trigger.g.dart | 40 + .../src/model/on_demand_trigger_input.dart | 36 + .../src/model/on_demand_trigger_input.g.dart | 31 + .../lib/src/model/on_demand_trigger_type.dart | 25 + .../lib/src/model/order_keys.dart | 28 + .../lib/src/model/pagination.dart | 55 + .../lib/src/model/pagination.g.dart | 29 + .../lib/src/model/platform.dart | 28 + .../lib/src/model/platform_none.dart | 25 + .../client_ingestion/lib/src/model/run.dart | 113 ++ .../client_ingestion/lib/src/model/run.g.dart | 91 ++ .../lib/src/model/run_list_response.dart | 43 + .../lib/src/model/run_list_response.g.dart | 31 + .../lib/src/model/run_outcome.dart | 25 + .../lib/src/model/run_progress.dart | 41 + .../lib/src/model/run_progress.g.dart | 35 + .../lib/src/model/run_reason_code.dart | 43 + .../lib/src/model/run_response.dart | 43 + .../lib/src/model/run_response.g.dart | 25 + .../lib/src/model/run_sort_keys.dart | 31 + .../lib/src/model/run_status.dart | 27 + .../lib/src/model/run_type.dart | 24 + .../src/model/schedule_date_utils_input.dart | 38 + .../model/schedule_date_utils_input.g.dart | 26 + .../lib/src/model/schedule_trigger.dart | 56 + .../lib/src/model/schedule_trigger.g.dart | 44 + .../lib/src/model/schedule_trigger_input.dart | 41 + .../src/model/schedule_trigger_input.g.dart | 33 + .../lib/src/model/schedule_trigger_type.dart | 25 + .../lib/src/model/source.dart | 84 ++ .../lib/src/model/source.g.dart | 55 + .../lib/src/model/source_big_commerce.dart | 43 + .../lib/src/model/source_big_commerce.g.dart | 38 + .../lib/src/model/source_big_query.dart | 80 ++ .../lib/src/model/source_big_query.g.dart | 53 + .../lib/src/model/source_commercetools.dart | 56 + .../lib/src/model/source_commercetools.g.dart | 40 + .../lib/src/model/source_create.dart | 64 + .../lib/src/model/source_create.g.dart | 50 + .../lib/src/model/source_create_response.dart | 48 + .../src/model/source_create_response.g.dart | 30 + .../lib/src/model/source_csv.dart | 67 + .../lib/src/model/source_csv.g.dart | 61 + .../lib/src/model/source_docker.dart | 73 + .../lib/src/model/source_docker.g.dart | 56 + .../lib/src/model/source_json.dart | 49 + .../lib/src/model/source_json.g.dart | 43 + .../lib/src/model/source_search.dart | 35 + .../lib/src/model/source_search.g.dart | 25 + .../lib/src/model/source_sort_keys.dart | 34 + .../lib/src/model/source_type.dart | 28 + .../lib/src/model/source_update.dart | 54 + .../lib/src/model/source_update.g.dart | 37 + .../model/source_update_commercetools.dart | 43 + .../model/source_update_commercetools.g.dart | 38 + .../lib/src/model/source_update_response.dart | 48 + .../src/model/source_update_response.g.dart | 30 + .../lib/src/model/subscription_trigger.dart | 36 + .../lib/src/model/subscription_trigger.g.dart | 30 + .../src/model/subscription_trigger_type.dart | 25 + .../client_ingestion/lib/src/model/task.dart | 98 ++ .../lib/src/model/task.g.dart | 54 + .../lib/src/model/task_create.dart | 78 + .../lib/src/model/task_create.g.dart | 48 + .../lib/src/model/task_create_response.dart | 43 + .../lib/src/model/task_create_response.g.dart | 26 + .../lib/src/model/task_search.dart | 34 + .../lib/src/model/task_search.g.dart | 24 + .../lib/src/model/task_sort_keys.dart | 37 + .../lib/src/model/task_update.dart | 61 + .../lib/src/model/task_update.g.dart | 41 + .../lib/src/model/task_update_response.dart | 43 + .../lib/src/model/task_update_response.g.dart | 26 + .../lib/src/model/trigger_input.dart | 35 + .../lib/src/model/trigger_input.g.dart | 31 + .../lib/src/model/trigger_type.dart | 31 + .../client_ingestion/lib/src/version.dart | 2 + .../packages/client_ingestion/pubspec.yaml | 24 + .../lib/src/api/insights_client.dart | 20 +- .../client_insights/lib/src/deserialize.dart | 6 + .../lib/src/model/click_event.dart | 7 + .../lib/src/model/conversion_event.dart | 7 + .../lib/src/model/insights_events.dart | 9 + .../lib/src/model/view_event.dart | 7 + .../packages/client_insights/pubspec.yaml | 2 +- .../packages/client_monitoring/build.yaml | 14 + .../lib/algolia_client_monitoring.dart | 31 + .../lib/src/api/monitoring_client.dart | 445 ++++++ .../lib/src/deserialize.dart | 132 ++ .../lib/src/model/error_base.dart | 47 + .../lib/src/model/error_base.g.dart | 35 + .../src/model/get_inventory403_response.dart | 35 + .../model/get_inventory403_response.g.dart | 34 + .../lib/src/model/incident.dart | 41 + .../lib/src/model/incident.g.dart | 41 + .../lib/src/model/incidents_inner.dart | 41 + .../lib/src/model/incidents_inner.g.dart | 38 + .../lib/src/model/incidents_response.dart | 36 + .../lib/src/model/incidents_response.g.dart | 44 + .../lib/src/model/indexing_time_response.dart | 36 + .../src/model/indexing_time_response.g.dart | 39 + .../model/indexing_time_response_metrics.dart | 36 + .../indexing_time_response_metrics.g.dart | 46 + .../src/model/infrastructure_response.dart | 36 + .../src/model/infrastructure_response.g.dart | 39 + .../infrastructure_response_metrics.dart | 67 + .../infrastructure_response_metrics.g.dart | 109 ++ .../lib/src/model/inventory_response.dart | 36 + .../lib/src/model/inventory_response.g.dart | 37 + .../lib/src/model/latency_response.dart | 36 + .../lib/src/model/latency_response.g.dart | 36 + .../src/model/latency_response_metrics.dart | 36 + .../src/model/latency_response_metrics.g.dart | 46 + .../lib/src/model/metric.dart | 28 + .../lib/src/model/period.dart | 27 + .../lib/src/model/probes_metric.dart | 41 + .../lib/src/model/probes_metric.g.dart | 34 + .../lib/src/model/region.dart | 67 + .../lib/src/model/server.dart | 78 + .../lib/src/model/server.g.dart | 73 + .../lib/src/model/server_status.dart | 23 + .../lib/src/model/status.dart | 34 + .../lib/src/model/status_response.dart | 36 + .../lib/src/model/status_response.g.dart | 44 + .../lib/src/model/time_inner.dart | 41 + .../lib/src/model/time_inner.g.dart | 33 + .../client_monitoring/lib/src/model/type.dart | 23 + .../client_monitoring/lib/src/version.dart | 2 + .../packages/client_monitoring/pubspec.yaml | 24 + .../client_personalization/build.yaml | 14 + .../lib/algolia_client_personalization.dart | 16 + .../lib/src/api/personalization_client.dart | 306 ++++ .../lib/src/deserialize.dart | 80 ++ .../model/delete_user_profile_response.dart | 43 + .../model/delete_user_profile_response.g.dart | 28 + .../lib/src/model/error_base.dart | 47 + .../lib/src/model/error_base.g.dart | 35 + .../lib/src/model/event_scoring.dart | 49 + .../lib/src/model/event_scoring.g.dart | 28 + .../lib/src/model/facet_scoring.dart | 43 + .../lib/src/model/facet_scoring.g.dart | 26 + .../src/model/get_user_token_response.dart | 50 + .../src/model/get_user_token_response.g.dart | 30 + .../personalization_strategy_params.dart | 54 + .../personalization_strategy_params.g.dart | 39 + ...set_personalization_strategy_response.dart | 38 + ...t_personalization_strategy_response.g.dart | 26 + .../lib/src/version.dart | 2 + .../client_personalization/pubspec.yaml | 24 + .../packages/client_predict/build.yaml | 14 + .../lib/algolia_client_predict.dart | 69 + .../lib/src/api/predict_client.dart | 677 +++++++++ .../client_predict/lib/src/deserialize.dart | 273 ++++ .../activate_model_instance_response.dart | 43 + .../activate_model_instance_response.g.dart | 28 + .../lib/src/model/activate_model_params.dart | 65 + .../src/model/activate_model_params.g.dart | 49 + .../lib/src/model/affinity.dart | 52 + .../lib/src/model/affinity.g.dart | 37 + .../lib/src/model/all_params.dart | 43 + .../lib/src/model/all_params.g.dart | 54 + .../src/model/all_update_segment_params.dart | 43 + .../model/all_update_segment_params.g.dart | 41 + .../lib/src/model/compatible_sources.dart | 23 + .../lib/src/model/create_segment_params.dart | 43 + .../src/model/create_segment_params.g.dart | 30 + .../src/model/create_segment_response.dart | 49 + .../src/model/create_segment_response.g.dart | 39 + .../model/delete_model_instance_response.dart | 43 + .../delete_model_instance_response.g.dart | 28 + .../src/model/delete_segment_response.dart | 43 + .../src/model/delete_segment_response.g.dart | 28 + .../model/delete_user_profile_response.dart | 43 + .../model/delete_user_profile_response.g.dart | 28 + .../client_predict/lib/src/model/error.dart | 33 + .../client_predict/lib/src/model/error.g.dart | 22 + .../lib/src/model/error_base.dart | 47 + .../lib/src/model/error_base.g.dart | 35 + .../fetch_all_user_profiles_response.dart | 50 + .../fetch_all_user_profiles_response.g.dart | 44 + .../lib/src/model/funnel_stage.dart | 43 + .../lib/src/model/funnel_stage.g.dart | 26 + ..._available_model_types_response_inner.dart | 61 + ...vailable_model_types_response_inner.g.dart | 44 + ...ypes_response_inner_data_requirements.dart | 45 + ...es_response_inner_data_requirements.g.dart | 30 + .../get_model_instance_config_status.dart | 34 + .../src/model/get_model_metrics_response.dart | 43 + .../model/get_model_metrics_response.g.dart | 32 + .../src/model/get_segment_users_response.dart | 59 + .../model/get_segment_users_response.g.dart | 46 + .../lib/src/model/limit_param.dart | 34 + .../lib/src/model/limit_param.g.dart | 31 + .../lib/src/model/model_attributes.dart | 39 + .../lib/src/model/model_attributes.g.dart | 36 + .../lib/src/model/model_instance.dart | 98 ++ .../lib/src/model/model_instance.g.dart | 72 + .../lib/src/model/model_metrics.dart | 68 + .../lib/src/model/model_metrics.g.dart | 44 + .../lib/src/model/model_status.dart | 28 + .../lib/src/model/models_to_retrieve.dart | 25 + .../src/model/models_to_retrieve_param.dart | 37 + .../src/model/models_to_retrieve_param.g.dart | 45 + .../lib/src/model/next_page_token_param.dart | 36 + .../src/model/next_page_token_param.g.dart | 32 + .../lib/src/model/predictions.dart | 56 + .../lib/src/model/predictions.g.dart | 39 + .../model/predictions_affinities_success.dart | 42 + .../predictions_affinities_success.g.dart | 32 + .../predictions_funnel_stage_success.dart | 42 + .../predictions_funnel_stage_success.g.dart | 32 + .../predictions_order_value_success.dart | 42 + .../predictions_order_value_success.g.dart | 28 + .../src/model/previous_page_token_param.dart | 37 + .../model/previous_page_token_param.g.dart | 35 + .../lib/src/model/properties.dart | 49 + .../lib/src/model/properties.g.dart | 35 + .../client_predict/lib/src/model/segment.dart | 86 ++ .../lib/src/model/segment.g.dart | 62 + .../src/model/segment_affinity_filter.dart | 53 + .../src/model/segment_affinity_filter.g.dart | 54 + .../src/model/segment_child_conditions.dart | 47 + .../src/model/segment_child_conditions.g.dart | 34 + .../src/model/segment_condition_operator.dart | 28 + .../src/model/segment_conditions_param.dart | 36 + .../src/model/segment_conditions_param.g.dart | 39 + .../segment_filter_operator_boolean.dart | 28 + .../segment_filter_operator_numerical.dart | 40 + .../src/model/segment_filter_probability.dart | 51 + .../model/segment_filter_probability.g.dart | 41 + .../model/segment_funnel_stage_filter.dart | 48 + .../model/segment_funnel_stage_filter.g.dart | 49 + .../lib/src/model/segment_name_param.dart | 35 + .../lib/src/model/segment_name_param.g.dart | 32 + .../src/model/segment_operand_affinity.dart | 42 + .../src/model/segment_operand_affinity.g.dart | 33 + .../model/segment_operand_funnel_stage.dart | 42 + .../model/segment_operand_funnel_stage.g.dart | 33 + .../model/segment_operand_order_value.dart | 42 + .../model/segment_operand_order_value.g.dart | 33 + .../src/model/segment_operand_property.dart | 42 + .../src/model/segment_operand_property.g.dart | 33 + .../src/model/segment_order_value_filter.dart | 42 + .../model/segment_order_value_filter.g.dart | 48 + .../src/model/segment_parent_conditions.dart | 48 + .../model/segment_parent_conditions.g.dart | 34 + .../src/model/segment_property_filter.dart | 43 + .../src/model/segment_property_filter.g.dart | 48 + .../lib/src/model/segment_status.dart | 31 + .../lib/src/model/segment_type.dart | 28 + .../lib/src/model/segments.dart | 41 + .../lib/src/model/segments.g.dart | 26 + .../lib/src/model/types_to_retrieve.dart | 24 + .../src/model/types_to_retrieve_param.dart | 36 + .../src/model/types_to_retrieve_param.g.dart | 44 + .../model/update_model_instance_response.dart | 43 + .../update_model_instance_response.g.dart | 28 + .../lib/src/model/update_model_params.dart | 49 + .../lib/src/model/update_model_params.g.dart | 43 + .../src/model/update_segment_response.dart | 49 + .../src/model/update_segment_response.g.dart | 39 + .../lib/src/model/user_profile.dart | 58 + .../lib/src/model/user_profile.g.dart | 50 + .../client_predict/lib/src/version.dart | 2 + .../packages/client_predict/pubspec.yaml | 24 + .../client_query_suggestions/build.yaml | 14 + .../lib/algolia_client_query_suggestions.dart | 21 + .../lib/src/api/query_suggestions_client.dart | 402 ++++++ .../lib/src/deserialize.dart | 98 ++ .../lib/src/model/base_response.dart | 43 + .../lib/src/model/base_response.g.dart | 34 + .../lib/src/model/error_base.dart | 47 + .../lib/src/model/error_base.g.dart | 35 + .../lib/src/model/facet.dart | 40 + .../lib/src/model/facet.g.dart | 33 + .../model/get_config_status200_response.dart | 66 + .../get_config_status200_response.g.dart | 45 + .../src/model/get_log_file200_response.dart | 59 + .../src/model/get_log_file200_response.g.dart | 47 + .../lib/src/model/log_level.dart | 31 + .../query_suggestions_configuration.dart | 69 + .../query_suggestions_configuration.g.dart | 50 + ...ry_suggestions_configuration_response.dart | 106 ++ ..._suggestions_configuration_response.g.dart | 66 + ...estions_configuration_response_all_of.dart | 61 + ...tions_configuration_response_all_of.g.dart | 44 + ..._suggestions_configuration_with_index.dart | 78 + ...uggestions_configuration_with_index.g.dart | 56 + ...tions_configuration_with_index_all_of.dart | 39 + ...ons_configuration_with_index_all_of.g.dart | 27 + .../lib/src/model/source_index.dart | 89 ++ .../lib/src/model/source_index.g.dart | 58 + .../lib/src/version.dart | 2 + .../client_query_suggestions/pubspec.yaml | 24 + .../packages/client_recommend/build.yaml | 14 + .../lib/algolia_client_recommend.dart | 72 + .../lib/src/api/recommend_client.dart | 384 +++++ .../client_recommend/lib/src/deserialize.dart | 280 ++++ .../src/model/advanced_syntax_features.dart | 24 + .../lib/src/model/alternatives_as_exact.dart | 25 + .../lib/src/model/anchoring.dart | 34 + .../lib/src/model/around_radius_all.dart | 23 + .../lib/src/model/automatic_facet_filter.dart | 49 + .../src/model/automatic_facet_filter.g.dart | 39 + .../lib/src/model/base_recommend_request.dart | 67 + .../src/model/base_recommend_request.g.dart | 52 + .../model/base_recommendation_request.dart | 43 + .../model/base_recommendation_request.g.dart | 34 + .../lib/src/model/base_search_params.dart | 289 ++++ .../lib/src/model/base_search_params.g.dart | 120 ++ .../base_search_params_without_query.dart | 282 ++++ .../base_search_params_without_query.g.dart | 120 ++ .../lib/src/model/base_search_response.dart | 217 +++ .../lib/src/model/base_search_response.g.dart | 107 ++ .../model/base_search_response_redirect.dart | 36 + .../base_search_response_redirect.g.dart | 39 + .../lib/src/model/base_trending_request.dart | 49 + .../src/model/base_trending_request.g.dart | 43 + .../lib/src/model/condition.dart | 59 + .../lib/src/model/condition.g.dart | 45 + .../lib/src/model/consequence.dart | 70 + .../lib/src/model/consequence.g.dart | 48 + .../lib/src/model/consequence_hide.dart | 36 + .../lib/src/model/consequence_hide.g.dart | 24 + .../lib/src/model/consequence_params.dart | 642 +++++++++ .../lib/src/model/consequence_params.g.dart | 312 ++++ .../src/model/consequence_query_object.dart | 44 + .../src/model/consequence_query_object.g.dart | 41 + .../lib/src/model/deleted_at_response.dart | 43 + .../lib/src/model/deleted_at_response.g.dart | 26 + .../client_recommend/lib/src/model/edit.dart | 48 + .../lib/src/model/edit.g.dart | 41 + .../lib/src/model/edit_type.dart | 28 + .../lib/src/model/error_base.dart | 47 + .../lib/src/model/error_base.g.dart | 35 + .../src/model/exact_on_single_word_query.dart | 31 + .../lib/src/model/facet_ordering.dart | 44 + .../lib/src/model/facet_ordering.g.dart | 44 + .../lib/src/model/facets.dart | 34 + .../lib/src/model/facets.g.dart | 32 + .../lib/src/model/facets_stats.dart | 55 + .../lib/src/model/facets_stats.g.dart | 37 + .../model/get_recommend_task_response.dart | 36 + .../model/get_recommend_task_response.g.dart | 32 + .../src/model/get_recommendations_params.dart | 39 + .../model/get_recommendations_params.g.dart | 26 + .../model/get_recommendations_response.dart | 36 + .../model/get_recommendations_response.g.dart | 39 + .../src/model/highlight_result_option.dart | 59 + .../src/model/highlight_result_option.g.dart | 50 + .../index_settings_as_search_params.dart | 364 +++++ .../index_settings_as_search_params.g.dart | 217 +++ ...ings_as_search_params_semantic_search.dart | 39 + ...gs_as_search_params_semantic_search.g.dart | 38 + .../lib/src/model/match_level.dart | 31 + .../lib/src/model/matched_geo_location.dart | 49 + .../lib/src/model/matched_geo_location.g.dart | 36 + .../client_recommend/lib/src/model/mode.dart | 28 + .../lib/src/model/params.dart | 65 + .../lib/src/model/params.g.dart | 44 + .../lib/src/model/personalization.dart | 50 + .../lib/src/model/personalization.g.dart | 36 + .../lib/src/model/promote_object_id.dart | 43 + .../lib/src/model/promote_object_id.g.dart | 26 + .../lib/src/model/promote_object_ids.dart | 43 + .../lib/src/model/promote_object_ids.g.dart | 27 + .../lib/src/model/query_type.dart | 31 + .../lib/src/model/ranking_info.dart | 122 ++ .../lib/src/model/ranking_info.g.dart | 67 + .../lib/src/model/recommend_hit.dart | 90 ++ .../lib/src/model/recommend_hit.g.dart | 65 + .../lib/src/model/recommend_hits.dart | 35 + .../lib/src/model/recommend_hits.g.dart | 28 + .../lib/src/model/recommend_models.dart | 26 + .../lib/src/model/recommendation_models.dart | 28 + .../lib/src/model/recommendation_request.dart | 81 ++ .../src/model/recommendation_request.g.dart | 62 + .../src/model/recommendations_response.dart | 224 +++ .../src/model/recommendations_response.g.dart | 115 ++ .../model/redirect_rule_index_metadata.dart | 66 + .../model/redirect_rule_index_metadata.g.dart | 37 + .../redirect_rule_index_metadata_data.dart | 36 + .../redirect_rule_index_metadata_data.g.dart | 26 + .../src/model/remove_words_if_no_results.dart | 34 + .../lib/src/model/rendering_content.dart | 36 + .../lib/src/model/rendering_content.g.dart | 36 + .../lib/src/model/rule_response.dart | 74 + .../lib/src/model/rule_response.g.dart | 56 + .../lib/src/model/rule_response_metadata.dart | 36 + .../src/model/rule_response_metadata.g.dart | 34 + .../lib/src/model/search_params_object.dart | 622 ++++++++ .../lib/src/model/search_params_object.g.dart | 305 ++++ .../lib/src/model/search_params_query.dart | 36 + .../lib/src/model/search_params_query.g.dart | 32 + .../model/search_recommend_rules_params.dart | 76 + .../search_recommend_rules_params.g.dart | 45 + .../search_recommend_rules_response.dart | 57 + .../search_recommend_rules_response.g.dart | 36 + .../lib/src/model/snippet_result_option.dart | 43 + .../src/model/snippet_result_option.g.dart | 34 + .../lib/src/model/sort_remaining_by.dart | 31 + .../lib/src/model/task_status.dart | 28 + .../lib/src/model/trending_models.dart | 28 + .../lib/src/model/trending_request.dart | 88 ++ .../lib/src/model/trending_request.g.dart | 62 + .../lib/src/model/typo_tolerance_enum.dart | 24 + .../client_recommend/lib/src/model/value.dart | 42 + .../lib/src/model/value.g.dart | 41 + .../client_recommend/lib/src/version.dart | 2 + .../packages/client_recommend/pubspec.yaml | 24 + .../lib/src/api/search_client.dart | 206 +-- .../client_search/lib/src/deserialize.dart | 52 + .../client_search/lib/src/model/acl.dart | 7 + .../client_search/lib/src/model/action.dart | 7 + .../src/model/advanced_syntax_features.dart | 7 + .../lib/src/model/alternatives_as_exact.dart | 7 + .../lib/src/model/anchoring.dart | 7 + .../lib/src/model/around_radius_all.dart | 7 + .../lib/src/model/base_search_params.dart | 23 + .../base_search_params_without_query.dart | 23 + .../lib/src/model/browse_params_object.dart | 35 + .../src/model/built_in_operation_type.dart | 7 + .../lib/src/model/consequence.dart | 3 + .../lib/src/model/consequence_params.dart | 44 + .../lib/src/model/delete_by_params.dart | 15 + .../lib/src/model/dictionary_action.dart | 7 + .../lib/src/model/dictionary_entry_state.dart | 7 + .../lib/src/model/dictionary_type.dart | 7 + .../lib/src/model/edit_type.dart | 7 + .../src/model/exact_on_single_word_query.dart | 7 + .../lib/src/model/index_settings.dart | 12 + .../index_settings_as_search_params.dart | 12 + .../client_search/lib/src/model/log_type.dart | 7 + .../lib/src/model/match_level.dart | 7 + .../client_search/lib/src/model/mode.dart | 7 + .../lib/src/model/operation_type.dart | 7 + .../client_search/lib/src/model/params.dart | 9 + .../lib/src/model/query_type.dart | 7 + .../src/model/remove_words_if_no_results.dart | 7 + .../lib/src/model/scope_type.dart | 7 + .../lib/src/model/search_for_facets.dart | 35 + .../lib/src/model/search_for_hits.dart | 35 + .../lib/src/model/search_method_params.dart | 3 + .../lib/src/model/search_params_object.dart | 35 + .../lib/src/model/search_responses.dart | 3 + .../lib/src/model/search_strategy.dart | 7 + .../lib/src/model/search_type_default.dart | 7 + .../lib/src/model/search_type_facet.dart | 7 + .../lib/src/model/sort_remaining_by.dart | 7 + .../lib/src/model/synonym_type.dart | 7 + .../lib/src/model/task_status.dart | 7 + .../lib/src/model/typo_tolerance_enum.dart | 7 + .../lib/src/model/user_highlight_result.dart | 6 + .../packages/client_search/pubspec.yaml | 2 +- 693 files changed, 34860 insertions(+), 120 deletions(-) create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/build.yaml create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/algolia_client_abtesting.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/api/abtesting_client.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/deserialize.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_test.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_test.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_test_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_test_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_tests_variant.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_tests_variant.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_tests_variant_search_params.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_tests_variant_search_params.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/add_ab_tests_request.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/add_ab_tests_request.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/custom_search_params.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/custom_search_params.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/error_base.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/error_base.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/list_ab_tests_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/list_ab_tests_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/variant.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/variant.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/version.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_abtesting/pubspec.yaml create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/build.yaml create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/algolia_client_analytics.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/api/analytics_client.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/deserialize.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/average_click_event.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/average_click_event.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/click_position.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/click_position.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/click_through_rate_event.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/click_through_rate_event.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/conversion_rate_event.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/conversion_rate_event.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/direction.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/error_base.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/error_base.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_average_click_position_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_average_click_position_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_click_positions_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_click_positions_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_click_through_rate_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_click_through_rate_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_conversation_rate_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_conversation_rate_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_no_click_rate_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_no_click_rate_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_no_results_rate_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_no_results_rate_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_count_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_count_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_no_clicks_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_no_clicks_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_no_results_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_no_results_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_status_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_status_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_countries_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_countries_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_attribute.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_attribute.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_attributes_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_attributes_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_for_attribute.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_for_attribute.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_for_attribute_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_for_attribute_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_value.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_value.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_values.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_values.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_users_count_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_users_count_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/no_click_rate_event.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/no_click_rate_event.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/no_results_rate_event.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/no_results_rate_event.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/order_by.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_event.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_event.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_no_click_event.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_no_click_event.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_no_result_event.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_no_result_event.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_country.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_country.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hit.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hit.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hit_with_analytics.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hit_with_analytics.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hits_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hits_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hits_response_with_analytics.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hits_response_with_analytics.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_search.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_search.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_search_with_analytics.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_search_with_analytics.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_searches_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_searches_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_searches_response_with_analytics.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_searches_response_with_analytics.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/user_with_date.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/user_with_date.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/lib/src/version.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_analytics/pubspec.yaml create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/build.yaml create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/algolia_client_ingestion.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/api/ingestion_client.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/deserialize.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/action_type.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_algolia.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_algolia.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_algolia_partial.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_algolia_partial.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_api_key.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_api_key.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_api_key_partial.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_api_key_partial.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_basic.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_basic.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_basic_partial.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_basic_partial.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_google_service_account.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_google_service_account.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_google_service_account_partial.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_google_service_account_partial.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_o_auth.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_o_auth.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_o_auth_partial.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_o_auth_partial.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_create.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_create.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_create_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_create_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_search.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_search.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_sort_keys.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_type.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_update.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_update.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_update_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_update_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/big_commerce_channel.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/big_commerce_channel.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/big_query_data_type.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/delete_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/delete_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_create.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_create.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_create_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_create_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_index_name.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_index_name.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_index_prefix.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_index_prefix.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_search.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_search.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_sort_keys.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_type.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_update.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_update.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_update_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_update_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/docker_image_type.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/docker_registry.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/error_base.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/error_base.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/event.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/event.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/event_sort_keys.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/event_status.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/event_type.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_authentications_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_authentications_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_destinations_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_destinations_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_events_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_events_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_sources_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_sources_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_tasks_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_tasks_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/mapping_type_csv.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/method_type.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_date_utils_input.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_date_utils_input.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_trigger.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_trigger.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_trigger_input.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_trigger_input.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_trigger_type.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/order_keys.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/pagination.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/pagination.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/platform.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/platform_none.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_list_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_list_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_outcome.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_progress.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_progress.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_reason_code.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_sort_keys.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_status.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_type.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_date_utils_input.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_date_utils_input.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_trigger.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_trigger.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_trigger_input.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_trigger_input.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_trigger_type.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_big_commerce.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_big_commerce.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_big_query.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_big_query.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_commercetools.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_commercetools.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_create.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_create.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_create_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_create_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_csv.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_csv.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_docker.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_docker.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_json.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_json.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_search.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_search.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_sort_keys.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_type.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update_commercetools.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update_commercetools.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/subscription_trigger.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/subscription_trigger.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/subscription_trigger_type.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_create.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_create.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_create_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_create_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_search.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_search.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_sort_keys.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_update.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_update.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_update_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_update_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/trigger_input.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/trigger_input.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/trigger_type.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/version.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_ingestion/pubspec.yaml create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/build.yaml create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/algolia_client_monitoring.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/api/monitoring_client.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/deserialize.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/error_base.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/error_base.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/get_inventory403_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/get_inventory403_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incident.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incident.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incidents_inner.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incidents_inner.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incidents_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incidents_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/indexing_time_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/indexing_time_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/indexing_time_response_metrics.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/indexing_time_response_metrics.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/infrastructure_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/infrastructure_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/infrastructure_response_metrics.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/infrastructure_response_metrics.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/inventory_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/inventory_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/latency_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/latency_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/latency_response_metrics.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/latency_response_metrics.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/metric.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/period.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/probes_metric.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/probes_metric.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/region.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/server.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/server.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/server_status.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/status.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/status_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/status_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/time_inner.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/time_inner.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/type.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/version.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_monitoring/pubspec.yaml create mode 100644 clients/algoliasearch-client-dart/packages/client_personalization/build.yaml create mode 100644 clients/algoliasearch-client-dart/packages/client_personalization/lib/algolia_client_personalization.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_personalization/lib/src/api/personalization_client.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_personalization/lib/src/deserialize.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/delete_user_profile_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/delete_user_profile_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/error_base.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/error_base.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/event_scoring.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/event_scoring.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/facet_scoring.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/facet_scoring.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/get_user_token_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/get_user_token_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/personalization_strategy_params.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/personalization_strategy_params.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/set_personalization_strategy_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/set_personalization_strategy_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_personalization/lib/src/version.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_personalization/pubspec.yaml create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/build.yaml create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/algolia_client_predict.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/api/predict_client.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/deserialize.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_instance_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_instance_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_params.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_params.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/affinity.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/affinity.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_params.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_params.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_update_segment_params.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_update_segment_params.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/compatible_sources.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_params.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_params.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_model_instance_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_model_instance_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_segment_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_segment_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_user_profile_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_user_profile_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error_base.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error_base.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/fetch_all_user_profiles_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/fetch_all_user_profiles_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/funnel_stage.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/funnel_stage.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner_data_requirements.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner_data_requirements.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_model_instance_config_status.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_model_metrics_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_model_metrics_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_segment_users_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_segment_users_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/limit_param.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/limit_param.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_attributes.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_attributes.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_instance.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_instance.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_metrics.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_metrics.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_status.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/models_to_retrieve.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/models_to_retrieve_param.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/models_to_retrieve_param.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/next_page_token_param.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/next_page_token_param.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_affinities_success.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_affinities_success.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_funnel_stage_success.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_funnel_stage_success.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_order_value_success.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_order_value_success.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/previous_page_token_param.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/previous_page_token_param.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/properties.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/properties.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_affinity_filter.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_affinity_filter.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_child_conditions.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_child_conditions.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_condition_operator.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_conditions_param.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_conditions_param.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_operator_boolean.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_operator_numerical.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_probability.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_probability.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_funnel_stage_filter.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_funnel_stage_filter.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_name_param.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_name_param.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_affinity.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_affinity.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_funnel_stage.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_funnel_stage.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_order_value.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_order_value.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_property.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_property.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_order_value_filter.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_order_value_filter.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_parent_conditions.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_parent_conditions.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_property_filter.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_property_filter.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_status.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_type.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segments.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segments.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/types_to_retrieve.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/types_to_retrieve_param.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/types_to_retrieve_param.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_instance_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_instance_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_params.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_params.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_segment_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_segment_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/user_profile.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/user_profile.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/version.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_predict/pubspec.yaml create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/build.yaml create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/algolia_client_query_suggestions.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/api/query_suggestions_client.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/deserialize.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/base_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/base_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/error_base.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/error_base.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/facet.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/facet.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/get_config_status200_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/get_config_status200_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/get_log_file200_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/get_log_file200_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/log_level.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_response_all_of.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_response_all_of.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_with_index.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_with_index.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_with_index_all_of.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_with_index_all_of.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/source_index.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/source_index.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/version.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_query_suggestions/pubspec.yaml create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/build.yaml create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/algolia_client_recommend.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/api/recommend_client.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/deserialize.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/advanced_syntax_features.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/alternatives_as_exact.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/anchoring.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/around_radius_all.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/automatic_facet_filter.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/automatic_facet_filter.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommend_request.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommend_request.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommendation_request.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommendation_request.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_params.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_params.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_params_without_query.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_params_without_query.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_response_redirect.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_response_redirect.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_trending_request.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_trending_request.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/condition.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/condition.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_hide.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_hide.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_params.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_params.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_query_object.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_query_object.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/deleted_at_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/deleted_at_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/edit.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/edit.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/edit_type.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/error_base.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/error_base.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/exact_on_single_word_query.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facet_ordering.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facet_ordering.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facets.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facets.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facets_stats.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facets_stats.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommend_task_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommend_task_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_params.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_params.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/highlight_result_option.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/highlight_result_option.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/index_settings_as_search_params.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/index_settings_as_search_params.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/index_settings_as_search_params_semantic_search.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/index_settings_as_search_params_semantic_search.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/match_level.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/matched_geo_location.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/matched_geo_location.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/mode.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/params.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/params.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/personalization.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/personalization.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/promote_object_id.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/promote_object_id.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/promote_object_ids.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/promote_object_ids.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/query_type.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/ranking_info.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/ranking_info.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_hit.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_hit.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_hits.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_hits.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_models.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommendation_models.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommendation_request.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommendation_request.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommendations_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommendations_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/redirect_rule_index_metadata.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/redirect_rule_index_metadata.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/redirect_rule_index_metadata_data.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/redirect_rule_index_metadata_data.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/remove_words_if_no_results.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rendering_content.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rendering_content.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rule_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rule_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rule_response_metadata.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rule_response_metadata.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_params_object.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_params_object.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_params_query.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_params_query.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_recommend_rules_params.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_recommend_rules_params.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_recommend_rules_response.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_recommend_rules_response.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/snippet_result_option.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/snippet_result_option.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/sort_remaining_by.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/task_status.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/trending_models.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/trending_request.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/trending_request.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/typo_tolerance_enum.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/value.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/value.g.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/version.dart create mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/pubspec.yaml diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/api/search_client.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/api/search_client.dart index c13a37cc10..bafee77448 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/api/search_client.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/api/search_client.dart @@ -48,9 +48,9 @@ final class SearchClient implements ApiClient { /// This method allow you to send requests to the Algolia REST API. /// /// Parameters: - /// * [path] - Path of the endpoint, anything after \"/1\" must be specified. - /// * [parameters] - Query parameters to apply to the current query. - /// * [body] - Parameters to send with the custom request. + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [body] Parameters to send with the custom request. /// * [requestOptions] additional request configuration. Future post({ required String path, @@ -85,7 +85,7 @@ final class SearchClient implements ApiClient { /// Send multiple search queries to one or more indices. /// /// Parameters: - /// * [searchMethodParams] - Query requests and strategies. Results will be received in the same order as the queries. + /// * [searchMethodParams] Query requests and strategies. Results will be received in the same order as the queries. /// * [requestOptions] additional request configuration. Future search({ required SearchMethodParams searchMethodParams, diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/deserialize.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/deserialize.dart index d61dba75c1..ffc2ca17b7 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/deserialize.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/deserialize.dart @@ -1,5 +1,11 @@ +import 'package:algoliasearch/src/model/acl.dart'; +import 'package:algoliasearch/src/model/action.dart'; import 'package:algoliasearch/src/model/add_api_key_response.dart'; +import 'package:algoliasearch/src/model/advanced_syntax_features.dart'; +import 'package:algoliasearch/src/model/alternatives_as_exact.dart'; +import 'package:algoliasearch/src/model/anchoring.dart'; import 'package:algoliasearch/src/model/api_key.dart'; +import 'package:algoliasearch/src/model/around_radius_all.dart'; import 'package:algoliasearch/src/model/automatic_facet_filter.dart'; import 'package:algoliasearch/src/model/base_get_api_key_response.dart'; import 'package:algoliasearch/src/model/base_index_settings.dart'; @@ -10,6 +16,7 @@ import 'package:algoliasearch/src/model/base_search_response_redirect.dart'; import 'package:algoliasearch/src/model/browse_params_object.dart'; import 'package:algoliasearch/src/model/browse_response.dart'; import 'package:algoliasearch/src/model/built_in_operation.dart'; +import 'package:algoliasearch/src/model/built_in_operation_type.dart'; import 'package:algoliasearch/src/model/condition.dart'; import 'package:algoliasearch/src/model/consequence.dart'; import 'package:algoliasearch/src/model/consequence_hide.dart'; @@ -17,10 +24,15 @@ import 'package:algoliasearch/src/model/consequence_params.dart'; import 'package:algoliasearch/src/model/consequence_query_object.dart'; import 'package:algoliasearch/src/model/cursor.dart'; import 'package:algoliasearch/src/model/delete_by_params.dart'; +import 'package:algoliasearch/src/model/dictionary_action.dart'; import 'package:algoliasearch/src/model/dictionary_entry.dart'; +import 'package:algoliasearch/src/model/dictionary_entry_state.dart'; import 'package:algoliasearch/src/model/dictionary_language.dart'; +import 'package:algoliasearch/src/model/dictionary_type.dart'; import 'package:algoliasearch/src/model/edit.dart'; +import 'package:algoliasearch/src/model/edit_type.dart'; import 'package:algoliasearch/src/model/error_base.dart'; +import 'package:algoliasearch/src/model/exact_on_single_word_query.dart'; import 'package:algoliasearch/src/model/facet_hits.dart'; import 'package:algoliasearch/src/model/facet_ordering.dart'; import 'package:algoliasearch/src/model/facets.dart'; @@ -34,16 +46,23 @@ import 'package:algoliasearch/src/model/index_settings_as_search_params.dart'; import 'package:algoliasearch/src/model/index_settings_as_search_params_semantic_search.dart'; import 'package:algoliasearch/src/model/languages.dart'; import 'package:algoliasearch/src/model/list_indices_response.dart'; +import 'package:algoliasearch/src/model/log_type.dart'; +import 'package:algoliasearch/src/model/match_level.dart'; import 'package:algoliasearch/src/model/matched_geo_location.dart'; +import 'package:algoliasearch/src/model/mode.dart'; +import 'package:algoliasearch/src/model/operation_type.dart'; import 'package:algoliasearch/src/model/params.dart'; import 'package:algoliasearch/src/model/personalization.dart'; import 'package:algoliasearch/src/model/promote_object_id.dart'; import 'package:algoliasearch/src/model/promote_object_ids.dart'; +import 'package:algoliasearch/src/model/query_type.dart'; import 'package:algoliasearch/src/model/ranking_info.dart'; import 'package:algoliasearch/src/model/redirect_rule_index_metadata.dart'; import 'package:algoliasearch/src/model/redirect_rule_index_metadata_data.dart'; +import 'package:algoliasearch/src/model/remove_words_if_no_results.dart'; import 'package:algoliasearch/src/model/rendering_content.dart'; import 'package:algoliasearch/src/model/rule.dart'; +import 'package:algoliasearch/src/model/scope_type.dart'; import 'package:algoliasearch/src/model/search_for_facet_values_response.dart'; import 'package:algoliasearch/src/model/search_for_facets.dart'; import 'package:algoliasearch/src/model/search_for_facets_options.dart'; @@ -56,12 +75,19 @@ import 'package:algoliasearch/src/model/search_params_query.dart'; import 'package:algoliasearch/src/model/search_params_string.dart'; import 'package:algoliasearch/src/model/search_response.dart'; import 'package:algoliasearch/src/model/search_responses.dart'; +import 'package:algoliasearch/src/model/search_strategy.dart'; import 'package:algoliasearch/src/model/search_synonyms_response.dart'; +import 'package:algoliasearch/src/model/search_type_default.dart'; +import 'package:algoliasearch/src/model/search_type_facet.dart'; import 'package:algoliasearch/src/model/snippet_result_option.dart'; +import 'package:algoliasearch/src/model/sort_remaining_by.dart'; import 'package:algoliasearch/src/model/source.dart'; import 'package:algoliasearch/src/model/standard_entries.dart'; import 'package:algoliasearch/src/model/synonym_hit.dart'; +import 'package:algoliasearch/src/model/synonym_type.dart'; +import 'package:algoliasearch/src/model/task_status.dart'; import 'package:algoliasearch/src/model/time_range.dart'; +import 'package:algoliasearch/src/model/typo_tolerance_enum.dart'; import 'package:algoliasearch/src/model/updated_rule_response.dart'; import 'package:algoliasearch/src/model/user_id.dart'; import 'package:algoliasearch/src/model/value.dart'; @@ -86,16 +112,22 @@ ReturnType deserialize(dynamic value, String targetType, case 'double': return (value is double ? value : double.parse('$value')) as ReturnType; case 'Acl': + return Acl.fromJson(value) as ReturnType; case 'Action': + return Action.fromJson(value) as ReturnType; case 'AddApiKeyResponse': return AddApiKeyResponse.fromJson(value as Map) as ReturnType; case 'AdvancedSyntaxFeatures': + return AdvancedSyntaxFeatures.fromJson(value) as ReturnType; case 'AlternativesAsExact': + return AlternativesAsExact.fromJson(value) as ReturnType; case 'Anchoring': + return Anchoring.fromJson(value) as ReturnType; case 'ApiKey': return ApiKey.fromJson(value as Map) as ReturnType; case 'AroundRadiusAll': + return AroundRadiusAll.fromJson(value) as ReturnType; case 'AutomaticFacetFilter': return AutomaticFacetFilter.fromJson(value as Map) as ReturnType; @@ -127,6 +159,7 @@ ReturnType deserialize(dynamic value, String targetType, return BuiltInOperation.fromJson(value as Map) as ReturnType; case 'BuiltInOperationType': + return BuiltInOperationType.fromJson(value) as ReturnType; case 'Condition': return Condition.fromJson(value as Map) as ReturnType; case 'Consequence': @@ -146,20 +179,25 @@ ReturnType deserialize(dynamic value, String targetType, return DeleteByParams.fromJson(value as Map) as ReturnType; case 'DictionaryAction': + return DictionaryAction.fromJson(value) as ReturnType; case 'DictionaryEntry': return DictionaryEntry.fromJson(value as Map) as ReturnType; case 'DictionaryEntryState': + return DictionaryEntryState.fromJson(value) as ReturnType; case 'DictionaryLanguage': return DictionaryLanguage.fromJson(value as Map) as ReturnType; case 'DictionaryType': + return DictionaryType.fromJson(value) as ReturnType; case 'Edit': return Edit.fromJson(value as Map) as ReturnType; case 'EditType': + return EditType.fromJson(value) as ReturnType; case 'ErrorBase': return ErrorBase.fromJson(value as Map) as ReturnType; case 'ExactOnSingleWordQuery': + return ExactOnSingleWordQuery.fromJson(value) as ReturnType; case 'FacetHits': return FacetHits.fromJson(value as Map) as ReturnType; case 'FacetOrdering': @@ -194,12 +232,16 @@ ReturnType deserialize(dynamic value, String targetType, return ListIndicesResponse.fromJson(value as Map) as ReturnType; case 'LogType': + return LogType.fromJson(value) as ReturnType; case 'MatchLevel': + return MatchLevel.fromJson(value) as ReturnType; case 'MatchedGeoLocation': return MatchedGeoLocation.fromJson(value as Map) as ReturnType; case 'Mode': + return Mode.fromJson(value) as ReturnType; case 'OperationType': + return OperationType.fromJson(value) as ReturnType; case 'Params': return Params.fromJson(value as Map) as ReturnType; case 'Personalization': @@ -212,6 +254,7 @@ ReturnType deserialize(dynamic value, String targetType, return PromoteObjectIDs.fromJson(value as Map) as ReturnType; case 'QueryType': + return QueryType.fromJson(value) as ReturnType; case 'RankingInfo': return RankingInfo.fromJson(value as Map) as ReturnType; case 'RedirectRuleIndexMetadata': @@ -221,12 +264,14 @@ ReturnType deserialize(dynamic value, String targetType, return RedirectRuleIndexMetadataData.fromJson( value as Map) as ReturnType; case 'RemoveWordsIfNoResults': + return RemoveWordsIfNoResults.fromJson(value) as ReturnType; case 'RenderingContent': return RenderingContent.fromJson(value as Map) as ReturnType; case 'Rule': return Rule.fromJson(value as Map) as ReturnType; case 'ScopeType': + return ScopeType.fromJson(value) as ReturnType; case 'SearchForFacetValuesResponse': return SearchForFacetValuesResponse.fromJson( value as Map) as ReturnType; @@ -263,15 +308,19 @@ ReturnType deserialize(dynamic value, String targetType, return SearchResponses.fromJson(value as Map) as ReturnType; case 'SearchStrategy': + return SearchStrategy.fromJson(value) as ReturnType; case 'SearchSynonymsResponse': return SearchSynonymsResponse.fromJson(value as Map) as ReturnType; case 'SearchTypeDefault': + return SearchTypeDefault.fromJson(value) as ReturnType; case 'SearchTypeFacet': + return SearchTypeFacet.fromJson(value) as ReturnType; case 'SnippetResultOption': return SnippetResultOption.fromJson(value as Map) as ReturnType; case 'SortRemainingBy': + return SortRemainingBy.fromJson(value) as ReturnType; case 'Source': return Source.fromJson(value as Map) as ReturnType; case 'StandardEntries': @@ -280,10 +329,13 @@ ReturnType deserialize(dynamic value, String targetType, case 'SynonymHit': return SynonymHit.fromJson(value as Map) as ReturnType; case 'SynonymType': + return SynonymType.fromJson(value) as ReturnType; case 'TaskStatus': + return TaskStatus.fromJson(value) as ReturnType; case 'TimeRange': return TimeRange.fromJson(value as Map) as ReturnType; case 'TypoToleranceEnum': + return TypoToleranceEnum.fromJson(value) as ReturnType; case 'UpdatedRuleResponse': return UpdatedRuleResponse.fromJson(value as Map) as ReturnType; diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/acl.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/acl.dart index 0a835e3a71..34acb23f78 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/acl.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/acl.dart @@ -52,6 +52,13 @@ enum Acl { dynamic toJson() => raw; + static Acl fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/action.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/action.dart index f446316f46..fef51d0ee2 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/action.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/action.dart @@ -31,6 +31,13 @@ enum Action { dynamic toJson() => raw; + static Action fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/advanced_syntax_features.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/advanced_syntax_features.dart index df2eb29ed0..b63f46b55a 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/advanced_syntax_features.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/advanced_syntax_features.dart @@ -12,6 +12,13 @@ enum AdvancedSyntaxFeatures { dynamic toJson() => raw; + static AdvancedSyntaxFeatures fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/alternatives_as_exact.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/alternatives_as_exact.dart index 28ff5e8ec5..58dea73f89 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/alternatives_as_exact.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/alternatives_as_exact.dart @@ -13,6 +13,13 @@ enum AlternativesAsExact { dynamic toJson() => raw; + static AlternativesAsExact fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/anchoring.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/anchoring.dart index c67999e8cf..c5f1439dde 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/anchoring.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/anchoring.dart @@ -22,6 +22,13 @@ enum Anchoring { dynamic toJson() => raw; + static Anchoring fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/around_radius_all.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/around_radius_all.dart index 74c5a5a50d..907fb416e0 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/around_radius_all.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/around_radius_all.dart @@ -11,6 +11,13 @@ enum AroundRadiusAll { dynamic toJson() => raw; + static AroundRadiusAll fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_search_params.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_search_params.dart index a9e8a470e1..5f3cf2602a 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_search_params.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_search_params.dart @@ -57,15 +57,31 @@ final class BaseSearchParams { @JsonKey(name: r'filters') final String? filters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'facetFilters') final dynamic facetFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'optionalFilters') final dynamic optionalFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'numericFilters') final dynamic numericFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'tagFilters') final dynamic tagFilters; @@ -111,6 +127,9 @@ final class BaseSearchParams { @JsonKey(name: r'aroundLatLngViaIP') final bool? aroundLatLngViaIP; + /// One of types: + /// - [AroundRadiusAll] + /// - [int] @JsonKey(name: r'aroundRadius') final dynamic aroundRadius; @@ -175,6 +194,10 @@ final class BaseSearchParams { @JsonKey(name: r'enableReRanking') final bool? enableReRanking; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'reRankingApplyFilter') final dynamic reRankingApplyFilter; diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_search_params_without_query.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_search_params_without_query.dart index 612ed9fdaf..4dc6cebbfb 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_search_params_without_query.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/base_search_params_without_query.dart @@ -52,15 +52,31 @@ final class BaseSearchParamsWithoutQuery { @JsonKey(name: r'filters') final String? filters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'facetFilters') final dynamic facetFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'optionalFilters') final dynamic optionalFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'numericFilters') final dynamic numericFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'tagFilters') final dynamic tagFilters; @@ -106,6 +122,9 @@ final class BaseSearchParamsWithoutQuery { @JsonKey(name: r'aroundLatLngViaIP') final bool? aroundLatLngViaIP; + /// One of types: + /// - [AroundRadiusAll] + /// - [int] @JsonKey(name: r'aroundRadius') final dynamic aroundRadius; @@ -170,6 +189,10 @@ final class BaseSearchParamsWithoutQuery { @JsonKey(name: r'enableReRanking') final bool? enableReRanking; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'reRankingApplyFilter') final dynamic reRankingApplyFilter; diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/browse_params_object.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/browse_params_object.dart index c5e87b4f4f..1fd0b4dc49 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/browse_params_object.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/browse_params_object.dart @@ -111,15 +111,31 @@ final class BrowseParamsObject { @JsonKey(name: r'filters') final String? filters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'facetFilters') final dynamic facetFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'optionalFilters') final dynamic optionalFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'numericFilters') final dynamic numericFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'tagFilters') final dynamic tagFilters; @@ -165,6 +181,9 @@ final class BrowseParamsObject { @JsonKey(name: r'aroundLatLngViaIP') final bool? aroundLatLngViaIP; + /// One of types: + /// - [AroundRadiusAll] + /// - [int] @JsonKey(name: r'aroundRadius') final dynamic aroundRadius; @@ -229,6 +248,10 @@ final class BrowseParamsObject { @JsonKey(name: r'enableReRanking') final bool? enableReRanking; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'reRankingApplyFilter') final dynamic reRankingApplyFilter; @@ -294,6 +317,9 @@ final class BrowseParamsObject { @JsonKey(name: r'minWordSizefor2Typos') final int? minWordSizefor2Typos; + /// One of types: + /// - [TypoToleranceEnum] + /// - [bool] @JsonKey(name: r'typoTolerance') final dynamic typoTolerance; @@ -305,9 +331,15 @@ final class BrowseParamsObject { @JsonKey(name: r'disableTypoToleranceOnAttributes') final List? disableTypoToleranceOnAttributes; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'ignorePlurals') final dynamic ignorePlurals; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'removeStopWords') final dynamic removeStopWords; @@ -370,6 +402,9 @@ final class BrowseParamsObject { @JsonKey(name: r'explain') final List? explain; + /// One of types: + /// - [bool] + /// - [int] @JsonKey(name: r'distinct') final dynamic distinct; diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/built_in_operation_type.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/built_in_operation_type.dart index fe019624be..36fc39d33b 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/built_in_operation_type.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/built_in_operation_type.dart @@ -31,6 +31,13 @@ enum BuiltInOperationType { dynamic toJson() => raw; + static BuiltInOperationType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/consequence.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/consequence.dart index d57a3ecbd7..d45f4287b0 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/consequence.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/consequence.dart @@ -22,6 +22,9 @@ final class Consequence { final ConsequenceParams? params; /// Records to promote. + /// One of types: + /// - [PromoteObjectIDs] + /// - [PromoteObjectID] @JsonKey(name: r'promote') final Iterable? promote; diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/consequence_params.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/consequence_params.dart index abf1b796ae..897b2342ea 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/consequence_params.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/consequence_params.dart @@ -108,15 +108,31 @@ final class ConsequenceParams { @JsonKey(name: r'filters') final String? filters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'facetFilters') final dynamic facetFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'optionalFilters') final dynamic optionalFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'numericFilters') final dynamic numericFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'tagFilters') final dynamic tagFilters; @@ -162,6 +178,9 @@ final class ConsequenceParams { @JsonKey(name: r'aroundLatLngViaIP') final bool? aroundLatLngViaIP; + /// One of types: + /// - [AroundRadiusAll] + /// - [int] @JsonKey(name: r'aroundRadius') final dynamic aroundRadius; @@ -226,6 +245,10 @@ final class ConsequenceParams { @JsonKey(name: r'enableReRanking') final bool? enableReRanking; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'reRankingApplyFilter') final dynamic reRankingApplyFilter; @@ -291,6 +314,9 @@ final class ConsequenceParams { @JsonKey(name: r'minWordSizefor2Typos') final int? minWordSizefor2Typos; + /// One of types: + /// - [TypoToleranceEnum] + /// - [bool] @JsonKey(name: r'typoTolerance') final dynamic typoTolerance; @@ -302,9 +328,15 @@ final class ConsequenceParams { @JsonKey(name: r'disableTypoToleranceOnAttributes') final List? disableTypoToleranceOnAttributes; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'ignorePlurals') final dynamic ignorePlurals; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'removeStopWords') final dynamic removeStopWords; @@ -367,6 +399,9 @@ final class ConsequenceParams { @JsonKey(name: r'explain') final List? explain; + /// One of types: + /// - [bool] + /// - [int] @JsonKey(name: r'distinct') final dynamic distinct; @@ -404,12 +439,21 @@ final class ConsequenceParams { @JsonKey(name: r'renderingContent') final RenderingContent? renderingContent; + /// One of types: + /// - [ConsequenceQueryObject] + /// - [String] @JsonKey(name: r'query') final dynamic query; + /// One of types: + /// - [List] + /// - [List] @JsonKey(name: r'automaticFacetFilters') final dynamic automaticFacetFilters; + /// One of types: + /// - [List] + /// - [List] @JsonKey(name: r'automaticOptionalFacetFilters') final dynamic automaticOptionalFacetFilters; diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/delete_by_params.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/delete_by_params.dart index 2f40f081c8..9d2af14848 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/delete_by_params.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/delete_by_params.dart @@ -19,6 +19,10 @@ final class DeleteByParams { this.insidePolygon, }); + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'facetFilters') final dynamic facetFilters; @@ -26,9 +30,17 @@ final class DeleteByParams { @JsonKey(name: r'filters') final String? filters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'numericFilters') final dynamic numericFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'tagFilters') final dynamic tagFilters; @@ -36,6 +48,9 @@ final class DeleteByParams { @JsonKey(name: r'aroundLatLng') final String? aroundLatLng; + /// One of types: + /// - [AroundRadiusAll] + /// - [int] @JsonKey(name: r'aroundRadius') final dynamic aroundRadius; diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/dictionary_action.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/dictionary_action.dart index 48205d255d..ccf6e4b059 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/dictionary_action.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/dictionary_action.dart @@ -16,6 +16,13 @@ enum DictionaryAction { dynamic toJson() => raw; + static DictionaryAction fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/dictionary_entry_state.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/dictionary_entry_state.dart index fe148b15cb..20d1e7618e 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/dictionary_entry_state.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/dictionary_entry_state.dart @@ -16,6 +16,13 @@ enum DictionaryEntryState { dynamic toJson() => raw; + static DictionaryEntryState fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/dictionary_type.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/dictionary_type.dart index 3afa64f914..3deb1d164b 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/dictionary_type.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/dictionary_type.dart @@ -13,6 +13,13 @@ enum DictionaryType { dynamic toJson() => raw; + static DictionaryType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/edit_type.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/edit_type.dart index 61d665682e..c92cf5fe56 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/edit_type.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/edit_type.dart @@ -16,6 +16,13 @@ enum EditType { dynamic toJson() => raw; + static EditType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/exact_on_single_word_query.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/exact_on_single_word_query.dart index 83d1728e31..022f5acb46 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/exact_on_single_word_query.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/exact_on_single_word_query.dart @@ -19,6 +19,13 @@ enum ExactOnSingleWordQuery { dynamic toJson() => raw; + static ExactOnSingleWordQuery fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/index_settings.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/index_settings.dart index fb8a528253..4216dbdc9a 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/index_settings.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/index_settings.dart @@ -201,6 +201,9 @@ final class IndexSettings { @JsonKey(name: r'minWordSizefor2Typos') final int? minWordSizefor2Typos; + /// One of types: + /// - [TypoToleranceEnum] + /// - [bool] @JsonKey(name: r'typoTolerance') final dynamic typoTolerance; @@ -212,9 +215,15 @@ final class IndexSettings { @JsonKey(name: r'disableTypoToleranceOnAttributes') final List? disableTypoToleranceOnAttributes; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'ignorePlurals') final dynamic ignorePlurals; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'removeStopWords') final dynamic removeStopWords; @@ -277,6 +286,9 @@ final class IndexSettings { @JsonKey(name: r'explain') final List? explain; + /// One of types: + /// - [bool] + /// - [int] @JsonKey(name: r'distinct') final dynamic distinct; diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/index_settings_as_search_params.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/index_settings_as_search_params.dart index 053eb658f8..0edd5d9126 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/index_settings_as_search_params.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/index_settings_as_search_params.dart @@ -126,6 +126,9 @@ final class IndexSettingsAsSearchParams { @JsonKey(name: r'minWordSizefor2Typos') final int? minWordSizefor2Typos; + /// One of types: + /// - [TypoToleranceEnum] + /// - [bool] @JsonKey(name: r'typoTolerance') final dynamic typoTolerance; @@ -137,9 +140,15 @@ final class IndexSettingsAsSearchParams { @JsonKey(name: r'disableTypoToleranceOnAttributes') final List? disableTypoToleranceOnAttributes; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'ignorePlurals') final dynamic ignorePlurals; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'removeStopWords') final dynamic removeStopWords; @@ -202,6 +211,9 @@ final class IndexSettingsAsSearchParams { @JsonKey(name: r'explain') final List? explain; + /// One of types: + /// - [bool] + /// - [int] @JsonKey(name: r'distinct') final dynamic distinct; diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/log_type.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/log_type.dart index 0fe076e62a..849f2b6f29 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/log_type.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/log_type.dart @@ -14,6 +14,13 @@ enum LogType { dynamic toJson() => raw; + static LogType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/match_level.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/match_level.dart index d1deaa4808..efdd963b5f 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/match_level.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/match_level.dart @@ -19,6 +19,13 @@ enum MatchLevel { dynamic toJson() => raw; + static MatchLevel fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/mode.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/mode.dart index 0bfd425a4e..44ac83d064 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/mode.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/mode.dart @@ -16,6 +16,13 @@ enum Mode { dynamic toJson() => raw; + static Mode fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/operation_type.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/operation_type.dart index 08e9d8f2ef..4a89b450ad 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/operation_type.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/operation_type.dart @@ -16,6 +16,13 @@ enum OperationType { dynamic toJson() => raw; + static OperationType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/params.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/params.dart index adfaf3a394..c1a13ee643 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/params.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/params.dart @@ -16,12 +16,21 @@ final class Params { this.renderingContent, }); + /// One of types: + /// - [ConsequenceQueryObject] + /// - [String] @JsonKey(name: r'query') final dynamic query; + /// One of types: + /// - [List] + /// - [List] @JsonKey(name: r'automaticFacetFilters') final dynamic automaticFacetFilters; + /// One of types: + /// - [List] + /// - [List] @JsonKey(name: r'automaticOptionalFacetFilters') final dynamic automaticOptionalFacetFilters; diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/query_type.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/query_type.dart index 1145093609..ef7b47d661 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/query_type.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/query_type.dart @@ -19,6 +19,13 @@ enum QueryType { dynamic toJson() => raw; + static QueryType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/remove_words_if_no_results.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/remove_words_if_no_results.dart index 9915dbbb26..051a2fca14 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/remove_words_if_no_results.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/remove_words_if_no_results.dart @@ -22,6 +22,13 @@ enum RemoveWordsIfNoResults { dynamic toJson() => raw; + static RemoveWordsIfNoResults fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/scope_type.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/scope_type.dart index 2902e67096..4c9d9c58a3 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/scope_type.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/scope_type.dart @@ -13,6 +13,13 @@ enum ScopeType { dynamic toJson() => raw; + static ScopeType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_for_facets.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_for_facets.dart index c8684f3cd7..697f9551c0 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_for_facets.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_for_facets.dart @@ -120,15 +120,31 @@ final class SearchForFacets { @JsonKey(name: r'filters') final String? filters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'facetFilters') final dynamic facetFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'optionalFilters') final dynamic optionalFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'numericFilters') final dynamic numericFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'tagFilters') final dynamic tagFilters; @@ -174,6 +190,9 @@ final class SearchForFacets { @JsonKey(name: r'aroundLatLngViaIP') final bool? aroundLatLngViaIP; + /// One of types: + /// - [AroundRadiusAll] + /// - [int] @JsonKey(name: r'aroundRadius') final dynamic aroundRadius; @@ -238,6 +257,10 @@ final class SearchForFacets { @JsonKey(name: r'enableReRanking') final bool? enableReRanking; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'reRankingApplyFilter') final dynamic reRankingApplyFilter; @@ -303,6 +326,9 @@ final class SearchForFacets { @JsonKey(name: r'minWordSizefor2Typos') final int? minWordSizefor2Typos; + /// One of types: + /// - [TypoToleranceEnum] + /// - [bool] @JsonKey(name: r'typoTolerance') final dynamic typoTolerance; @@ -314,9 +340,15 @@ final class SearchForFacets { @JsonKey(name: r'disableTypoToleranceOnAttributes') final List? disableTypoToleranceOnAttributes; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'ignorePlurals') final dynamic ignorePlurals; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'removeStopWords') final dynamic removeStopWords; @@ -379,6 +411,9 @@ final class SearchForFacets { @JsonKey(name: r'explain') final List? explain; + /// One of types: + /// - [bool] + /// - [int] @JsonKey(name: r'distinct') final dynamic distinct; diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_for_hits.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_for_hits.dart index 46a3e853a3..4571a65fe8 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_for_hits.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_for_hits.dart @@ -118,15 +118,31 @@ final class SearchForHits { @JsonKey(name: r'filters') final String? filters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'facetFilters') final dynamic facetFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'optionalFilters') final dynamic optionalFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'numericFilters') final dynamic numericFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'tagFilters') final dynamic tagFilters; @@ -172,6 +188,9 @@ final class SearchForHits { @JsonKey(name: r'aroundLatLngViaIP') final bool? aroundLatLngViaIP; + /// One of types: + /// - [AroundRadiusAll] + /// - [int] @JsonKey(name: r'aroundRadius') final dynamic aroundRadius; @@ -236,6 +255,10 @@ final class SearchForHits { @JsonKey(name: r'enableReRanking') final bool? enableReRanking; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'reRankingApplyFilter') final dynamic reRankingApplyFilter; @@ -301,6 +324,9 @@ final class SearchForHits { @JsonKey(name: r'minWordSizefor2Typos') final int? minWordSizefor2Typos; + /// One of types: + /// - [TypoToleranceEnum] + /// - [bool] @JsonKey(name: r'typoTolerance') final dynamic typoTolerance; @@ -312,9 +338,15 @@ final class SearchForHits { @JsonKey(name: r'disableTypoToleranceOnAttributes') final List? disableTypoToleranceOnAttributes; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'ignorePlurals') final dynamic ignorePlurals; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'removeStopWords') final dynamic removeStopWords; @@ -377,6 +409,9 @@ final class SearchForHits { @JsonKey(name: r'explain') final List? explain; + /// One of types: + /// - [bool] + /// - [int] @JsonKey(name: r'distinct') final dynamic distinct; diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_method_params.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_method_params.dart index 4a69a774a8..7b39eb44d1 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_method_params.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_method_params.dart @@ -14,6 +14,9 @@ final class SearchMethodParams { this.strategy, }); + /// One of types: + /// - [SearchForHits] + /// - [SearchForFacets] @JsonKey(name: r'requests') final Iterable requests; diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_params_object.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_params_object.dart index 621dc659c0..c1c32e5957 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_params_object.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_params_object.dart @@ -110,15 +110,31 @@ final class SearchParamsObject { @JsonKey(name: r'filters') final String? filters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'facetFilters') final dynamic facetFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'optionalFilters') final dynamic optionalFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'numericFilters') final dynamic numericFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'tagFilters') final dynamic tagFilters; @@ -164,6 +180,9 @@ final class SearchParamsObject { @JsonKey(name: r'aroundLatLngViaIP') final bool? aroundLatLngViaIP; + /// One of types: + /// - [AroundRadiusAll] + /// - [int] @JsonKey(name: r'aroundRadius') final dynamic aroundRadius; @@ -228,6 +247,10 @@ final class SearchParamsObject { @JsonKey(name: r'enableReRanking') final bool? enableReRanking; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'reRankingApplyFilter') final dynamic reRankingApplyFilter; @@ -293,6 +316,9 @@ final class SearchParamsObject { @JsonKey(name: r'minWordSizefor2Typos') final int? minWordSizefor2Typos; + /// One of types: + /// - [TypoToleranceEnum] + /// - [bool] @JsonKey(name: r'typoTolerance') final dynamic typoTolerance; @@ -304,9 +330,15 @@ final class SearchParamsObject { @JsonKey(name: r'disableTypoToleranceOnAttributes') final List? disableTypoToleranceOnAttributes; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'ignorePlurals') final dynamic ignorePlurals; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'removeStopWords') final dynamic removeStopWords; @@ -369,6 +401,9 @@ final class SearchParamsObject { @JsonKey(name: r'explain') final List? explain; + /// One of types: + /// - [bool] + /// - [int] @JsonKey(name: r'distinct') final dynamic distinct; diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_responses.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_responses.dart index 12b5994e6c..9638e21e86 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_responses.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_responses.dart @@ -12,6 +12,9 @@ final class SearchResponses { required this.results, }); + /// One of types: + /// - [SearchForFacetValuesResponse] + /// - [SearchResponse] @JsonKey(name: r'results') final Iterable results; diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_strategy.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_strategy.dart index 50ad0fbbf1..6bafacdd93 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_strategy.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_strategy.dart @@ -16,6 +16,13 @@ enum SearchStrategy { dynamic toJson() => raw; + static SearchStrategy fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_type_default.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_type_default.dart index e74994edc3..a7eb383de5 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_type_default.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_type_default.dart @@ -13,6 +13,13 @@ enum SearchTypeDefault { dynamic toJson() => raw; + static SearchTypeDefault fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_type_facet.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_type_facet.dart index 0048e0d8f8..8407b4a17e 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_type_facet.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/search_type_facet.dart @@ -13,6 +13,13 @@ enum SearchTypeFacet { dynamic toJson() => raw; + static SearchTypeFacet fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/sort_remaining_by.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/sort_remaining_by.dart index 731ec8f1ca..6382bc44ee 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/sort_remaining_by.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/sort_remaining_by.dart @@ -19,6 +19,13 @@ enum SortRemainingBy { dynamic toJson() => raw; + static SortRemainingBy fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/synonym_type.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/synonym_type.dart index b34a5261ce..b66086f7f7 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/synonym_type.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/synonym_type.dart @@ -25,6 +25,13 @@ enum SynonymType { dynamic toJson() => raw; + static SynonymType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/task_status.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/task_status.dart index 1e4ad50425..606cb52ec3 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/task_status.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/task_status.dart @@ -16,6 +16,13 @@ enum TaskStatus { dynamic toJson() => raw; + static TaskStatus fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/typo_tolerance_enum.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/typo_tolerance_enum.dart index 712f24e662..b5ec1a7893 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/typo_tolerance_enum.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/typo_tolerance_enum.dart @@ -12,6 +12,13 @@ enum TypoToleranceEnum { dynamic toJson() => raw; + static TypoToleranceEnum fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/pubspec.yaml b/clients/algoliasearch-client-dart/packages/algoliasearch/pubspec.yaml index 5c97d43c40..6b7315e69b 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/pubspec.yaml +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/pubspec.yaml @@ -12,7 +12,7 @@ environment: dependencies: # Pinning versions until the API stabilizes. - algolia_client_core: 0.1.1+1 + algolia_client_core: 0.1.1+4 algolia_client_search: 0.1.2+2 algolia_client_insights: 0.1.2+1 json_annotation: ^4.8.1 diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/build.yaml b/clients/algoliasearch-client-dart/packages/client_abtesting/build.yaml new file mode 100644 index 0000000000..6d71b406a7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/build.yaml @@ -0,0 +1,14 @@ +targets: + $default: + builders: + json_serializable: + options: + any_map: false + checked: true + create_factory: true + create_to_json: true + disallow_unrecognized_keys: false + explicit_to_json: true + field_rename: none + ignore_unannotated: false + include_if_null: false diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/algolia_client_abtesting.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/algolia_client_abtesting.dart new file mode 100644 index 0000000000..2c8b524303 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/algolia_client_abtesting.dart @@ -0,0 +1,18 @@ +// A sub-package of the AlgoliaSearch library, offering abtesting-specific functionalities for enhanced search and discovery in Dart/Flutter apps. +library algolia_client_abtesting; + +export 'package:algolia_client_core/algolia_client_core.dart'; + +export 'src/api/abtesting_client.dart'; + +export 'src/model/ab_test.dart'; +export 'src/model/ab_test_response.dart'; +export 'src/model/ab_tests_variant.dart'; +export 'src/model/ab_tests_variant_search_params.dart'; +export 'src/model/add_ab_tests_request.dart'; +export 'src/model/custom_search_params.dart'; +export 'src/model/error_base.dart'; +export 'src/model/list_ab_tests_response.dart'; +export 'src/model/variant.dart'; + +export 'src/extension.dart'; diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/api/abtesting_client.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/api/abtesting_client.dart new file mode 100644 index 0000000000..d03ff72232 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/api/abtesting_client.dart @@ -0,0 +1,337 @@ +// 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. + +import 'package:algolia_client_core/algolia_client_core.dart'; +import 'package:algolia_client_abtesting/src/deserialize.dart'; +import 'package:algolia_client_abtesting/src/version.dart'; + +import 'package:algolia_client_abtesting/src/model/ab_test.dart'; +import 'package:algolia_client_abtesting/src/model/ab_test_response.dart'; +import 'package:algolia_client_abtesting/src/model/add_ab_tests_request.dart'; +import 'package:algolia_client_abtesting/src/model/list_ab_tests_response.dart'; + +final class AbtestingClient implements ApiClient { + @override + final String apiKey; + + @override + final String appId; + + @override + final ClientOptions options; + + final String? region; + + final RetryStrategy _retryStrategy; + + AbtestingClient({ + required this.appId, + required this.apiKey, + this.options = const ClientOptions(), + this.region, + }) : _retryStrategy = RetryStrategy.create( + segment: AgentSegment(value: "Abtesting", version: packageVersion), + appId: appId, + apiKey: apiKey, + options: options, + defaultHosts: () { + final allowedRegions = ['de', 'us']; + assert( + region == null || allowedRegions.contains(region), + '`region` must be one of the following: ${allowedRegions.join(', ')}', + ); + final url = region == null + ? 'analytics.algolia.com' + : 'analytics.{region}.algolia.com' + .replaceAll('{region}', region); + return [Host(url: url)]; + }) { + assert(appId.isNotEmpty, '`appId` is missing.'); + assert(apiKey.isNotEmpty, '`apiKey` is missing.'); + } + + /// Create an A/B test. + /// Creates an A/B test. + /// + /// Parameters: + /// * [addABTestsRequest] + /// * [requestOptions] additional request configuration. + Future addABTests({ + required AddABTestsRequest addABTestsRequest, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.post, + path: r'/2/abtests', + body: addABTestsRequest.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'ABTestResponse', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [requestOptions] additional request configuration. + Future del({ + required String path, + Map? parameters, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `del`.', + ); + final request = ApiRequest( + method: RequestMethod.delete, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Delete an A/B test. + /// Delete an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests). + /// + /// Parameters: + /// * [id] Unique A/B test ID. + /// * [requestOptions] additional request configuration. + Future deleteABTest({ + required int id, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.delete, + path: r'/2/abtests/{id}' + .replaceAll('{' r'id' '}', Uri.encodeComponent(id.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'ABTestResponse', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [requestOptions] additional request configuration. + Future get({ + required String path, + Map? parameters, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `get`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Get A/B test details. + /// Get specific details for an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests). + /// + /// Parameters: + /// * [id] Unique A/B test ID. + /// * [requestOptions] additional request configuration. + Future getABTest({ + required int id, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.get, + path: r'/2/abtests/{id}' + .replaceAll('{' r'id' '}', Uri.encodeComponent(id.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'ABTest', + growable: true, + ); + } + + /// List all A/B tests. + /// List all A/B tests. + /// + /// Parameters: + /// * [offset] Position of the starting record. Used for paging. 0 is the first record. + /// * [limit] Number of records to return (page size). + /// * [indexPrefix] Only return A/B tests for indices starting with this prefix. + /// * [indexSuffix] Only return A/B tests for indices ending with this suffix. + /// * [requestOptions] additional request configuration. + Future listABTests({ + int? offset, + int? limit, + String? indexPrefix, + String? indexSuffix, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.get, + path: r'/2/abtests', + queryParams: { + if (offset != null) 'offset': offset, + if (limit != null) 'limit': limit, + if (indexPrefix != null) 'indexPrefix': indexPrefix, + if (indexSuffix != null) 'indexSuffix': indexSuffix, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'ListABTestsResponse', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [body] Parameters to send with the custom request. + /// * [requestOptions] additional request configuration. + Future post({ + required String path, + Map? parameters, + Object? body, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `post`.', + ); + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + body: body, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [body] Parameters to send with the custom request. + /// * [requestOptions] additional request configuration. + Future put({ + required String path, + Map? parameters, + Object? body, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `put`.', + ); + final request = ApiRequest( + method: RequestMethod.put, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + body: body, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Stop an A/B test. + /// If stopped, the test is over and can't be restarted. There is now only one index, receiving 100% of all search requests. The data gathered for stopped A/B tests is retained. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests). + /// + /// Parameters: + /// * [id] Unique A/B test ID. + /// * [requestOptions] additional request configuration. + Future stopABTest({ + required int id, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.post, + path: r'/2/abtests/{id}/stop' + .replaceAll('{' r'id' '}', Uri.encodeComponent(id.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'ABTestResponse', + growable: true, + ); + } + + @override + void dispose() => _retryStrategy.dispose(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/deserialize.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/deserialize.dart new file mode 100644 index 0000000000..d7785639ab --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/deserialize.dart @@ -0,0 +1,88 @@ +import 'package:algolia_client_abtesting/src/model/ab_test.dart'; +import 'package:algolia_client_abtesting/src/model/ab_test_response.dart'; +import 'package:algolia_client_abtesting/src/model/ab_tests_variant.dart'; +import 'package:algolia_client_abtesting/src/model/ab_tests_variant_search_params.dart'; +import 'package:algolia_client_abtesting/src/model/add_ab_tests_request.dart'; +import 'package:algolia_client_abtesting/src/model/custom_search_params.dart'; +import 'package:algolia_client_abtesting/src/model/error_base.dart'; +import 'package:algolia_client_abtesting/src/model/list_ab_tests_response.dart'; +import 'package:algolia_client_abtesting/src/model/variant.dart'; + +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + +ReturnType deserialize(dynamic value, String targetType, + {bool growable = true}) { + switch (targetType) { + case 'String': + return '$value' as ReturnType; + case 'int': + return (value is int ? value : int.parse('$value')) as ReturnType; + case 'bool': + if (value is bool) { + return value as ReturnType; + } + final valueString = '$value'.toLowerCase(); + return (valueString == 'true' || valueString == '1') as ReturnType; + case 'double': + return (value is double ? value : double.parse('$value')) as ReturnType; + case 'ABTest': + return ABTest.fromJson(value as Map) as ReturnType; + case 'ABTestResponse': + return ABTestResponse.fromJson(value as Map) + as ReturnType; + case 'AbTestsVariant': + return AbTestsVariant.fromJson(value as Map) + as ReturnType; + case 'AbTestsVariantSearchParams': + return AbTestsVariantSearchParams.fromJson(value as Map) + as ReturnType; + case 'AddABTestsRequest': + return AddABTestsRequest.fromJson(value as Map) + as ReturnType; + case 'CustomSearchParams': + return CustomSearchParams.fromJson(value as Map) + as ReturnType; + case 'ErrorBase': + return ErrorBase.fromJson(value as Map) as ReturnType; + case 'ListABTestsResponse': + return ListABTestsResponse.fromJson(value as Map) + as ReturnType; + case 'Variant': + return Variant.fromJson(value as Map) as ReturnType; + default: + RegExpMatch? match; + + if (value is List && (match = _regList.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toList(growable: growable) as ReturnType; + } + if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toSet() as ReturnType; + } + if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return Map.fromIterables( + value.keys, + value.values.map((dynamic v) => deserialize( + v, targetType, + growable: growable)), + ) as ReturnType; + } + if (targetType == 'Object') { + return value; + } + break; + } + throw Exception('Cannot deserialize'); +} diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_test.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_test.dart new file mode 100644 index 0000000000..629a940ff5 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_test.dart @@ -0,0 +1,87 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_abtesting/src/model/variant.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'ab_test.g.dart'; + +@JsonSerializable() +final class ABTest { + /// Returns a new [ABTest] instance. + const ABTest({ + required this.abTestID, + required this.clickSignificance, + required this.conversionSignificance, + required this.updatedAt, + required this.createdAt, + required this.name, + required this.status, + required this.variants, + }); + + /// Unique A/B test ID. + @JsonKey(name: r'abTestID') + final int abTestID; + + /// [A/B test significance](https://www.algolia.com/doc/guides/ab-testing/what-is-ab-testing/in-depth/how-ab-test-scores-are-calculated/#statistical-significance-or-chance) based on click data. A value of 0.95 or over is considered to be _significant_. + @JsonKey(name: r'clickSignificance') + final double clickSignificance; + + /// End date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format. + @JsonKey(name: r'conversionSignificance') + final String conversionSignificance; + + /// Update date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format. + @JsonKey(name: r'updatedAt') + final String updatedAt; + + /// Creation date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format. + @JsonKey(name: r'createdAt') + final String createdAt; + + /// A/B test name. + @JsonKey(name: r'name') + final String name; + + /// A/B test status. + @JsonKey(name: r'status') + final String status; + + /// A/B test variants. + @JsonKey(name: r'variants') + final List variants; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ABTest && + other.abTestID == abTestID && + other.clickSignificance == clickSignificance && + other.conversionSignificance == conversionSignificance && + other.updatedAt == updatedAt && + other.createdAt == createdAt && + other.name == name && + other.status == status && + other.variants == variants; + + @override + int get hashCode => + abTestID.hashCode + + clickSignificance.hashCode + + conversionSignificance.hashCode + + updatedAt.hashCode + + createdAt.hashCode + + name.hashCode + + status.hashCode + + variants.hashCode; + + factory ABTest.fromJson(Map json) => _$ABTestFromJson(json); + + Map toJson() => _$ABTestToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_test.g.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_test.g.dart new file mode 100644 index 0000000000..01d72fd300 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_test.g.dart @@ -0,0 +1,42 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'ab_test.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ABTest _$ABTestFromJson(Map json) => $checkedCreate( + 'ABTest', + json, + ($checkedConvert) { + final val = ABTest( + abTestID: $checkedConvert('abTestID', (v) => v as int), + clickSignificance: $checkedConvert( + 'clickSignificance', (v) => (v as num).toDouble()), + conversionSignificance: + $checkedConvert('conversionSignificance', (v) => v as String), + updatedAt: $checkedConvert('updatedAt', (v) => v as String), + createdAt: $checkedConvert('createdAt', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + status: $checkedConvert('status', (v) => v as String), + variants: $checkedConvert( + 'variants', + (v) => (v as List) + .map((e) => Variant.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$ABTestToJson(ABTest instance) => { + 'abTestID': instance.abTestID, + 'clickSignificance': instance.clickSignificance, + 'conversionSignificance': instance.conversionSignificance, + 'updatedAt': instance.updatedAt, + 'createdAt': instance.createdAt, + 'name': instance.name, + 'status': instance.status, + 'variants': instance.variants.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_test_response.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_test_response.dart new file mode 100644 index 0000000000..277418a96f --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_test_response.dart @@ -0,0 +1,49 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'ab_test_response.g.dart'; + +@JsonSerializable() +final class ABTestResponse { + /// Returns a new [ABTestResponse] instance. + const ABTestResponse({ + required this.index, + required this.abTestID, + required this.taskID, + }); + + /// A/B test index. + @JsonKey(name: r'index') + final String index; + + /// Unique A/B test ID. + @JsonKey(name: r'abTestID') + final int abTestID; + + /// Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run immediately. You can check the task's progress with the `task` operation and this `taskID`. + @JsonKey(name: r'taskID') + final int taskID; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ABTestResponse && + other.index == index && + other.abTestID == abTestID && + other.taskID == taskID; + + @override + int get hashCode => index.hashCode + abTestID.hashCode + taskID.hashCode; + + factory ABTestResponse.fromJson(Map json) => + _$ABTestResponseFromJson(json); + + Map toJson() => _$ABTestResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_test_response.g.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_test_response.g.dart new file mode 100644 index 0000000000..33518d7f07 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_test_response.g.dart @@ -0,0 +1,28 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'ab_test_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ABTestResponse _$ABTestResponseFromJson(Map json) => + $checkedCreate( + 'ABTestResponse', + json, + ($checkedConvert) { + final val = ABTestResponse( + index: $checkedConvert('index', (v) => v as String), + abTestID: $checkedConvert('abTestID', (v) => v as int), + taskID: $checkedConvert('taskID', (v) => v as int), + ); + return val; + }, + ); + +Map _$ABTestResponseToJson(ABTestResponse instance) => + { + 'index': instance.index, + 'abTestID': instance.abTestID, + 'taskID': instance.taskID, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_tests_variant.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_tests_variant.dart new file mode 100644 index 0000000000..aec4c2aafd --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_tests_variant.dart @@ -0,0 +1,50 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'ab_tests_variant.g.dart'; + +@JsonSerializable() +final class AbTestsVariant { + /// Returns a new [AbTestsVariant] instance. + const AbTestsVariant({ + required this.index, + required this.trafficPercentage, + this.description, + }); + + /// A/B test index. + @JsonKey(name: r'index') + final String index; + + /// A/B test traffic percentage. + @JsonKey(name: r'trafficPercentage') + final int trafficPercentage; + + /// A/B test description. + @JsonKey(name: r'description') + final String? description; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AbTestsVariant && + other.index == index && + other.trafficPercentage == trafficPercentage && + other.description == description; + + @override + int get hashCode => + index.hashCode + trafficPercentage.hashCode + description.hashCode; + + factory AbTestsVariant.fromJson(Map json) => + _$AbTestsVariantFromJson(json); + + Map toJson() => _$AbTestsVariantToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_tests_variant.g.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_tests_variant.g.dart new file mode 100644 index 0000000000..2f5d5a7059 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_tests_variant.g.dart @@ -0,0 +1,38 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'ab_tests_variant.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AbTestsVariant _$AbTestsVariantFromJson(Map json) => + $checkedCreate( + 'AbTestsVariant', + json, + ($checkedConvert) { + final val = AbTestsVariant( + index: $checkedConvert('index', (v) => v as String), + trafficPercentage: + $checkedConvert('trafficPercentage', (v) => v as int), + description: $checkedConvert('description', (v) => v as String?), + ); + return val; + }, + ); + +Map _$AbTestsVariantToJson(AbTestsVariant instance) { + final val = { + 'index': instance.index, + 'trafficPercentage': instance.trafficPercentage, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('description', instance.description); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_tests_variant_search_params.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_tests_variant_search_params.dart new file mode 100644 index 0000000000..184d9cf0d5 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_tests_variant_search_params.dart @@ -0,0 +1,58 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'ab_tests_variant_search_params.g.dart'; + +@JsonSerializable() +final class AbTestsVariantSearchParams { + /// Returns a new [AbTestsVariantSearchParams] instance. + const AbTestsVariantSearchParams({ + required this.index, + required this.trafficPercentage, + this.description, + required this.customSearchParameters, + }); + + /// A/B test index. + @JsonKey(name: r'index') + final String index; + + /// A/B test traffic percentage. + @JsonKey(name: r'trafficPercentage') + final int trafficPercentage; + + /// A/B test description. + @JsonKey(name: r'description') + final String? description; + + @JsonKey(name: r'customSearchParameters') + final Object customSearchParameters; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AbTestsVariantSearchParams && + other.index == index && + other.trafficPercentage == trafficPercentage && + other.description == description && + other.customSearchParameters == customSearchParameters; + + @override + int get hashCode => + index.hashCode + + trafficPercentage.hashCode + + description.hashCode + + customSearchParameters.hashCode; + + factory AbTestsVariantSearchParams.fromJson(Map json) => + _$AbTestsVariantSearchParamsFromJson(json); + + Map toJson() => _$AbTestsVariantSearchParamsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_tests_variant_search_params.g.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_tests_variant_search_params.g.dart new file mode 100644 index 0000000000..fb2c5e0e7d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/ab_tests_variant_search_params.g.dart @@ -0,0 +1,43 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'ab_tests_variant_search_params.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AbTestsVariantSearchParams _$AbTestsVariantSearchParamsFromJson( + Map json) => + $checkedCreate( + 'AbTestsVariantSearchParams', + json, + ($checkedConvert) { + final val = AbTestsVariantSearchParams( + index: $checkedConvert('index', (v) => v as String), + trafficPercentage: + $checkedConvert('trafficPercentage', (v) => v as int), + description: $checkedConvert('description', (v) => v as String?), + customSearchParameters: + $checkedConvert('customSearchParameters', (v) => v as Object), + ); + return val; + }, + ); + +Map _$AbTestsVariantSearchParamsToJson( + AbTestsVariantSearchParams instance) { + final val = { + 'index': instance.index, + 'trafficPercentage': instance.trafficPercentage, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('description', instance.description); + val['customSearchParameters'] = instance.customSearchParameters; + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/add_ab_tests_request.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/add_ab_tests_request.dart new file mode 100644 index 0000000000..f471028c9d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/add_ab_tests_request.dart @@ -0,0 +1,52 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'add_ab_tests_request.g.dart'; + +@JsonSerializable() +final class AddABTestsRequest { + /// Returns a new [AddABTestsRequest] instance. + const AddABTestsRequest({ + required this.name, + required this.variants, + required this.endAt, + }); + + /// A/B test name. + @JsonKey(name: r'name') + final String name; + + /// A/B test variants. + /// One of types: + /// - [AbTestsVariantSearchParams] + /// - [AbTestsVariant] + @JsonKey(name: r'variants') + final Iterable variants; + + /// End date timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format. + @JsonKey(name: r'endAt') + final String endAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AddABTestsRequest && + other.name == name && + other.variants == variants && + other.endAt == endAt; + + @override + int get hashCode => name.hashCode + variants.hashCode + endAt.hashCode; + + factory AddABTestsRequest.fromJson(Map json) => + _$AddABTestsRequestFromJson(json); + + Map toJson() => _$AddABTestsRequestToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/add_ab_tests_request.g.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/add_ab_tests_request.g.dart new file mode 100644 index 0000000000..69e2275f00 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/add_ab_tests_request.g.dart @@ -0,0 +1,28 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'add_ab_tests_request.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AddABTestsRequest _$AddABTestsRequestFromJson(Map json) => + $checkedCreate( + 'AddABTestsRequest', + json, + ($checkedConvert) { + final val = AddABTestsRequest( + name: $checkedConvert('name', (v) => v as String), + variants: $checkedConvert('variants', (v) => v as List), + endAt: $checkedConvert('endAt', (v) => v as String), + ); + return val; + }, + ); + +Map _$AddABTestsRequestToJson(AddABTestsRequest instance) => + { + 'name': instance.name, + 'variants': instance.variants.toList(), + 'endAt': instance.endAt, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/custom_search_params.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/custom_search_params.dart new file mode 100644 index 0000000000..406cb9fb49 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/custom_search_params.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'custom_search_params.g.dart'; + +@JsonSerializable() +final class CustomSearchParams { + /// Returns a new [CustomSearchParams] instance. + const CustomSearchParams({ + required this.customSearchParameters, + }); + + @JsonKey(name: r'customSearchParameters') + final Object customSearchParameters; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is CustomSearchParams && + other.customSearchParameters == customSearchParameters; + + @override + int get hashCode => customSearchParameters.hashCode; + + factory CustomSearchParams.fromJson(Map json) => + _$CustomSearchParamsFromJson(json); + + Map toJson() => _$CustomSearchParamsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/custom_search_params.g.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/custom_search_params.g.dart new file mode 100644 index 0000000000..22bd053ec2 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/custom_search_params.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'custom_search_params.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +CustomSearchParams _$CustomSearchParamsFromJson(Map json) => + $checkedCreate( + 'CustomSearchParams', + json, + ($checkedConvert) { + final val = CustomSearchParams( + customSearchParameters: + $checkedConvert('customSearchParameters', (v) => v as Object), + ); + return val; + }, + ); + +Map _$CustomSearchParamsToJson(CustomSearchParams instance) => + { + 'customSearchParameters': instance.customSearchParameters, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/error_base.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/error_base.dart new file mode 100644 index 0000000000..df5d4ade57 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/error_base.dart @@ -0,0 +1,47 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:collection/collection.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'error_base.g.dart'; + +@JsonSerializable(createFieldMap: true) +final class ErrorBase extends DelegatingMap { + /// Returns a new [ErrorBase] instance. + const ErrorBase({ + this.message, + Map additionalProperties = const {}, + }) : super(additionalProperties); + + @JsonKey(name: r'message') + final String? message; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ErrorBase && + other.message == message && + const MapEquality().equals(this, this); + + @override + int get hashCode => + message.hashCode + const MapEquality().hash(this); + + factory ErrorBase.fromJson(Map json) { + final instance = _$ErrorBaseFromJson(json); + final additionalProperties = Map.from(json) + ..removeWhere((key, value) => _$ErrorBaseFieldMap.containsKey(key)); + return ErrorBase( + message: instance.message, + additionalProperties: additionalProperties, + ); + } + + Map toJson() => _$ErrorBaseToJson(this)..addAll(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/error_base.g.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/error_base.g.dart new file mode 100644 index 0000000000..f796166fb2 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/error_base.g.dart @@ -0,0 +1,35 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'error_base.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ErrorBase _$ErrorBaseFromJson(Map json) => $checkedCreate( + 'ErrorBase', + json, + ($checkedConvert) { + final val = ErrorBase( + message: $checkedConvert('message', (v) => v as String?), + ); + return val; + }, + ); + +const _$ErrorBaseFieldMap = { + 'message': 'message', +}; + +Map _$ErrorBaseToJson(ErrorBase instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('message', instance.message); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/list_ab_tests_response.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/list_ab_tests_response.dart new file mode 100644 index 0000000000..c04838a1cf --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/list_ab_tests_response.dart @@ -0,0 +1,50 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_abtesting/src/model/ab_test.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'list_ab_tests_response.g.dart'; + +@JsonSerializable() +final class ListABTestsResponse { + /// Returns a new [ListABTestsResponse] instance. + const ListABTestsResponse({ + required this.abtests, + required this.count, + required this.total, + }); + + /// A/B tests. + @JsonKey(name: r'abtests') + final List abtests; + + /// Number of A/B tests implemented. + @JsonKey(name: r'count') + final int count; + + /// Number of retrievable A/B tests. + @JsonKey(name: r'total') + final int total; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ListABTestsResponse && + other.abtests == abtests && + other.count == count && + other.total == total; + + @override + int get hashCode => abtests.hashCode + count.hashCode + total.hashCode; + + factory ListABTestsResponse.fromJson(Map json) => + _$ListABTestsResponseFromJson(json); + + Map toJson() => _$ListABTestsResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/list_ab_tests_response.g.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/list_ab_tests_response.g.dart new file mode 100644 index 0000000000..76a1b562d7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/list_ab_tests_response.g.dart @@ -0,0 +1,33 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'list_ab_tests_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ListABTestsResponse _$ListABTestsResponseFromJson(Map json) => + $checkedCreate( + 'ListABTestsResponse', + json, + ($checkedConvert) { + final val = ListABTestsResponse( + abtests: $checkedConvert( + 'abtests', + (v) => (v as List) + .map((e) => ABTest.fromJson(e as Map)) + .toList()), + count: $checkedConvert('count', (v) => v as int), + total: $checkedConvert('total', (v) => v as int), + ); + return val; + }, + ); + +Map _$ListABTestsResponseToJson( + ListABTestsResponse instance) => + { + 'abtests': instance.abtests.map((e) => e.toJson()).toList(), + 'count': instance.count, + 'total': instance.total, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/variant.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/variant.dart new file mode 100644 index 0000000000..55833c493c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/variant.dart @@ -0,0 +1,129 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'variant.g.dart'; + +@JsonSerializable() +final class Variant { + /// Returns a new [Variant] instance. + const Variant({ + required this.averageClickPosition, + required this.clickCount, + required this.clickThroughRate, + required this.conversionCount, + required this.conversionRate, + required this.description, + required this.index, + required this.noResultCount, + required this.outlierTrackedSearchesCount, + required this.outlierUsersCount, + required this.searchCount, + required this.trackedSearchCount, + required this.trafficPercentage, + required this.userCount, + }); + + /// Variant's [average click position](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-position). + @JsonKey(name: r'averageClickPosition') + final int averageClickPosition; + + /// Number of click events for this variant. + @JsonKey(name: r'clickCount') + final int clickCount; + + /// Variant's [click-through rate](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate). + @JsonKey(name: r'clickThroughRate') + final double clickThroughRate; + + /// Number of click events for this variant. + @JsonKey(name: r'conversionCount') + final int conversionCount; + + /// Variant's [conversion rate](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#conversion-rate). + @JsonKey(name: r'conversionRate') + final double conversionRate; + + /// A/B test description. + @JsonKey(name: r'description') + final String description; + + /// A/B test index. + @JsonKey(name: r'index') + final String index; + + /// Number of [searches without results](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#searches-without-results) for that variant. + @JsonKey(name: r'noResultCount') + final int noResultCount; + + /// Number of tracked searches attributed to [outlier traffic](https://www.algolia.com/doc/guides/ab-testing/how-to-read-your-a-b-test-results/#is-the-split-off) that were removed from the A/B test. A _tracked_ search is a search request where the `clickAnalytics` parameter is `true`. + @JsonKey(name: r'outlierTrackedSearchesCount') + final int outlierTrackedSearchesCount; + + /// Number of users attributed to [outlier traffic](https://www.algolia.com/doc/guides/ab-testing/how-to-read-your-a-b-test-results/#is-the-split-off) that were removed from the A/B test. + @JsonKey(name: r'outlierUsersCount') + final int outlierUsersCount; + + /// Number of searches carried out during the A/B test. + @JsonKey(name: r'searchCount') + final int searchCount; + + /// Number of tracked searches. This is the number of search requests where the `clickAnalytics` parameter is `true`. + @JsonKey(name: r'trackedSearchCount') + final int trackedSearchCount; + + /// A/B test traffic percentage. + @JsonKey(name: r'trafficPercentage') + final int trafficPercentage; + + /// Number of users during the A/B test. + @JsonKey(name: r'userCount') + final int userCount; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Variant && + other.averageClickPosition == averageClickPosition && + other.clickCount == clickCount && + other.clickThroughRate == clickThroughRate && + other.conversionCount == conversionCount && + other.conversionRate == conversionRate && + other.description == description && + other.index == index && + other.noResultCount == noResultCount && + other.outlierTrackedSearchesCount == outlierTrackedSearchesCount && + other.outlierUsersCount == outlierUsersCount && + other.searchCount == searchCount && + other.trackedSearchCount == trackedSearchCount && + other.trafficPercentage == trafficPercentage && + other.userCount == userCount; + + @override + int get hashCode => + averageClickPosition.hashCode + + clickCount.hashCode + + clickThroughRate.hashCode + + conversionCount.hashCode + + conversionRate.hashCode + + description.hashCode + + index.hashCode + + noResultCount.hashCode + + outlierTrackedSearchesCount.hashCode + + outlierUsersCount.hashCode + + searchCount.hashCode + + trackedSearchCount.hashCode + + trafficPercentage.hashCode + + userCount.hashCode; + + factory Variant.fromJson(Map json) => + _$VariantFromJson(json); + + Map toJson() => _$VariantToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/variant.g.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/variant.g.dart new file mode 100644 index 0000000000..a00967455c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/model/variant.g.dart @@ -0,0 +1,55 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'variant.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Variant _$VariantFromJson(Map json) => $checkedCreate( + 'Variant', + json, + ($checkedConvert) { + final val = Variant( + averageClickPosition: + $checkedConvert('averageClickPosition', (v) => v as int), + clickCount: $checkedConvert('clickCount', (v) => v as int), + clickThroughRate: + $checkedConvert('clickThroughRate', (v) => (v as num).toDouble()), + conversionCount: $checkedConvert('conversionCount', (v) => v as int), + conversionRate: + $checkedConvert('conversionRate', (v) => (v as num).toDouble()), + description: $checkedConvert('description', (v) => v as String), + index: $checkedConvert('index', (v) => v as String), + noResultCount: $checkedConvert('noResultCount', (v) => v as int), + outlierTrackedSearchesCount: + $checkedConvert('outlierTrackedSearchesCount', (v) => v as int), + outlierUsersCount: + $checkedConvert('outlierUsersCount', (v) => v as int), + searchCount: $checkedConvert('searchCount', (v) => v as int), + trackedSearchCount: + $checkedConvert('trackedSearchCount', (v) => v as int), + trafficPercentage: + $checkedConvert('trafficPercentage', (v) => v as int), + userCount: $checkedConvert('userCount', (v) => v as int), + ); + return val; + }, + ); + +Map _$VariantToJson(Variant instance) => { + 'averageClickPosition': instance.averageClickPosition, + 'clickCount': instance.clickCount, + 'clickThroughRate': instance.clickThroughRate, + 'conversionCount': instance.conversionCount, + 'conversionRate': instance.conversionRate, + 'description': instance.description, + 'index': instance.index, + 'noResultCount': instance.noResultCount, + 'outlierTrackedSearchesCount': instance.outlierTrackedSearchesCount, + 'outlierUsersCount': instance.outlierUsersCount, + 'searchCount': instance.searchCount, + 'trackedSearchCount': instance.trackedSearchCount, + 'trafficPercentage': instance.trafficPercentage, + 'userCount': instance.userCount, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/version.dart b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/version.dart new file mode 100644 index 0000000000..03e065a0a8 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/lib/src/version.dart @@ -0,0 +1,2 @@ +/// Current package version +const packageVersion = '0.1.2'; diff --git a/clients/algoliasearch-client-dart/packages/client_abtesting/pubspec.yaml b/clients/algoliasearch-client-dart/packages/client_abtesting/pubspec.yaml new file mode 100644 index 0000000000..1bec967755 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_abtesting/pubspec.yaml @@ -0,0 +1,24 @@ +name: algolia_client_abtesting +version: 0.1.2 +description: A sub-package of the AlgoliaSearch library, offering abtesting-specific functionalities for enhanced search and discovery in Dart/Flutter apps. +homepage: https://www.algolia.com/doc/ +repository: https://github.com/algolia/algoliasearch-client-dart/tree/main/packages/client_abtesting +topics: + - search + - discovery + +environment: + sdk: '>=3.0.0 <4.0.0' + +dependencies: + # Pinning versions until the API stabilizes. + algolia_client_core: 0.1.1+4 + json_annotation: ^4.8.1 + collection: ^1.17.1 + +dev_dependencies: + build_runner: ^2.4.4 + json_serializable: ^6.7.0 + lints: ^2.1.1 + logging: ^1.2.0 + test: ^1.24.3 diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/build.yaml b/clients/algoliasearch-client-dart/packages/client_analytics/build.yaml new file mode 100644 index 0000000000..6d71b406a7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/build.yaml @@ -0,0 +1,14 @@ +targets: + $default: + builders: + json_serializable: + options: + any_map: false + checked: true + create_factory: true + create_to_json: true + disallow_unrecognized_keys: false + explicit_to_json: true + field_rename: none + ignore_unannotated: false + include_if_null: false diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/algolia_client_analytics.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/algolia_client_analytics.dart new file mode 100644 index 0000000000..84d44a03e1 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/algolia_client_analytics.dart @@ -0,0 +1,50 @@ +// A sub-package of the AlgoliaSearch library, offering analytics-specific functionalities for enhanced search and discovery in Dart/Flutter apps. +library algolia_client_analytics; + +export 'package:algolia_client_core/algolia_client_core.dart'; + +export 'src/api/analytics_client.dart'; + +export 'src/model/average_click_event.dart'; +export 'src/model/click_position.dart'; +export 'src/model/click_through_rate_event.dart'; +export 'src/model/conversion_rate_event.dart'; +export 'src/model/direction.dart'; +export 'src/model/error_base.dart'; +export 'src/model/get_average_click_position_response.dart'; +export 'src/model/get_click_positions_response.dart'; +export 'src/model/get_click_through_rate_response.dart'; +export 'src/model/get_conversation_rate_response.dart'; +export 'src/model/get_no_click_rate_response.dart'; +export 'src/model/get_no_results_rate_response.dart'; +export 'src/model/get_searches_count_response.dart'; +export 'src/model/get_searches_no_clicks_response.dart'; +export 'src/model/get_searches_no_results_response.dart'; +export 'src/model/get_status_response.dart'; +export 'src/model/get_top_countries_response.dart'; +export 'src/model/get_top_filter_attribute.dart'; +export 'src/model/get_top_filter_attributes_response.dart'; +export 'src/model/get_top_filter_for_attribute.dart'; +export 'src/model/get_top_filter_for_attribute_response.dart'; +export 'src/model/get_top_filters_no_results_response.dart'; +export 'src/model/get_top_filters_no_results_value.dart'; +export 'src/model/get_top_filters_no_results_values.dart'; +export 'src/model/get_users_count_response.dart'; +export 'src/model/no_click_rate_event.dart'; +export 'src/model/no_results_rate_event.dart'; +export 'src/model/order_by.dart'; +export 'src/model/search_event.dart'; +export 'src/model/search_no_click_event.dart'; +export 'src/model/search_no_result_event.dart'; +export 'src/model/top_country.dart'; +export 'src/model/top_hit.dart'; +export 'src/model/top_hit_with_analytics.dart'; +export 'src/model/top_hits_response.dart'; +export 'src/model/top_hits_response_with_analytics.dart'; +export 'src/model/top_search.dart'; +export 'src/model/top_search_with_analytics.dart'; +export 'src/model/top_searches_response.dart'; +export 'src/model/top_searches_response_with_analytics.dart'; +export 'src/model/user_with_date.dart'; + +export 'src/extension.dart'; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/api/analytics_client.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/api/analytics_client.dart new file mode 100644 index 0000000000..7b8604a28d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/api/analytics_client.dart @@ -0,0 +1,988 @@ +// 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. + +import 'package:algolia_client_core/algolia_client_core.dart'; +import 'package:algolia_client_analytics/src/deserialize.dart'; +import 'package:algolia_client_analytics/src/version.dart'; + +import 'package:algolia_client_analytics/src/model/direction.dart'; +import 'package:algolia_client_analytics/src/model/get_average_click_position_response.dart'; +import 'package:algolia_client_analytics/src/model/get_click_positions_response.dart'; +import 'package:algolia_client_analytics/src/model/get_click_through_rate_response.dart'; +import 'package:algolia_client_analytics/src/model/get_conversation_rate_response.dart'; +import 'package:algolia_client_analytics/src/model/get_no_click_rate_response.dart'; +import 'package:algolia_client_analytics/src/model/get_no_results_rate_response.dart'; +import 'package:algolia_client_analytics/src/model/get_searches_count_response.dart'; +import 'package:algolia_client_analytics/src/model/get_searches_no_clicks_response.dart'; +import 'package:algolia_client_analytics/src/model/get_searches_no_results_response.dart'; +import 'package:algolia_client_analytics/src/model/get_status_response.dart'; +import 'package:algolia_client_analytics/src/model/get_top_countries_response.dart'; +import 'package:algolia_client_analytics/src/model/get_top_filter_attributes_response.dart'; +import 'package:algolia_client_analytics/src/model/get_top_filter_for_attribute_response.dart'; +import 'package:algolia_client_analytics/src/model/get_top_filters_no_results_response.dart'; +import 'package:algolia_client_analytics/src/model/get_users_count_response.dart'; +import 'package:algolia_client_analytics/src/model/order_by.dart'; + +final class AnalyticsClient implements ApiClient { + @override + final String apiKey; + + @override + final String appId; + + @override + final ClientOptions options; + + final String? region; + + final RetryStrategy _retryStrategy; + + AnalyticsClient({ + required this.appId, + required this.apiKey, + this.options = const ClientOptions(), + this.region, + }) : _retryStrategy = RetryStrategy.create( + segment: AgentSegment(value: "Analytics", version: packageVersion), + appId: appId, + apiKey: apiKey, + options: options, + defaultHosts: () { + final allowedRegions = ['de', 'us']; + assert( + region == null || allowedRegions.contains(region), + '`region` must be one of the following: ${allowedRegions.join(', ')}', + ); + final url = region == null + ? 'analytics.algolia.com' + : 'analytics.{region}.algolia.com' + .replaceAll('{region}', region); + return [Host(url: url)]; + }) { + assert(appId.isNotEmpty, '`appId` is missing.'); + assert(apiKey.isNotEmpty, '`apiKey` is missing.'); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [requestOptions] additional request configuration. + Future del({ + required String path, + Map? parameters, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `del`.', + ); + final request = ApiRequest( + method: RequestMethod.delete, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [requestOptions] additional request configuration. + Future get({ + required String path, + Map? parameters, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `get`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Get average click position. + /// Return the average click position for the complete time range and for individual days. > **Note**: If all `positions` have a `clickCount` of `0` or `null`, it means Algolia didn't receive any click events for tracked searches. A _tracked_ search is a search request where the `clickAnalytics` parameter is `true`. + /// + /// Parameters: + /// * [index] Index name to target. + /// * [startDate] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [endDate] End date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [tags] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded. + /// * [requestOptions] additional request configuration. + Future getAverageClickPosition({ + required String index, + String? startDate, + String? endDate, + String? tags, + RequestOptions? requestOptions, + }) async { + assert( + index.isNotEmpty, + 'Parameter `index` is required when calling `getAverageClickPosition`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/2/clicks/averageClickPosition', + queryParams: { + 'index': index, + if (startDate != null) 'startDate': startDate, + if (endDate != null) 'endDate': endDate, + if (tags != null) 'tags': tags, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetAverageClickPositionResponse', + growable: true, + ); + } + + /// Get click positions. + /// Show the number of clicks events and their associated position in the search results. > **Note**: If all `positions` have a `clickCount` of `0` or `null`, it means Algolia didn't receive any click events for tracked searches. A _tracked_ search is a search request where the `clickAnalytics` parameter is `true`. + /// + /// Parameters: + /// * [index] Index name to target. + /// * [startDate] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [endDate] End date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [tags] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded. + /// * [requestOptions] additional request configuration. + Future getClickPositions({ + required String index, + String? startDate, + String? endDate, + String? tags, + RequestOptions? requestOptions, + }) async { + assert( + index.isNotEmpty, + 'Parameter `index` is required when calling `getClickPositions`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/2/clicks/positions', + queryParams: { + 'index': index, + if (startDate != null) 'startDate': startDate, + if (endDate != null) 'endDate': endDate, + if (tags != null) 'tags': tags, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetClickPositionsResponse', + growable: true, + ); + } + + /// Get click-through rate (CTR). + /// Returns a [click-through rate (CTR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate). + /// + /// Parameters: + /// * [index] Index name to target. + /// * [startDate] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [endDate] End date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [tags] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded. + /// * [requestOptions] additional request configuration. + Future getClickThroughRate({ + required String index, + String? startDate, + String? endDate, + String? tags, + RequestOptions? requestOptions, + }) async { + assert( + index.isNotEmpty, + 'Parameter `index` is required when calling `getClickThroughRate`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/2/clicks/clickThroughRate', + queryParams: { + 'index': index, + if (startDate != null) 'startDate': startDate, + if (endDate != null) 'endDate': endDate, + if (tags != null) 'tags': tags, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetClickThroughRateResponse', + growable: true, + ); + } + + /// Get conversion rate (CR). + /// Return a [conversion rate](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#conversion-rate). + /// + /// Parameters: + /// * [index] Index name to target. + /// * [startDate] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [endDate] End date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [tags] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded. + /// * [requestOptions] additional request configuration. + Future getConversationRate({ + required String index, + String? startDate, + String? endDate, + String? tags, + RequestOptions? requestOptions, + }) async { + assert( + index.isNotEmpty, + 'Parameter `index` is required when calling `getConversationRate`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/2/conversions/conversionRate', + queryParams: { + 'index': index, + if (startDate != null) 'startDate': startDate, + if (endDate != null) 'endDate': endDate, + if (tags != null) 'tags': tags, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetConversationRateResponse', + growable: true, + ); + } + + /// Get no click rate. + /// Returns the rate at which searches don't lead to any clicks. The endpoint returns a value for the complete given time range, as well as a value per day. It also returns the count of searches and searches without clicks. + /// + /// Parameters: + /// * [index] Index name to target. + /// * [startDate] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [endDate] End date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [tags] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded. + /// * [requestOptions] additional request configuration. + Future getNoClickRate({ + required String index, + String? startDate, + String? endDate, + String? tags, + RequestOptions? requestOptions, + }) async { + assert( + index.isNotEmpty, + 'Parameter `index` is required when calling `getNoClickRate`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/2/searches/noClickRate', + queryParams: { + 'index': index, + if (startDate != null) 'startDate': startDate, + if (endDate != null) 'endDate': endDate, + if (tags != null) 'tags': tags, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetNoClickRateResponse', + growable: true, + ); + } + + /// Get no results rate. + /// Returns the rate at which searches didn't return any results. + /// + /// Parameters: + /// * [index] Index name to target. + /// * [startDate] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [endDate] End date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [tags] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded. + /// * [requestOptions] additional request configuration. + Future getNoResultsRate({ + required String index, + String? startDate, + String? endDate, + String? tags, + RequestOptions? requestOptions, + }) async { + assert( + index.isNotEmpty, + 'Parameter `index` is required when calling `getNoResultsRate`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/2/searches/noResultRate', + queryParams: { + 'index': index, + if (startDate != null) 'startDate': startDate, + if (endDate != null) 'endDate': endDate, + if (tags != null) 'tags': tags, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetNoResultsRateResponse', + growable: true, + ); + } + + /// Get number of searches. + /// Returns the number of searches within a time range. + /// + /// Parameters: + /// * [index] Index name to target. + /// * [startDate] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [endDate] End date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [tags] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded. + /// * [requestOptions] additional request configuration. + Future getSearchesCount({ + required String index, + String? startDate, + String? endDate, + String? tags, + RequestOptions? requestOptions, + }) async { + assert( + index.isNotEmpty, + 'Parameter `index` is required when calling `getSearchesCount`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/2/searches/count', + queryParams: { + 'index': index, + if (startDate != null) 'startDate': startDate, + if (endDate != null) 'endDate': endDate, + if (tags != null) 'tags': tags, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetSearchesCountResponse', + growable: true, + ); + } + + /// Get top searches with no clicks. + /// Return the most popular of the last 1,000 searches that didn't lead to any clicks. + /// + /// Parameters: + /// * [index] Index name to target. + /// * [startDate] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [endDate] End date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [limit] Number of records to return (page size). + /// * [offset] Position of the starting record. Used for paging. 0 is the first record. + /// * [tags] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded. + /// * [requestOptions] additional request configuration. + Future getSearchesNoClicks({ + required String index, + String? startDate, + String? endDate, + int? limit, + int? offset, + String? tags, + RequestOptions? requestOptions, + }) async { + assert( + index.isNotEmpty, + 'Parameter `index` is required when calling `getSearchesNoClicks`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/2/searches/noClicks', + queryParams: { + 'index': index, + if (startDate != null) 'startDate': startDate, + if (endDate != null) 'endDate': endDate, + if (limit != null) 'limit': limit, + if (offset != null) 'offset': offset, + if (tags != null) 'tags': tags, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetSearchesNoClicksResponse', + growable: true, + ); + } + + /// Get top searches with no results. + /// Returns the most popular of the latest 1,000 searches that didn't return any results. + /// + /// Parameters: + /// * [index] Index name to target. + /// * [startDate] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [endDate] End date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [limit] Number of records to return (page size). + /// * [offset] Position of the starting record. Used for paging. 0 is the first record. + /// * [tags] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded. + /// * [requestOptions] additional request configuration. + Future getSearchesNoResults({ + required String index, + String? startDate, + String? endDate, + int? limit, + int? offset, + String? tags, + RequestOptions? requestOptions, + }) async { + assert( + index.isNotEmpty, + 'Parameter `index` is required when calling `getSearchesNoResults`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/2/searches/noResults', + queryParams: { + 'index': index, + if (startDate != null) 'startDate': startDate, + if (endDate != null) 'endDate': endDate, + if (limit != null) 'limit': limit, + if (offset != null) 'offset': offset, + if (tags != null) 'tags': tags, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetSearchesNoResultsResponse', + growable: true, + ); + } + + /// Get Analytics API status. + /// Return the latest update time of the Analytics API for an index. If the index has been recently created or no search has been performed yet, `updatedAt` will be `null`. > **Note**: The Analytics API is updated every 5 minutes. + /// + /// Parameters: + /// * [index] Index name to target. + /// * [requestOptions] additional request configuration. + Future getStatus({ + required String index, + RequestOptions? requestOptions, + }) async { + assert( + index.isNotEmpty, + 'Parameter `index` is required when calling `getStatus`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/2/status', + queryParams: { + 'index': index, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetStatusResponse', + growable: true, + ); + } + + /// Get top countries. + /// Returns top countries. Limited to the 1,000 most frequent ones. + /// + /// Parameters: + /// * [index] Index name to target. + /// * [startDate] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [endDate] End date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [limit] Number of records to return (page size). + /// * [offset] Position of the starting record. Used for paging. 0 is the first record. + /// * [tags] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded. + /// * [requestOptions] additional request configuration. + Future getTopCountries({ + required String index, + String? startDate, + String? endDate, + int? limit, + int? offset, + String? tags, + RequestOptions? requestOptions, + }) async { + assert( + index.isNotEmpty, + 'Parameter `index` is required when calling `getTopCountries`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/2/countries', + queryParams: { + 'index': index, + if (startDate != null) 'startDate': startDate, + if (endDate != null) 'endDate': endDate, + if (limit != null) 'limit': limit, + if (offset != null) 'offset': offset, + if (tags != null) 'tags': tags, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetTopCountriesResponse', + growable: true, + ); + } + + /// Get top filterable attributes. + /// Return the most popular [filterable attributes](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/) in the 1,000 most recently used filters. + /// + /// Parameters: + /// * [index] Index name to target. + /// * [search] User query. + /// * [startDate] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [endDate] End date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [limit] Number of records to return (page size). + /// * [offset] Position of the starting record. Used for paging. 0 is the first record. + /// * [tags] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded. + /// * [requestOptions] additional request configuration. + Future getTopFilterAttributes({ + required String index, + String? search, + String? startDate, + String? endDate, + int? limit, + int? offset, + String? tags, + RequestOptions? requestOptions, + }) async { + assert( + index.isNotEmpty, + 'Parameter `index` is required when calling `getTopFilterAttributes`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/2/filters', + queryParams: { + 'index': index, + if (search != null) 'search': search, + if (startDate != null) 'startDate': startDate, + if (endDate != null) 'endDate': endDate, + if (limit != null) 'limit': limit, + if (offset != null) 'offset': offset, + if (tags != null) 'tags': tags, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetTopFilterAttributesResponse', + growable: true, + ); + } + + /// Get top filter values for an attribute. + /// Returns the most popular filter values for an attribute in the 1,000 most recently used filters. + /// + /// Parameters: + /// * [attribute] Attribute name. + /// * [index] Index name to target. + /// * [search] User query. + /// * [startDate] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [endDate] End date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [limit] Number of records to return (page size). + /// * [offset] Position of the starting record. Used for paging. 0 is the first record. + /// * [tags] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded. + /// * [requestOptions] additional request configuration. + Future getTopFilterForAttribute({ + required String attribute, + required String index, + String? search, + String? startDate, + String? endDate, + int? limit, + int? offset, + String? tags, + RequestOptions? requestOptions, + }) async { + assert( + attribute.isNotEmpty, + 'Parameter `attribute` is required when calling `getTopFilterForAttribute`.', + ); + assert( + index.isNotEmpty, + 'Parameter `index` is required when calling `getTopFilterForAttribute`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/2/filters/{attribute}'.replaceAll( + '{' r'attribute' '}', Uri.encodeComponent(attribute.toString())), + queryParams: { + 'index': index, + if (search != null) 'search': search, + if (startDate != null) 'startDate': startDate, + if (endDate != null) 'endDate': endDate, + if (limit != null) 'limit': limit, + if (offset != null) 'offset': offset, + if (tags != null) 'tags': tags, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetTopFilterForAttributeResponse', + growable: true, + ); + } + + /// Get top filters for a no result search. + /// Returns top filters for filter-enabled searches that don't return results. Limited to the 1,000 most recently used filters. + /// + /// Parameters: + /// * [index] Index name to target. + /// * [search] User query. + /// * [startDate] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [endDate] End date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [limit] Number of records to return (page size). + /// * [offset] Position of the starting record. Used for paging. 0 is the first record. + /// * [tags] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded. + /// * [requestOptions] additional request configuration. + Future getTopFiltersNoResults({ + required String index, + String? search, + String? startDate, + String? endDate, + int? limit, + int? offset, + String? tags, + RequestOptions? requestOptions, + }) async { + assert( + index.isNotEmpty, + 'Parameter `index` is required when calling `getTopFiltersNoResults`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/2/filters/noResults', + queryParams: { + 'index': index, + if (search != null) 'search': search, + if (startDate != null) 'startDate': startDate, + if (endDate != null) 'endDate': endDate, + if (limit != null) 'limit': limit, + if (offset != null) 'offset': offset, + if (tags != null) 'tags': tags, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetTopFiltersNoResultsResponse', + growable: true, + ); + } + + /// Get top hits. + /// Return the most popular clicked results in the last 1,000 searches. + /// + /// Parameters: + /// * [index] Index name to target. + /// * [search] User query. + /// * [clickAnalytics] Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search. + /// * [startDate] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [endDate] End date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [limit] Number of records to return (page size). + /// * [offset] Position of the starting record. Used for paging. 0 is the first record. + /// * [tags] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded. + /// * [requestOptions] additional request configuration. + /// Returns one of types: + /// - [dynamic] + Future getTopHits({ + required String index, + String? search, + bool? clickAnalytics, + String? startDate, + String? endDate, + int? limit, + int? offset, + String? tags, + RequestOptions? requestOptions, + }) async { + assert( + index.isNotEmpty, + 'Parameter `index` is required when calling `getTopHits`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/2/hits', + queryParams: { + 'index': index, + if (search != null) 'search': search, + if (clickAnalytics != null) 'clickAnalytics': clickAnalytics, + if (startDate != null) 'startDate': startDate, + if (endDate != null) 'endDate': endDate, + if (limit != null) 'limit': limit, + if (offset != null) 'offset': offset, + if (tags != null) 'tags': tags, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'dynamic', + growable: true, + ); + } + + /// Get top searches. + /// Returns the most popular of the latest 1,000 searches. For each search, also returns the number of hits. + /// + /// Parameters: + /// * [index] Index name to target. + /// * [clickAnalytics] Whether to include [click and conversion](https://www.algolia.com/doc/guides/sending-events/getting-started/) rates for a search. + /// * [startDate] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [endDate] End date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [orderBy] Reorder the results. + /// * [direction] Sorting direction of the results: ascending or descending. + /// * [limit] Number of records to return (page size). + /// * [offset] Position of the starting record. Used for paging. 0 is the first record. + /// * [tags] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded. + /// * [requestOptions] additional request configuration. + /// Returns one of types: + /// - [dynamic] + Future getTopSearches({ + required String index, + bool? clickAnalytics, + String? startDate, + String? endDate, + OrderBy? orderBy, + Direction? direction, + int? limit, + int? offset, + String? tags, + RequestOptions? requestOptions, + }) async { + assert( + index.isNotEmpty, + 'Parameter `index` is required when calling `getTopSearches`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/2/searches', + queryParams: { + 'index': index, + if (clickAnalytics != null) 'clickAnalytics': clickAnalytics, + if (startDate != null) 'startDate': startDate, + if (endDate != null) 'endDate': endDate, + if (orderBy != null) 'orderBy': orderBy, + if (direction != null) 'direction': direction, + if (limit != null) 'limit': limit, + if (offset != null) 'offset': offset, + if (tags != null) 'tags': tags, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'dynamic', + growable: true, + ); + } + + /// Get user count. + /// Return the count of unique users. + /// + /// Parameters: + /// * [index] Index name to target. + /// * [startDate] Start date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [endDate] End date (a string in the format `YYYY-MM-DD`) of the period to analyze. + /// * [tags] Filter analytics on the [`analyticsTags`](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it must be URL-encoded. + /// * [requestOptions] additional request configuration. + Future getUsersCount({ + required String index, + String? startDate, + String? endDate, + String? tags, + RequestOptions? requestOptions, + }) async { + assert( + index.isNotEmpty, + 'Parameter `index` is required when calling `getUsersCount`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/2/users/count', + queryParams: { + 'index': index, + if (startDate != null) 'startDate': startDate, + if (endDate != null) 'endDate': endDate, + if (tags != null) 'tags': tags, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetUsersCountResponse', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [body] Parameters to send with the custom request. + /// * [requestOptions] additional request configuration. + Future post({ + required String path, + Map? parameters, + Object? body, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `post`.', + ); + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + body: body, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [body] Parameters to send with the custom request. + /// * [requestOptions] additional request configuration. + Future put({ + required String path, + Map? parameters, + Object? body, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `put`.', + ); + final request = ApiRequest( + method: RequestMethod.put, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + body: body, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + @override + void dispose() => _retryStrategy.dispose(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/deserialize.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/deserialize.dart new file mode 100644 index 0000000000..503e7a8ec9 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/deserialize.dart @@ -0,0 +1,211 @@ +import 'package:algolia_client_analytics/src/model/average_click_event.dart'; +import 'package:algolia_client_analytics/src/model/click_position.dart'; +import 'package:algolia_client_analytics/src/model/click_through_rate_event.dart'; +import 'package:algolia_client_analytics/src/model/conversion_rate_event.dart'; +import 'package:algolia_client_analytics/src/model/direction.dart'; +import 'package:algolia_client_analytics/src/model/error_base.dart'; +import 'package:algolia_client_analytics/src/model/get_average_click_position_response.dart'; +import 'package:algolia_client_analytics/src/model/get_click_positions_response.dart'; +import 'package:algolia_client_analytics/src/model/get_click_through_rate_response.dart'; +import 'package:algolia_client_analytics/src/model/get_conversation_rate_response.dart'; +import 'package:algolia_client_analytics/src/model/get_no_click_rate_response.dart'; +import 'package:algolia_client_analytics/src/model/get_no_results_rate_response.dart'; +import 'package:algolia_client_analytics/src/model/get_searches_count_response.dart'; +import 'package:algolia_client_analytics/src/model/get_searches_no_clicks_response.dart'; +import 'package:algolia_client_analytics/src/model/get_searches_no_results_response.dart'; +import 'package:algolia_client_analytics/src/model/get_status_response.dart'; +import 'package:algolia_client_analytics/src/model/get_top_countries_response.dart'; +import 'package:algolia_client_analytics/src/model/get_top_filter_attribute.dart'; +import 'package:algolia_client_analytics/src/model/get_top_filter_attributes_response.dart'; +import 'package:algolia_client_analytics/src/model/get_top_filter_for_attribute.dart'; +import 'package:algolia_client_analytics/src/model/get_top_filter_for_attribute_response.dart'; +import 'package:algolia_client_analytics/src/model/get_top_filters_no_results_response.dart'; +import 'package:algolia_client_analytics/src/model/get_top_filters_no_results_value.dart'; +import 'package:algolia_client_analytics/src/model/get_top_filters_no_results_values.dart'; +import 'package:algolia_client_analytics/src/model/get_users_count_response.dart'; +import 'package:algolia_client_analytics/src/model/no_click_rate_event.dart'; +import 'package:algolia_client_analytics/src/model/no_results_rate_event.dart'; +import 'package:algolia_client_analytics/src/model/order_by.dart'; +import 'package:algolia_client_analytics/src/model/search_event.dart'; +import 'package:algolia_client_analytics/src/model/search_no_click_event.dart'; +import 'package:algolia_client_analytics/src/model/search_no_result_event.dart'; +import 'package:algolia_client_analytics/src/model/top_country.dart'; +import 'package:algolia_client_analytics/src/model/top_hit.dart'; +import 'package:algolia_client_analytics/src/model/top_hit_with_analytics.dart'; +import 'package:algolia_client_analytics/src/model/top_hits_response.dart'; +import 'package:algolia_client_analytics/src/model/top_hits_response_with_analytics.dart'; +import 'package:algolia_client_analytics/src/model/top_search.dart'; +import 'package:algolia_client_analytics/src/model/top_search_with_analytics.dart'; +import 'package:algolia_client_analytics/src/model/top_searches_response.dart'; +import 'package:algolia_client_analytics/src/model/top_searches_response_with_analytics.dart'; +import 'package:algolia_client_analytics/src/model/user_with_date.dart'; + +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + +ReturnType deserialize(dynamic value, String targetType, + {bool growable = true}) { + switch (targetType) { + case 'String': + return '$value' as ReturnType; + case 'int': + return (value is int ? value : int.parse('$value')) as ReturnType; + case 'bool': + if (value is bool) { + return value as ReturnType; + } + final valueString = '$value'.toLowerCase(); + return (valueString == 'true' || valueString == '1') as ReturnType; + case 'double': + return (value is double ? value : double.parse('$value')) as ReturnType; + case 'AverageClickEvent': + return AverageClickEvent.fromJson(value as Map) + as ReturnType; + case 'ClickPosition': + return ClickPosition.fromJson(value as Map) + as ReturnType; + case 'ClickThroughRateEvent': + return ClickThroughRateEvent.fromJson(value as Map) + as ReturnType; + case 'ConversionRateEvent': + return ConversionRateEvent.fromJson(value as Map) + as ReturnType; + case 'Direction': + return Direction.fromJson(value) as ReturnType; + case 'ErrorBase': + return ErrorBase.fromJson(value as Map) as ReturnType; + case 'GetAverageClickPositionResponse': + return GetAverageClickPositionResponse.fromJson( + value as Map) as ReturnType; + case 'GetClickPositionsResponse': + return GetClickPositionsResponse.fromJson(value as Map) + as ReturnType; + case 'GetClickThroughRateResponse': + return GetClickThroughRateResponse.fromJson(value as Map) + as ReturnType; + case 'GetConversationRateResponse': + return GetConversationRateResponse.fromJson(value as Map) + as ReturnType; + case 'GetNoClickRateResponse': + return GetNoClickRateResponse.fromJson(value as Map) + as ReturnType; + case 'GetNoResultsRateResponse': + return GetNoResultsRateResponse.fromJson(value as Map) + as ReturnType; + case 'GetSearchesCountResponse': + return GetSearchesCountResponse.fromJson(value as Map) + as ReturnType; + case 'GetSearchesNoClicksResponse': + return GetSearchesNoClicksResponse.fromJson(value as Map) + as ReturnType; + case 'GetSearchesNoResultsResponse': + return GetSearchesNoResultsResponse.fromJson( + value as Map) as ReturnType; + case 'GetStatusResponse': + return GetStatusResponse.fromJson(value as Map) + as ReturnType; + case 'GetTopCountriesResponse': + return GetTopCountriesResponse.fromJson(value as Map) + as ReturnType; + case 'GetTopFilterAttribute': + return GetTopFilterAttribute.fromJson(value as Map) + as ReturnType; + case 'GetTopFilterAttributesResponse': + return GetTopFilterAttributesResponse.fromJson( + value as Map) as ReturnType; + case 'GetTopFilterForAttribute': + return GetTopFilterForAttribute.fromJson(value as Map) + as ReturnType; + case 'GetTopFilterForAttributeResponse': + return GetTopFilterForAttributeResponse.fromJson( + value as Map) as ReturnType; + case 'GetTopFiltersNoResultsResponse': + return GetTopFiltersNoResultsResponse.fromJson( + value as Map) as ReturnType; + case 'GetTopFiltersNoResultsValue': + return GetTopFiltersNoResultsValue.fromJson(value as Map) + as ReturnType; + case 'GetTopFiltersNoResultsValues': + return GetTopFiltersNoResultsValues.fromJson( + value as Map) as ReturnType; + case 'GetUsersCountResponse': + return GetUsersCountResponse.fromJson(value as Map) + as ReturnType; + case 'NoClickRateEvent': + return NoClickRateEvent.fromJson(value as Map) + as ReturnType; + case 'NoResultsRateEvent': + return NoResultsRateEvent.fromJson(value as Map) + as ReturnType; + case 'OrderBy': + return OrderBy.fromJson(value) as ReturnType; + case 'SearchEvent': + return SearchEvent.fromJson(value as Map) as ReturnType; + case 'SearchNoClickEvent': + return SearchNoClickEvent.fromJson(value as Map) + as ReturnType; + case 'SearchNoResultEvent': + return SearchNoResultEvent.fromJson(value as Map) + as ReturnType; + case 'TopCountry': + return TopCountry.fromJson(value as Map) as ReturnType; + case 'TopHit': + return TopHit.fromJson(value as Map) as ReturnType; + case 'TopHitWithAnalytics': + return TopHitWithAnalytics.fromJson(value as Map) + as ReturnType; + case 'TopHitsResponse': + return TopHitsResponse.fromJson(value as Map) + as ReturnType; + case 'TopHitsResponseWithAnalytics': + return TopHitsResponseWithAnalytics.fromJson( + value as Map) as ReturnType; + case 'TopSearch': + return TopSearch.fromJson(value as Map) as ReturnType; + case 'TopSearchWithAnalytics': + return TopSearchWithAnalytics.fromJson(value as Map) + as ReturnType; + case 'TopSearchesResponse': + return TopSearchesResponse.fromJson(value as Map) + as ReturnType; + case 'TopSearchesResponseWithAnalytics': + return TopSearchesResponseWithAnalytics.fromJson( + value as Map) as ReturnType; + case 'UserWithDate': + return UserWithDate.fromJson(value as Map) as ReturnType; + default: + RegExpMatch? match; + + if (value is List && (match = _regList.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toList(growable: growable) as ReturnType; + } + if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toSet() as ReturnType; + } + if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return Map.fromIterables( + value.keys, + value.values.map((dynamic v) => deserialize( + v, targetType, + growable: growable)), + ) as ReturnType; + } + if (targetType == 'Object') { + return value; + } + break; + } + throw Exception('Cannot deserialize'); +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/average_click_event.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/average_click_event.dart new file mode 100644 index 0000000000..063444c8b6 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/average_click_event.dart @@ -0,0 +1,49 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'average_click_event.g.dart'; + +@JsonSerializable() +final class AverageClickEvent { + /// Returns a new [AverageClickEvent] instance. + const AverageClickEvent({ + required this.average, + required this.clickCount, + required this.date, + }); + + /// Average count of all click events. + @JsonKey(name: r'average') + final double average; + + /// Number of click events. + @JsonKey(name: r'clickCount') + final int clickCount; + + /// Date of the event in the format YYYY-MM-DD. + @JsonKey(name: r'date') + final String date; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AverageClickEvent && + other.average == average && + other.clickCount == clickCount && + other.date == date; + + @override + int get hashCode => average.hashCode + clickCount.hashCode + date.hashCode; + + factory AverageClickEvent.fromJson(Map json) => + _$AverageClickEventFromJson(json); + + Map toJson() => _$AverageClickEventToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/average_click_event.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/average_click_event.g.dart new file mode 100644 index 0000000000..e0beced757 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/average_click_event.g.dart @@ -0,0 +1,28 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'average_click_event.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AverageClickEvent _$AverageClickEventFromJson(Map json) => + $checkedCreate( + 'AverageClickEvent', + json, + ($checkedConvert) { + final val = AverageClickEvent( + average: $checkedConvert('average', (v) => (v as num).toDouble()), + clickCount: $checkedConvert('clickCount', (v) => v as int), + date: $checkedConvert('date', (v) => v as String), + ); + return val; + }, + ); + +Map _$AverageClickEventToJson(AverageClickEvent instance) => + { + 'average': instance.average, + 'clickCount': instance.clickCount, + 'date': instance.date, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/click_position.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/click_position.dart new file mode 100644 index 0000000000..ecb220d0e3 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/click_position.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'click_position.g.dart'; + +@JsonSerializable() +final class ClickPosition { + /// Returns a new [ClickPosition] instance. + const ClickPosition({ + required this.position, + required this.clickCount, + }); + + /// Range of positions with the following pattern: - For positions 1 to 10, the number of click events are shown for each position - For positions 11 to 20, all click events are grouped - For positions 21 and up, all click events are grouped. + @JsonKey(name: r'position') + final List position; + + /// Number of click events. + @JsonKey(name: r'clickCount') + final int clickCount; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ClickPosition && + other.position == position && + other.clickCount == clickCount; + + @override + int get hashCode => position.hashCode + clickCount.hashCode; + + factory ClickPosition.fromJson(Map json) => + _$ClickPositionFromJson(json); + + Map toJson() => _$ClickPositionToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/click_position.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/click_position.g.dart new file mode 100644 index 0000000000..904962c505 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/click_position.g.dart @@ -0,0 +1,27 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'click_position.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ClickPosition _$ClickPositionFromJson(Map json) => + $checkedCreate( + 'ClickPosition', + json, + ($checkedConvert) { + final val = ClickPosition( + position: $checkedConvert('position', + (v) => (v as List).map((e) => e as int).toList()), + clickCount: $checkedConvert('clickCount', (v) => v as int), + ); + return val; + }, + ); + +Map _$ClickPositionToJson(ClickPosition instance) => + { + 'position': instance.position, + 'clickCount': instance.clickCount, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/click_through_rate_event.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/click_through_rate_event.dart new file mode 100644 index 0000000000..a0cb8ebebe --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/click_through_rate_event.dart @@ -0,0 +1,61 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'click_through_rate_event.g.dart'; + +@JsonSerializable() +final class ClickThroughRateEvent { + /// Returns a new [ClickThroughRateEvent] instance. + const ClickThroughRateEvent({ + required this.rate, + required this.clickCount, + required this.trackedSearchCount, + required this.date, + }); + + /// [Click-through rate (CTR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate). + // minimum: 0 + // maximum: 1 + @JsonKey(name: r'rate') + final double rate; + + /// Number of click events. + @JsonKey(name: r'clickCount') + final int clickCount; + + /// Number of tracked searches. This is the number of search requests where the `clickAnalytics` parameter is `true`. + @JsonKey(name: r'trackedSearchCount') + final int trackedSearchCount; + + /// Date of the event in the format YYYY-MM-DD. + @JsonKey(name: r'date') + final String date; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ClickThroughRateEvent && + other.rate == rate && + other.clickCount == clickCount && + other.trackedSearchCount == trackedSearchCount && + other.date == date; + + @override + int get hashCode => + rate.hashCode + + clickCount.hashCode + + trackedSearchCount.hashCode + + date.hashCode; + + factory ClickThroughRateEvent.fromJson(Map json) => + _$ClickThroughRateEventFromJson(json); + + Map toJson() => _$ClickThroughRateEventToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/click_through_rate_event.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/click_through_rate_event.g.dart new file mode 100644 index 0000000000..78b3f9284f --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/click_through_rate_event.g.dart @@ -0,0 +1,33 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'click_through_rate_event.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ClickThroughRateEvent _$ClickThroughRateEventFromJson( + Map json) => + $checkedCreate( + 'ClickThroughRateEvent', + json, + ($checkedConvert) { + final val = ClickThroughRateEvent( + rate: $checkedConvert('rate', (v) => (v as num).toDouble()), + clickCount: $checkedConvert('clickCount', (v) => v as int), + trackedSearchCount: + $checkedConvert('trackedSearchCount', (v) => v as int), + date: $checkedConvert('date', (v) => v as String), + ); + return val; + }, + ); + +Map _$ClickThroughRateEventToJson( + ClickThroughRateEvent instance) => + { + 'rate': instance.rate, + 'clickCount': instance.clickCount, + 'trackedSearchCount': instance.trackedSearchCount, + 'date': instance.date, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/conversion_rate_event.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/conversion_rate_event.dart new file mode 100644 index 0000000000..078bb77c40 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/conversion_rate_event.dart @@ -0,0 +1,61 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'conversion_rate_event.g.dart'; + +@JsonSerializable() +final class ConversionRateEvent { + /// Returns a new [ConversionRateEvent] instance. + const ConversionRateEvent({ + required this.rate, + required this.trackedSearchCount, + required this.conversionCount, + required this.date, + }); + + /// [Click-through rate (CTR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate). + // minimum: 0 + // maximum: 1 + @JsonKey(name: r'rate') + final double rate; + + /// Number of tracked searches. This is the number of search requests where the `clickAnalytics` parameter is `true`. + @JsonKey(name: r'trackedSearchCount') + final int trackedSearchCount; + + /// Number of converted clicks. + @JsonKey(name: r'conversionCount') + final int conversionCount; + + /// Date of the event in the format YYYY-MM-DD. + @JsonKey(name: r'date') + final String date; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ConversionRateEvent && + other.rate == rate && + other.trackedSearchCount == trackedSearchCount && + other.conversionCount == conversionCount && + other.date == date; + + @override + int get hashCode => + rate.hashCode + + trackedSearchCount.hashCode + + conversionCount.hashCode + + date.hashCode; + + factory ConversionRateEvent.fromJson(Map json) => + _$ConversionRateEventFromJson(json); + + Map toJson() => _$ConversionRateEventToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/conversion_rate_event.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/conversion_rate_event.g.dart new file mode 100644 index 0000000000..563323a0bb --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/conversion_rate_event.g.dart @@ -0,0 +1,32 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'conversion_rate_event.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ConversionRateEvent _$ConversionRateEventFromJson(Map json) => + $checkedCreate( + 'ConversionRateEvent', + json, + ($checkedConvert) { + final val = ConversionRateEvent( + rate: $checkedConvert('rate', (v) => (v as num).toDouble()), + trackedSearchCount: + $checkedConvert('trackedSearchCount', (v) => v as int), + conversionCount: $checkedConvert('conversionCount', (v) => v as int), + date: $checkedConvert('date', (v) => v as String), + ); + return val; + }, + ); + +Map _$ConversionRateEventToJson( + ConversionRateEvent instance) => + { + 'rate': instance.rate, + 'trackedSearchCount': instance.trackedSearchCount, + 'conversionCount': instance.conversionCount, + 'date': instance.date, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/direction.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/direction.dart new file mode 100644 index 0000000000..2e3879c534 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/direction.dart @@ -0,0 +1,24 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum Direction { + asc(r'asc'), + desc(r'desc'); + + const Direction(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static Direction fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/error_base.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/error_base.dart new file mode 100644 index 0000000000..df5d4ade57 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/error_base.dart @@ -0,0 +1,47 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:collection/collection.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'error_base.g.dart'; + +@JsonSerializable(createFieldMap: true) +final class ErrorBase extends DelegatingMap { + /// Returns a new [ErrorBase] instance. + const ErrorBase({ + this.message, + Map additionalProperties = const {}, + }) : super(additionalProperties); + + @JsonKey(name: r'message') + final String? message; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ErrorBase && + other.message == message && + const MapEquality().equals(this, this); + + @override + int get hashCode => + message.hashCode + const MapEquality().hash(this); + + factory ErrorBase.fromJson(Map json) { + final instance = _$ErrorBaseFromJson(json); + final additionalProperties = Map.from(json) + ..removeWhere((key, value) => _$ErrorBaseFieldMap.containsKey(key)); + return ErrorBase( + message: instance.message, + additionalProperties: additionalProperties, + ); + } + + Map toJson() => _$ErrorBaseToJson(this)..addAll(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/error_base.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/error_base.g.dart new file mode 100644 index 0000000000..f796166fb2 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/error_base.g.dart @@ -0,0 +1,35 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'error_base.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ErrorBase _$ErrorBaseFromJson(Map json) => $checkedCreate( + 'ErrorBase', + json, + ($checkedConvert) { + final val = ErrorBase( + message: $checkedConvert('message', (v) => v as String?), + ); + return val; + }, + ); + +const _$ErrorBaseFieldMap = { + 'message': 'message', +}; + +Map _$ErrorBaseToJson(ErrorBase instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('message', instance.message); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_average_click_position_response.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_average_click_position_response.dart new file mode 100644 index 0000000000..1eb1848ae6 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_average_click_position_response.dart @@ -0,0 +1,51 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_analytics/src/model/average_click_event.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_average_click_position_response.g.dart'; + +@JsonSerializable() +final class GetAverageClickPositionResponse { + /// Returns a new [GetAverageClickPositionResponse] instance. + const GetAverageClickPositionResponse({ + required this.average, + required this.clickCount, + required this.dates, + }); + + /// Average count of all click events. + @JsonKey(name: r'average') + final double average; + + /// Number of click events. + @JsonKey(name: r'clickCount') + final int clickCount; + + /// Average click positions. + @JsonKey(name: r'dates') + final List dates; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetAverageClickPositionResponse && + other.average == average && + other.clickCount == clickCount && + other.dates == dates; + + @override + int get hashCode => average.hashCode + clickCount.hashCode + dates.hashCode; + + factory GetAverageClickPositionResponse.fromJson(Map json) => + _$GetAverageClickPositionResponseFromJson(json); + + Map toJson() => + _$GetAverageClickPositionResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_average_click_position_response.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_average_click_position_response.g.dart new file mode 100644 index 0000000000..788621921e --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_average_click_position_response.g.dart @@ -0,0 +1,35 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_average_click_position_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetAverageClickPositionResponse _$GetAverageClickPositionResponseFromJson( + Map json) => + $checkedCreate( + 'GetAverageClickPositionResponse', + json, + ($checkedConvert) { + final val = GetAverageClickPositionResponse( + average: $checkedConvert('average', (v) => (v as num).toDouble()), + clickCount: $checkedConvert('clickCount', (v) => v as int), + dates: $checkedConvert( + 'dates', + (v) => (v as List) + .map((e) => + AverageClickEvent.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$GetAverageClickPositionResponseToJson( + GetAverageClickPositionResponse instance) => + { + 'average': instance.average, + 'clickCount': instance.clickCount, + 'dates': instance.dates.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_click_positions_response.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_click_positions_response.dart new file mode 100644 index 0000000000..dab4bd82b6 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_click_positions_response.dart @@ -0,0 +1,37 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_analytics/src/model/click_position.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_click_positions_response.g.dart'; + +@JsonSerializable() +final class GetClickPositionsResponse { + /// Returns a new [GetClickPositionsResponse] instance. + const GetClickPositionsResponse({ + required this.positions, + }); + + /// Click positions. + @JsonKey(name: r'positions') + final List positions; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetClickPositionsResponse && other.positions == positions; + + @override + int get hashCode => positions.hashCode; + + factory GetClickPositionsResponse.fromJson(Map json) => + _$GetClickPositionsResponseFromJson(json); + + Map toJson() => _$GetClickPositionsResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_click_positions_response.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_click_positions_response.g.dart new file mode 100644 index 0000000000..ef38d86fb9 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_click_positions_response.g.dart @@ -0,0 +1,30 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_click_positions_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetClickPositionsResponse _$GetClickPositionsResponseFromJson( + Map json) => + $checkedCreate( + 'GetClickPositionsResponse', + json, + ($checkedConvert) { + final val = GetClickPositionsResponse( + positions: $checkedConvert( + 'positions', + (v) => (v as List) + .map((e) => ClickPosition.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$GetClickPositionsResponseToJson( + GetClickPositionsResponse instance) => + { + 'positions': instance.positions.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_click_through_rate_response.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_click_through_rate_response.dart new file mode 100644 index 0000000000..eeb9be5f54 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_click_through_rate_response.dart @@ -0,0 +1,62 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_analytics/src/model/click_through_rate_event.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_click_through_rate_response.g.dart'; + +@JsonSerializable() +final class GetClickThroughRateResponse { + /// Returns a new [GetClickThroughRateResponse] instance. + const GetClickThroughRateResponse({ + required this.rate, + required this.clickCount, + required this.trackedSearchCount, + required this.dates, + }); + + /// [Click-through rate (CTR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate). + // minimum: 0 + // maximum: 1 + @JsonKey(name: r'rate') + final double rate; + + /// Number of click events. + @JsonKey(name: r'clickCount') + final int clickCount; + + /// Number of tracked searches. This is the number of search requests where the `clickAnalytics` parameter is `true`. + @JsonKey(name: r'trackedSearchCount') + final int trackedSearchCount; + + /// Click-through rate events. + @JsonKey(name: r'dates') + final List dates; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetClickThroughRateResponse && + other.rate == rate && + other.clickCount == clickCount && + other.trackedSearchCount == trackedSearchCount && + other.dates == dates; + + @override + int get hashCode => + rate.hashCode + + clickCount.hashCode + + trackedSearchCount.hashCode + + dates.hashCode; + + factory GetClickThroughRateResponse.fromJson(Map json) => + _$GetClickThroughRateResponseFromJson(json); + + Map toJson() => _$GetClickThroughRateResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_click_through_rate_response.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_click_through_rate_response.g.dart new file mode 100644 index 0000000000..8cdb0164fe --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_click_through_rate_response.g.dart @@ -0,0 +1,38 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_click_through_rate_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetClickThroughRateResponse _$GetClickThroughRateResponseFromJson( + Map json) => + $checkedCreate( + 'GetClickThroughRateResponse', + json, + ($checkedConvert) { + final val = GetClickThroughRateResponse( + rate: $checkedConvert('rate', (v) => (v as num).toDouble()), + clickCount: $checkedConvert('clickCount', (v) => v as int), + trackedSearchCount: + $checkedConvert('trackedSearchCount', (v) => v as int), + dates: $checkedConvert( + 'dates', + (v) => (v as List) + .map((e) => + ClickThroughRateEvent.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$GetClickThroughRateResponseToJson( + GetClickThroughRateResponse instance) => + { + 'rate': instance.rate, + 'clickCount': instance.clickCount, + 'trackedSearchCount': instance.trackedSearchCount, + 'dates': instance.dates.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_conversation_rate_response.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_conversation_rate_response.dart new file mode 100644 index 0000000000..a9fa3d71be --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_conversation_rate_response.dart @@ -0,0 +1,62 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_analytics/src/model/conversion_rate_event.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_conversation_rate_response.g.dart'; + +@JsonSerializable() +final class GetConversationRateResponse { + /// Returns a new [GetConversationRateResponse] instance. + const GetConversationRateResponse({ + required this.rate, + required this.trackedSearchCount, + required this.conversionCount, + required this.dates, + }); + + /// [Click-through rate (CTR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate). + // minimum: 0 + // maximum: 1 + @JsonKey(name: r'rate') + final double rate; + + /// Number of tracked searches. This is the number of search requests where the `clickAnalytics` parameter is `true`. + @JsonKey(name: r'trackedSearchCount') + final int trackedSearchCount; + + /// Number of converted clicks. + @JsonKey(name: r'conversionCount') + final int conversionCount; + + /// Conversion events. + @JsonKey(name: r'dates') + final List dates; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetConversationRateResponse && + other.rate == rate && + other.trackedSearchCount == trackedSearchCount && + other.conversionCount == conversionCount && + other.dates == dates; + + @override + int get hashCode => + rate.hashCode + + trackedSearchCount.hashCode + + conversionCount.hashCode + + dates.hashCode; + + factory GetConversationRateResponse.fromJson(Map json) => + _$GetConversationRateResponseFromJson(json); + + Map toJson() => _$GetConversationRateResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_conversation_rate_response.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_conversation_rate_response.g.dart new file mode 100644 index 0000000000..aa68c13329 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_conversation_rate_response.g.dart @@ -0,0 +1,38 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_conversation_rate_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetConversationRateResponse _$GetConversationRateResponseFromJson( + Map json) => + $checkedCreate( + 'GetConversationRateResponse', + json, + ($checkedConvert) { + final val = GetConversationRateResponse( + rate: $checkedConvert('rate', (v) => (v as num).toDouble()), + trackedSearchCount: + $checkedConvert('trackedSearchCount', (v) => v as int), + conversionCount: $checkedConvert('conversionCount', (v) => v as int), + dates: $checkedConvert( + 'dates', + (v) => (v as List) + .map((e) => + ConversionRateEvent.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$GetConversationRateResponseToJson( + GetConversationRateResponse instance) => + { + 'rate': instance.rate, + 'trackedSearchCount': instance.trackedSearchCount, + 'conversionCount': instance.conversionCount, + 'dates': instance.dates.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_no_click_rate_response.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_no_click_rate_response.dart new file mode 100644 index 0000000000..70201debc5 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_no_click_rate_response.dart @@ -0,0 +1,59 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_analytics/src/model/no_click_rate_event.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_no_click_rate_response.g.dart'; + +@JsonSerializable() +final class GetNoClickRateResponse { + /// Returns a new [GetNoClickRateResponse] instance. + const GetNoClickRateResponse({ + required this.rate, + required this.count, + required this.noClickCount, + required this.dates, + }); + + /// [Click-through rate (CTR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate). + // minimum: 0 + // maximum: 1 + @JsonKey(name: r'rate') + final double rate; + + /// Number of click events. + @JsonKey(name: r'count') + final int count; + + /// Number of click events. + @JsonKey(name: r'noClickCount') + final int noClickCount; + + /// Overall count of searches without clicks plus a daily breakdown. + @JsonKey(name: r'dates') + final List dates; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetNoClickRateResponse && + other.rate == rate && + other.count == count && + other.noClickCount == noClickCount && + other.dates == dates; + + @override + int get hashCode => + rate.hashCode + count.hashCode + noClickCount.hashCode + dates.hashCode; + + factory GetNoClickRateResponse.fromJson(Map json) => + _$GetNoClickRateResponseFromJson(json); + + Map toJson() => _$GetNoClickRateResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_no_click_rate_response.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_no_click_rate_response.g.dart new file mode 100644 index 0000000000..ece9458617 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_no_click_rate_response.g.dart @@ -0,0 +1,37 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_no_click_rate_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetNoClickRateResponse _$GetNoClickRateResponseFromJson( + Map json) => + $checkedCreate( + 'GetNoClickRateResponse', + json, + ($checkedConvert) { + final val = GetNoClickRateResponse( + rate: $checkedConvert('rate', (v) => (v as num).toDouble()), + count: $checkedConvert('count', (v) => v as int), + noClickCount: $checkedConvert('noClickCount', (v) => v as int), + dates: $checkedConvert( + 'dates', + (v) => (v as List) + .map((e) => + NoClickRateEvent.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$GetNoClickRateResponseToJson( + GetNoClickRateResponse instance) => + { + 'rate': instance.rate, + 'count': instance.count, + 'noClickCount': instance.noClickCount, + 'dates': instance.dates.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_no_results_rate_response.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_no_results_rate_response.dart new file mode 100644 index 0000000000..b4751ce76c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_no_results_rate_response.dart @@ -0,0 +1,59 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_analytics/src/model/no_results_rate_event.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_no_results_rate_response.g.dart'; + +@JsonSerializable() +final class GetNoResultsRateResponse { + /// Returns a new [GetNoResultsRateResponse] instance. + const GetNoResultsRateResponse({ + required this.rate, + required this.count, + required this.noResultCount, + required this.dates, + }); + + /// [Click-through rate (CTR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate). + // minimum: 0 + // maximum: 1 + @JsonKey(name: r'rate') + final double rate; + + /// Number of occurrences. + @JsonKey(name: r'count') + final int count; + + /// Number of occurrences. + @JsonKey(name: r'noResultCount') + final int noResultCount; + + /// Overall count of searches without results plus a daily breakdown. + @JsonKey(name: r'dates') + final List dates; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetNoResultsRateResponse && + other.rate == rate && + other.count == count && + other.noResultCount == noResultCount && + other.dates == dates; + + @override + int get hashCode => + rate.hashCode + count.hashCode + noResultCount.hashCode + dates.hashCode; + + factory GetNoResultsRateResponse.fromJson(Map json) => + _$GetNoResultsRateResponseFromJson(json); + + Map toJson() => _$GetNoResultsRateResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_no_results_rate_response.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_no_results_rate_response.g.dart new file mode 100644 index 0000000000..a3ee48ff0a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_no_results_rate_response.g.dart @@ -0,0 +1,37 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_no_results_rate_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetNoResultsRateResponse _$GetNoResultsRateResponseFromJson( + Map json) => + $checkedCreate( + 'GetNoResultsRateResponse', + json, + ($checkedConvert) { + final val = GetNoResultsRateResponse( + rate: $checkedConvert('rate', (v) => (v as num).toDouble()), + count: $checkedConvert('count', (v) => v as int), + noResultCount: $checkedConvert('noResultCount', (v) => v as int), + dates: $checkedConvert( + 'dates', + (v) => (v as List) + .map((e) => + NoResultsRateEvent.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$GetNoResultsRateResponseToJson( + GetNoResultsRateResponse instance) => + { + 'rate': instance.rate, + 'count': instance.count, + 'noResultCount': instance.noResultCount, + 'dates': instance.dates.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_count_response.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_count_response.dart new file mode 100644 index 0000000000..58a42a71d0 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_count_response.dart @@ -0,0 +1,44 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_analytics/src/model/search_event.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_searches_count_response.g.dart'; + +@JsonSerializable() +final class GetSearchesCountResponse { + /// Returns a new [GetSearchesCountResponse] instance. + const GetSearchesCountResponse({ + required this.count, + required this.dates, + }); + + /// Number of occurrences. + @JsonKey(name: r'count') + final int count; + + /// Search events with their associated dates and hit counts. + @JsonKey(name: r'dates') + final List dates; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetSearchesCountResponse && + other.count == count && + other.dates == dates; + + @override + int get hashCode => count.hashCode + dates.hashCode; + + factory GetSearchesCountResponse.fromJson(Map json) => + _$GetSearchesCountResponseFromJson(json); + + Map toJson() => _$GetSearchesCountResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_count_response.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_count_response.g.dart new file mode 100644 index 0000000000..5db2b11be4 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_count_response.g.dart @@ -0,0 +1,32 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_searches_count_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetSearchesCountResponse _$GetSearchesCountResponseFromJson( + Map json) => + $checkedCreate( + 'GetSearchesCountResponse', + json, + ($checkedConvert) { + final val = GetSearchesCountResponse( + count: $checkedConvert('count', (v) => v as int), + dates: $checkedConvert( + 'dates', + (v) => (v as List) + .map((e) => SearchEvent.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$GetSearchesCountResponseToJson( + GetSearchesCountResponse instance) => + { + 'count': instance.count, + 'dates': instance.dates.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_no_clicks_response.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_no_clicks_response.dart new file mode 100644 index 0000000000..ae3f713f22 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_no_clicks_response.dart @@ -0,0 +1,37 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_analytics/src/model/search_no_click_event.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_searches_no_clicks_response.g.dart'; + +@JsonSerializable() +final class GetSearchesNoClicksResponse { + /// Returns a new [GetSearchesNoClicksResponse] instance. + const GetSearchesNoClicksResponse({ + required this.searches, + }); + + /// Searches with no clicks. + @JsonKey(name: r'searches') + final List searches; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetSearchesNoClicksResponse && other.searches == searches; + + @override + int get hashCode => searches.hashCode; + + factory GetSearchesNoClicksResponse.fromJson(Map json) => + _$GetSearchesNoClicksResponseFromJson(json); + + Map toJson() => _$GetSearchesNoClicksResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_no_clicks_response.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_no_clicks_response.g.dart new file mode 100644 index 0000000000..d5edbd5c63 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_no_clicks_response.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_searches_no_clicks_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetSearchesNoClicksResponse _$GetSearchesNoClicksResponseFromJson( + Map json) => + $checkedCreate( + 'GetSearchesNoClicksResponse', + json, + ($checkedConvert) { + final val = GetSearchesNoClicksResponse( + searches: $checkedConvert( + 'searches', + (v) => (v as List) + .map((e) => + SearchNoClickEvent.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$GetSearchesNoClicksResponseToJson( + GetSearchesNoClicksResponse instance) => + { + 'searches': instance.searches.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_no_results_response.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_no_results_response.dart new file mode 100644 index 0000000000..c0a87da81e --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_no_results_response.dart @@ -0,0 +1,37 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_analytics/src/model/search_no_result_event.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_searches_no_results_response.g.dart'; + +@JsonSerializable() +final class GetSearchesNoResultsResponse { + /// Returns a new [GetSearchesNoResultsResponse] instance. + const GetSearchesNoResultsResponse({ + required this.searches, + }); + + /// Searches with no results. + @JsonKey(name: r'searches') + final List searches; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetSearchesNoResultsResponse && other.searches == searches; + + @override + int get hashCode => searches.hashCode; + + factory GetSearchesNoResultsResponse.fromJson(Map json) => + _$GetSearchesNoResultsResponseFromJson(json); + + Map toJson() => _$GetSearchesNoResultsResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_no_results_response.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_no_results_response.g.dart new file mode 100644 index 0000000000..1128ac2007 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_searches_no_results_response.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_searches_no_results_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetSearchesNoResultsResponse _$GetSearchesNoResultsResponseFromJson( + Map json) => + $checkedCreate( + 'GetSearchesNoResultsResponse', + json, + ($checkedConvert) { + final val = GetSearchesNoResultsResponse( + searches: $checkedConvert( + 'searches', + (v) => (v as List) + .map((e) => + SearchNoResultEvent.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$GetSearchesNoResultsResponseToJson( + GetSearchesNoResultsResponse instance) => + { + 'searches': instance.searches.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_status_response.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_status_response.dart new file mode 100644 index 0000000000..aadba923c6 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_status_response.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_status_response.g.dart'; + +@JsonSerializable() +final class GetStatusResponse { + /// Returns a new [GetStatusResponse] instance. + const GetStatusResponse({ + required this.updatedAt, + }); + + /// Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. + @JsonKey(name: r'updatedAt') + final String updatedAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetStatusResponse && other.updatedAt == updatedAt; + + @override + int get hashCode => updatedAt.hashCode; + + factory GetStatusResponse.fromJson(Map json) => + _$GetStatusResponseFromJson(json); + + Map toJson() => _$GetStatusResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_status_response.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_status_response.g.dart new file mode 100644 index 0000000000..d3a4d52714 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_status_response.g.dart @@ -0,0 +1,24 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_status_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetStatusResponse _$GetStatusResponseFromJson(Map json) => + $checkedCreate( + 'GetStatusResponse', + json, + ($checkedConvert) { + final val = GetStatusResponse( + updatedAt: $checkedConvert('updatedAt', (v) => v as String), + ); + return val; + }, + ); + +Map _$GetStatusResponseToJson(GetStatusResponse instance) => + { + 'updatedAt': instance.updatedAt, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_countries_response.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_countries_response.dart new file mode 100644 index 0000000000..7349fca223 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_countries_response.dart @@ -0,0 +1,37 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_analytics/src/model/top_country.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_top_countries_response.g.dart'; + +@JsonSerializable() +final class GetTopCountriesResponse { + /// Returns a new [GetTopCountriesResponse] instance. + const GetTopCountriesResponse({ + required this.countries, + }); + + /// Countries + @JsonKey(name: r'countries') + final List countries; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetTopCountriesResponse && other.countries == countries; + + @override + int get hashCode => countries.hashCode; + + factory GetTopCountriesResponse.fromJson(Map json) => + _$GetTopCountriesResponseFromJson(json); + + Map toJson() => _$GetTopCountriesResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_countries_response.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_countries_response.g.dart new file mode 100644 index 0000000000..31383846d7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_countries_response.g.dart @@ -0,0 +1,30 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_top_countries_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetTopCountriesResponse _$GetTopCountriesResponseFromJson( + Map json) => + $checkedCreate( + 'GetTopCountriesResponse', + json, + ($checkedConvert) { + final val = GetTopCountriesResponse( + countries: $checkedConvert( + 'countries', + (v) => (v as List) + .map((e) => TopCountry.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$GetTopCountriesResponseToJson( + GetTopCountriesResponse instance) => + { + 'countries': instance.countries.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_attribute.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_attribute.dart new file mode 100644 index 0000000000..98206961b7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_attribute.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_top_filter_attribute.g.dart'; + +@JsonSerializable() +final class GetTopFilterAttribute { + /// Returns a new [GetTopFilterAttribute] instance. + const GetTopFilterAttribute({ + required this.attribute, + required this.count, + }); + + /// Attribute name. + @JsonKey(name: r'attribute') + final String attribute; + + /// Number of occurrences. + @JsonKey(name: r'count') + final int count; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetTopFilterAttribute && + other.attribute == attribute && + other.count == count; + + @override + int get hashCode => attribute.hashCode + count.hashCode; + + factory GetTopFilterAttribute.fromJson(Map json) => + _$GetTopFilterAttributeFromJson(json); + + Map toJson() => _$GetTopFilterAttributeToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_attribute.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_attribute.g.dart new file mode 100644 index 0000000000..2338e31b59 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_attribute.g.dart @@ -0,0 +1,28 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_top_filter_attribute.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetTopFilterAttribute _$GetTopFilterAttributeFromJson( + Map json) => + $checkedCreate( + 'GetTopFilterAttribute', + json, + ($checkedConvert) { + final val = GetTopFilterAttribute( + attribute: $checkedConvert('attribute', (v) => v as String), + count: $checkedConvert('count', (v) => v as int), + ); + return val; + }, + ); + +Map _$GetTopFilterAttributeToJson( + GetTopFilterAttribute instance) => + { + 'attribute': instance.attribute, + 'count': instance.count, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_attributes_response.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_attributes_response.dart new file mode 100644 index 0000000000..7b0a272a12 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_attributes_response.dart @@ -0,0 +1,37 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_analytics/src/model/get_top_filter_attribute.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_top_filter_attributes_response.g.dart'; + +@JsonSerializable() +final class GetTopFilterAttributesResponse { + /// Returns a new [GetTopFilterAttributesResponse] instance. + const GetTopFilterAttributesResponse({ + required this.attributes, + }); + + /// Filterable attributes. + @JsonKey(name: r'attributes') + final List attributes; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetTopFilterAttributesResponse && other.attributes == attributes; + + @override + int get hashCode => attributes.hashCode; + + factory GetTopFilterAttributesResponse.fromJson(Map json) => + _$GetTopFilterAttributesResponseFromJson(json); + + Map toJson() => _$GetTopFilterAttributesResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_attributes_response.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_attributes_response.g.dart new file mode 100644 index 0000000000..2a1bcfc671 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_attributes_response.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_top_filter_attributes_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetTopFilterAttributesResponse _$GetTopFilterAttributesResponseFromJson( + Map json) => + $checkedCreate( + 'GetTopFilterAttributesResponse', + json, + ($checkedConvert) { + final val = GetTopFilterAttributesResponse( + attributes: $checkedConvert( + 'attributes', + (v) => (v as List) + .map((e) => + GetTopFilterAttribute.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$GetTopFilterAttributesResponseToJson( + GetTopFilterAttributesResponse instance) => + { + 'attributes': instance.attributes.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_for_attribute.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_for_attribute.dart new file mode 100644 index 0000000000..c18ab6551d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_for_attribute.dart @@ -0,0 +1,56 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_top_filter_for_attribute.g.dart'; + +@JsonSerializable() +final class GetTopFilterForAttribute { + /// Returns a new [GetTopFilterForAttribute] instance. + const GetTopFilterForAttribute({ + required this.attribute, + required this.operator, + required this.value, + required this.count, + }); + + /// Attribute name. + @JsonKey(name: r'attribute') + final String attribute; + + /// Operator. + @JsonKey(name: r'operator') + final String operator; + + /// Attribute value. + @JsonKey(name: r'value') + final String value; + + /// Number of occurrences. + @JsonKey(name: r'count') + final int count; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetTopFilterForAttribute && + other.attribute == attribute && + other.operator == operator && + other.value == value && + other.count == count; + + @override + int get hashCode => + attribute.hashCode + operator.hashCode + value.hashCode + count.hashCode; + + factory GetTopFilterForAttribute.fromJson(Map json) => + _$GetTopFilterForAttributeFromJson(json); + + Map toJson() => _$GetTopFilterForAttributeToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_for_attribute.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_for_attribute.g.dart new file mode 100644 index 0000000000..d6588a7e08 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_for_attribute.g.dart @@ -0,0 +1,32 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_top_filter_for_attribute.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetTopFilterForAttribute _$GetTopFilterForAttributeFromJson( + Map json) => + $checkedCreate( + 'GetTopFilterForAttribute', + json, + ($checkedConvert) { + final val = GetTopFilterForAttribute( + attribute: $checkedConvert('attribute', (v) => v as String), + operator: $checkedConvert('operator', (v) => v as String), + value: $checkedConvert('value', (v) => v as String), + count: $checkedConvert('count', (v) => v as int), + ); + return val; + }, + ); + +Map _$GetTopFilterForAttributeToJson( + GetTopFilterForAttribute instance) => + { + 'attribute': instance.attribute, + 'operator': instance.operator, + 'value': instance.value, + 'count': instance.count, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_for_attribute_response.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_for_attribute_response.dart new file mode 100644 index 0000000000..cd8921767a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_for_attribute_response.dart @@ -0,0 +1,39 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_analytics/src/model/get_top_filter_for_attribute.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_top_filter_for_attribute_response.g.dart'; + +@JsonSerializable() +final class GetTopFilterForAttributeResponse { + /// Returns a new [GetTopFilterForAttributeResponse] instance. + const GetTopFilterForAttributeResponse({ + required this.values, + }); + + /// Filter values for an attribute. + @JsonKey(name: r'values') + final List values; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetTopFilterForAttributeResponse && other.values == values; + + @override + int get hashCode => values.hashCode; + + factory GetTopFilterForAttributeResponse.fromJson( + Map json) => + _$GetTopFilterForAttributeResponseFromJson(json); + + Map toJson() => + _$GetTopFilterForAttributeResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_for_attribute_response.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_for_attribute_response.g.dart new file mode 100644 index 0000000000..a9c693ca70 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filter_for_attribute_response.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_top_filter_for_attribute_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetTopFilterForAttributeResponse _$GetTopFilterForAttributeResponseFromJson( + Map json) => + $checkedCreate( + 'GetTopFilterForAttributeResponse', + json, + ($checkedConvert) { + final val = GetTopFilterForAttributeResponse( + values: $checkedConvert( + 'values', + (v) => (v as List) + .map((e) => GetTopFilterForAttribute.fromJson( + e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$GetTopFilterForAttributeResponseToJson( + GetTopFilterForAttributeResponse instance) => + { + 'values': instance.values.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_response.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_response.dart new file mode 100644 index 0000000000..bdd019f9bc --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_response.dart @@ -0,0 +1,37 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_analytics/src/model/get_top_filters_no_results_values.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_top_filters_no_results_response.g.dart'; + +@JsonSerializable() +final class GetTopFiltersNoResultsResponse { + /// Returns a new [GetTopFiltersNoResultsResponse] instance. + const GetTopFiltersNoResultsResponse({ + required this.values, + }); + + /// Filters with no results. + @JsonKey(name: r'values') + final List values; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetTopFiltersNoResultsResponse && other.values == values; + + @override + int get hashCode => values.hashCode; + + factory GetTopFiltersNoResultsResponse.fromJson(Map json) => + _$GetTopFiltersNoResultsResponseFromJson(json); + + Map toJson() => _$GetTopFiltersNoResultsResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_response.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_response.g.dart new file mode 100644 index 0000000000..becc5c7861 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_response.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_top_filters_no_results_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetTopFiltersNoResultsResponse _$GetTopFiltersNoResultsResponseFromJson( + Map json) => + $checkedCreate( + 'GetTopFiltersNoResultsResponse', + json, + ($checkedConvert) { + final val = GetTopFiltersNoResultsResponse( + values: $checkedConvert( + 'values', + (v) => (v as List) + .map((e) => GetTopFiltersNoResultsValues.fromJson( + e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$GetTopFiltersNoResultsResponseToJson( + GetTopFiltersNoResultsResponse instance) => + { + 'values': instance.values.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_value.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_value.dart new file mode 100644 index 0000000000..6a8f090f60 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_value.dart @@ -0,0 +1,49 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_top_filters_no_results_value.g.dart'; + +@JsonSerializable() +final class GetTopFiltersNoResultsValue { + /// Returns a new [GetTopFiltersNoResultsValue] instance. + const GetTopFiltersNoResultsValue({ + required this.attribute, + required this.operator, + required this.value, + }); + + /// Attribute name. + @JsonKey(name: r'attribute') + final String attribute; + + /// Operator. + @JsonKey(name: r'operator') + final String operator; + + /// Attribute value. + @JsonKey(name: r'value') + final String value; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetTopFiltersNoResultsValue && + other.attribute == attribute && + other.operator == operator && + other.value == value; + + @override + int get hashCode => attribute.hashCode + operator.hashCode + value.hashCode; + + factory GetTopFiltersNoResultsValue.fromJson(Map json) => + _$GetTopFiltersNoResultsValueFromJson(json); + + Map toJson() => _$GetTopFiltersNoResultsValueToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_value.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_value.g.dart new file mode 100644 index 0000000000..f56ceddcb4 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_value.g.dart @@ -0,0 +1,30 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_top_filters_no_results_value.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetTopFiltersNoResultsValue _$GetTopFiltersNoResultsValueFromJson( + Map json) => + $checkedCreate( + 'GetTopFiltersNoResultsValue', + json, + ($checkedConvert) { + final val = GetTopFiltersNoResultsValue( + attribute: $checkedConvert('attribute', (v) => v as String), + operator: $checkedConvert('operator', (v) => v as String), + value: $checkedConvert('value', (v) => v as String), + ); + return val; + }, + ); + +Map _$GetTopFiltersNoResultsValueToJson( + GetTopFiltersNoResultsValue instance) => + { + 'attribute': instance.attribute, + 'operator': instance.operator, + 'value': instance.value, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_values.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_values.dart new file mode 100644 index 0000000000..89e04fc4c5 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_values.dart @@ -0,0 +1,44 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_analytics/src/model/get_top_filters_no_results_value.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_top_filters_no_results_values.g.dart'; + +@JsonSerializable() +final class GetTopFiltersNoResultsValues { + /// Returns a new [GetTopFiltersNoResultsValues] instance. + const GetTopFiltersNoResultsValues({ + required this.count, + required this.values, + }); + + /// Number of occurrences. + @JsonKey(name: r'count') + final int count; + + /// Filters with no results. + @JsonKey(name: r'values') + final List values; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetTopFiltersNoResultsValues && + other.count == count && + other.values == values; + + @override + int get hashCode => count.hashCode + values.hashCode; + + factory GetTopFiltersNoResultsValues.fromJson(Map json) => + _$GetTopFiltersNoResultsValuesFromJson(json); + + Map toJson() => _$GetTopFiltersNoResultsValuesToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_values.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_values.g.dart new file mode 100644 index 0000000000..3a6f78db45 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_top_filters_no_results_values.g.dart @@ -0,0 +1,33 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_top_filters_no_results_values.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetTopFiltersNoResultsValues _$GetTopFiltersNoResultsValuesFromJson( + Map json) => + $checkedCreate( + 'GetTopFiltersNoResultsValues', + json, + ($checkedConvert) { + final val = GetTopFiltersNoResultsValues( + count: $checkedConvert('count', (v) => v as int), + values: $checkedConvert( + 'values', + (v) => (v as List) + .map((e) => GetTopFiltersNoResultsValue.fromJson( + e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$GetTopFiltersNoResultsValuesToJson( + GetTopFiltersNoResultsValues instance) => + { + 'count': instance.count, + 'values': instance.values.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_users_count_response.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_users_count_response.dart new file mode 100644 index 0000000000..dfcd34381e --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_users_count_response.dart @@ -0,0 +1,44 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_analytics/src/model/user_with_date.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_users_count_response.g.dart'; + +@JsonSerializable() +final class GetUsersCountResponse { + /// Returns a new [GetUsersCountResponse] instance. + const GetUsersCountResponse({ + required this.count, + required this.dates, + }); + + /// Number of occurrences. + @JsonKey(name: r'count') + final int count; + + /// User count. + @JsonKey(name: r'dates') + final List dates; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetUsersCountResponse && + other.count == count && + other.dates == dates; + + @override + int get hashCode => count.hashCode + dates.hashCode; + + factory GetUsersCountResponse.fromJson(Map json) => + _$GetUsersCountResponseFromJson(json); + + Map toJson() => _$GetUsersCountResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_users_count_response.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_users_count_response.g.dart new file mode 100644 index 0000000000..52e794afa8 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/get_users_count_response.g.dart @@ -0,0 +1,32 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_users_count_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetUsersCountResponse _$GetUsersCountResponseFromJson( + Map json) => + $checkedCreate( + 'GetUsersCountResponse', + json, + ($checkedConvert) { + final val = GetUsersCountResponse( + count: $checkedConvert('count', (v) => v as int), + dates: $checkedConvert( + 'dates', + (v) => (v as List) + .map((e) => UserWithDate.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$GetUsersCountResponseToJson( + GetUsersCountResponse instance) => + { + 'count': instance.count, + 'dates': instance.dates.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/no_click_rate_event.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/no_click_rate_event.dart new file mode 100644 index 0000000000..b223293001 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/no_click_rate_event.dart @@ -0,0 +1,58 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'no_click_rate_event.g.dart'; + +@JsonSerializable() +final class NoClickRateEvent { + /// Returns a new [NoClickRateEvent] instance. + const NoClickRateEvent({ + required this.rate, + required this.count, + required this.noClickCount, + required this.date, + }); + + /// [Click-through rate (CTR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate). + // minimum: 0 + // maximum: 1 + @JsonKey(name: r'rate') + final double rate; + + /// Number of tracked _and_ untracked searches (where the `clickAnalytics` parameter isn't `true`). + @JsonKey(name: r'count') + final int count; + + /// Number of click events. + @JsonKey(name: r'noClickCount') + final int noClickCount; + + /// Date of the event in the format YYYY-MM-DD. + @JsonKey(name: r'date') + final String date; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NoClickRateEvent && + other.rate == rate && + other.count == count && + other.noClickCount == noClickCount && + other.date == date; + + @override + int get hashCode => + rate.hashCode + count.hashCode + noClickCount.hashCode + date.hashCode; + + factory NoClickRateEvent.fromJson(Map json) => + _$NoClickRateEventFromJson(json); + + Map toJson() => _$NoClickRateEventToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/no_click_rate_event.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/no_click_rate_event.g.dart new file mode 100644 index 0000000000..fec5ace54b --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/no_click_rate_event.g.dart @@ -0,0 +1,30 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'no_click_rate_event.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +NoClickRateEvent _$NoClickRateEventFromJson(Map json) => + $checkedCreate( + 'NoClickRateEvent', + json, + ($checkedConvert) { + final val = NoClickRateEvent( + rate: $checkedConvert('rate', (v) => (v as num).toDouble()), + count: $checkedConvert('count', (v) => v as int), + noClickCount: $checkedConvert('noClickCount', (v) => v as int), + date: $checkedConvert('date', (v) => v as String), + ); + return val; + }, + ); + +Map _$NoClickRateEventToJson(NoClickRateEvent instance) => + { + 'rate': instance.rate, + 'count': instance.count, + 'noClickCount': instance.noClickCount, + 'date': instance.date, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/no_results_rate_event.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/no_results_rate_event.dart new file mode 100644 index 0000000000..1f275dc924 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/no_results_rate_event.dart @@ -0,0 +1,58 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'no_results_rate_event.g.dart'; + +@JsonSerializable() +final class NoResultsRateEvent { + /// Returns a new [NoResultsRateEvent] instance. + const NoResultsRateEvent({ + required this.date, + required this.noResultCount, + required this.count, + required this.rate, + }); + + /// Date of the event in the format YYYY-MM-DD. + @JsonKey(name: r'date') + final String date; + + /// Number of occurences. + @JsonKey(name: r'noResultCount') + final int noResultCount; + + /// Number of tracked _and_ untracked searches (where the `clickAnalytics` parameter isn't `true`). + @JsonKey(name: r'count') + final int count; + + /// [Click-through rate (CTR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate). + // minimum: 0 + // maximum: 1 + @JsonKey(name: r'rate') + final double rate; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NoResultsRateEvent && + other.date == date && + other.noResultCount == noResultCount && + other.count == count && + other.rate == rate; + + @override + int get hashCode => + date.hashCode + noResultCount.hashCode + count.hashCode + rate.hashCode; + + factory NoResultsRateEvent.fromJson(Map json) => + _$NoResultsRateEventFromJson(json); + + Map toJson() => _$NoResultsRateEventToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/no_results_rate_event.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/no_results_rate_event.g.dart new file mode 100644 index 0000000000..a2f8d41091 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/no_results_rate_event.g.dart @@ -0,0 +1,30 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'no_results_rate_event.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +NoResultsRateEvent _$NoResultsRateEventFromJson(Map json) => + $checkedCreate( + 'NoResultsRateEvent', + json, + ($checkedConvert) { + final val = NoResultsRateEvent( + date: $checkedConvert('date', (v) => v as String), + noResultCount: $checkedConvert('noResultCount', (v) => v as int), + count: $checkedConvert('count', (v) => v as int), + rate: $checkedConvert('rate', (v) => (v as num).toDouble()), + ); + return val; + }, + ); + +Map _$NoResultsRateEventToJson(NoResultsRateEvent instance) => + { + 'date': instance.date, + 'noResultCount': instance.noResultCount, + 'count': instance.count, + 'rate': instance.rate, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/order_by.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/order_by.dart new file mode 100644 index 0000000000..3774ff0d68 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/order_by.dart @@ -0,0 +1,34 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Method for ordering results. `clickThroughRate`, `conversionRate` and `averageClickPosition` are only available if the `clickAnalytics` parameter is `true`. +@JsonEnum(valueField: 'raw') +enum OrderBy { + /// Method for ordering results. `clickThroughRate`, `conversionRate` and `averageClickPosition` are only available if the `clickAnalytics` parameter is `true`. + searchCount(r'searchCount'), + + /// Method for ordering results. `clickThroughRate`, `conversionRate` and `averageClickPosition` are only available if the `clickAnalytics` parameter is `true`. + clickThroughRate(r'clickThroughRate'), + + /// Method for ordering results. `clickThroughRate`, `conversionRate` and `averageClickPosition` are only available if the `clickAnalytics` parameter is `true`. + conversionRate(r'conversionRate'), + + /// Method for ordering results. `clickThroughRate`, `conversionRate` and `averageClickPosition` are only available if the `clickAnalytics` parameter is `true`. + averageClickPosition(r'averageClickPosition'); + + const OrderBy(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static OrderBy fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_event.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_event.dart new file mode 100644 index 0000000000..3ae14f6c0d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_event.dart @@ -0,0 +1,41 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'search_event.g.dart'; + +@JsonSerializable() +final class SearchEvent { + /// Returns a new [SearchEvent] instance. + const SearchEvent({ + required this.date, + required this.count, + }); + + /// Date of the event in the format YYYY-MM-DD. + @JsonKey(name: r'date') + final String date; + + /// Number of occurrences. + @JsonKey(name: r'count') + final int count; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SearchEvent && other.date == date && other.count == count; + + @override + int get hashCode => date.hashCode + count.hashCode; + + factory SearchEvent.fromJson(Map json) => + _$SearchEventFromJson(json); + + Map toJson() => _$SearchEventToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_event.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_event.g.dart new file mode 100644 index 0000000000..fa0e3bde1b --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_event.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'search_event.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SearchEvent _$SearchEventFromJson(Map json) => $checkedCreate( + 'SearchEvent', + json, + ($checkedConvert) { + final val = SearchEvent( + date: $checkedConvert('date', (v) => v as String), + count: $checkedConvert('count', (v) => v as int), + ); + return val; + }, + ); + +Map _$SearchEventToJson(SearchEvent instance) => + { + 'date': instance.date, + 'count': instance.count, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_no_click_event.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_no_click_event.dart new file mode 100644 index 0000000000..2b9c27830e --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_no_click_event.dart @@ -0,0 +1,50 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'search_no_click_event.g.dart'; + +@JsonSerializable() +final class SearchNoClickEvent { + /// Returns a new [SearchNoClickEvent] instance. + const SearchNoClickEvent({ + required this.search, + required this.count, + required this.withFilterCount, + }); + + /// User query. + @JsonKey(name: r'search') + final String search; + + /// Number of occurrences. + @JsonKey(name: r'count') + final int count; + + /// Number of occurrences. + @JsonKey(name: r'withFilterCount') + final int withFilterCount; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SearchNoClickEvent && + other.search == search && + other.count == count && + other.withFilterCount == withFilterCount; + + @override + int get hashCode => + search.hashCode + count.hashCode + withFilterCount.hashCode; + + factory SearchNoClickEvent.fromJson(Map json) => + _$SearchNoClickEventFromJson(json); + + Map toJson() => _$SearchNoClickEventToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_no_click_event.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_no_click_event.g.dart new file mode 100644 index 0000000000..e4e852b39a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_no_click_event.g.dart @@ -0,0 +1,28 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'search_no_click_event.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SearchNoClickEvent _$SearchNoClickEventFromJson(Map json) => + $checkedCreate( + 'SearchNoClickEvent', + json, + ($checkedConvert) { + final val = SearchNoClickEvent( + search: $checkedConvert('search', (v) => v as String), + count: $checkedConvert('count', (v) => v as int), + withFilterCount: $checkedConvert('withFilterCount', (v) => v as int), + ); + return val; + }, + ); + +Map _$SearchNoClickEventToJson(SearchNoClickEvent instance) => + { + 'search': instance.search, + 'count': instance.count, + 'withFilterCount': instance.withFilterCount, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_no_result_event.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_no_result_event.dart new file mode 100644 index 0000000000..fe5b2d43ef --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_no_result_event.dart @@ -0,0 +1,49 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'search_no_result_event.g.dart'; + +@JsonSerializable() +final class SearchNoResultEvent { + /// Returns a new [SearchNoResultEvent] instance. + const SearchNoResultEvent({ + required this.search, + required this.count, + required this.nbHits, + }); + + /// User query. + @JsonKey(name: r'search') + final String search; + + /// Number of occurrences. + @JsonKey(name: r'count') + final int count; + + /// Number of hits the search query matched. + @JsonKey(name: r'nbHits') + final int nbHits; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SearchNoResultEvent && + other.search == search && + other.count == count && + other.nbHits == nbHits; + + @override + int get hashCode => search.hashCode + count.hashCode + nbHits.hashCode; + + factory SearchNoResultEvent.fromJson(Map json) => + _$SearchNoResultEventFromJson(json); + + Map toJson() => _$SearchNoResultEventToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_no_result_event.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_no_result_event.g.dart new file mode 100644 index 0000000000..e2faa42db2 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/search_no_result_event.g.dart @@ -0,0 +1,29 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'search_no_result_event.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SearchNoResultEvent _$SearchNoResultEventFromJson(Map json) => + $checkedCreate( + 'SearchNoResultEvent', + json, + ($checkedConvert) { + final val = SearchNoResultEvent( + search: $checkedConvert('search', (v) => v as String), + count: $checkedConvert('count', (v) => v as int), + nbHits: $checkedConvert('nbHits', (v) => v as int), + ); + return val; + }, + ); + +Map _$SearchNoResultEventToJson( + SearchNoResultEvent instance) => + { + 'search': instance.search, + 'count': instance.count, + 'nbHits': instance.nbHits, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_country.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_country.dart new file mode 100644 index 0000000000..8d9ff79237 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_country.dart @@ -0,0 +1,41 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'top_country.g.dart'; + +@JsonSerializable() +final class TopCountry { + /// Returns a new [TopCountry] instance. + const TopCountry({ + required this.country, + required this.count, + }); + + /// Country. + @JsonKey(name: r'country') + final String country; + + /// Number of occurrences. + @JsonKey(name: r'count') + final int count; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TopCountry && other.country == country && other.count == count; + + @override + int get hashCode => country.hashCode + count.hashCode; + + factory TopCountry.fromJson(Map json) => + _$TopCountryFromJson(json); + + Map toJson() => _$TopCountryToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_country.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_country.g.dart new file mode 100644 index 0000000000..f3581b9e4c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_country.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'top_country.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TopCountry _$TopCountryFromJson(Map json) => $checkedCreate( + 'TopCountry', + json, + ($checkedConvert) { + final val = TopCountry( + country: $checkedConvert('country', (v) => v as String), + count: $checkedConvert('count', (v) => v as int), + ); + return val; + }, + ); + +Map _$TopCountryToJson(TopCountry instance) => + { + 'country': instance.country, + 'count': instance.count, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hit.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hit.dart new file mode 100644 index 0000000000..fc5e188487 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hit.dart @@ -0,0 +1,40 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'top_hit.g.dart'; + +@JsonSerializable() +final class TopHit { + /// Returns a new [TopHit] instance. + const TopHit({ + required this.hit, + required this.count, + }); + + /// Hit. + @JsonKey(name: r'hit') + final String hit; + + /// Number of occurrences. + @JsonKey(name: r'count') + final int count; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TopHit && other.hit == hit && other.count == count; + + @override + int get hashCode => hit.hashCode + count.hashCode; + + factory TopHit.fromJson(Map json) => _$TopHitFromJson(json); + + Map toJson() => _$TopHitToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hit.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hit.g.dart new file mode 100644 index 0000000000..27c356d1b1 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hit.g.dart @@ -0,0 +1,24 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'top_hit.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TopHit _$TopHitFromJson(Map json) => $checkedCreate( + 'TopHit', + json, + ($checkedConvert) { + final val = TopHit( + hit: $checkedConvert('hit', (v) => v as String), + count: $checkedConvert('count', (v) => v as int), + ); + return val; + }, + ); + +Map _$TopHitToJson(TopHit instance) => { + 'hit': instance.hit, + 'count': instance.count, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hit_with_analytics.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hit_with_analytics.dart new file mode 100644 index 0000000000..0f0b54592a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hit_with_analytics.dart @@ -0,0 +1,82 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'top_hit_with_analytics.g.dart'; + +@JsonSerializable() +final class TopHitWithAnalytics { + /// Returns a new [TopHitWithAnalytics] instance. + const TopHitWithAnalytics({ + required this.hit, + required this.count, + required this.clickThroughRate, + required this.conversionRate, + required this.trackedSearchCount, + required this.clickCount, + required this.conversionCount, + }); + + /// Hit. + @JsonKey(name: r'hit') + final String hit; + + /// Number of occurrences. + @JsonKey(name: r'count') + final int count; + + /// [Click-through rate (CTR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate). + // minimum: 0 + // maximum: 1 + @JsonKey(name: r'clickThroughRate') + final double clickThroughRate; + + /// [Conversion rate (CR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#conversion-rate). + @JsonKey(name: r'conversionRate') + final double conversionRate; + + /// Number of tracked searches. This is the number of search requests where the `clickAnalytics` parameter is `true`. + @JsonKey(name: r'trackedSearchCount') + final int trackedSearchCount; + + /// Number of click events. + @JsonKey(name: r'clickCount') + final int clickCount; + + /// Number of converted clicks. + @JsonKey(name: r'conversionCount') + final int conversionCount; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TopHitWithAnalytics && + other.hit == hit && + other.count == count && + other.clickThroughRate == clickThroughRate && + other.conversionRate == conversionRate && + other.trackedSearchCount == trackedSearchCount && + other.clickCount == clickCount && + other.conversionCount == conversionCount; + + @override + int get hashCode => + hit.hashCode + + count.hashCode + + clickThroughRate.hashCode + + conversionRate.hashCode + + trackedSearchCount.hashCode + + clickCount.hashCode + + conversionCount.hashCode; + + factory TopHitWithAnalytics.fromJson(Map json) => + _$TopHitWithAnalyticsFromJson(json); + + Map toJson() => _$TopHitWithAnalyticsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hit_with_analytics.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hit_with_analytics.g.dart new file mode 100644 index 0000000000..fc1c393c17 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hit_with_analytics.g.dart @@ -0,0 +1,40 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'top_hit_with_analytics.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TopHitWithAnalytics _$TopHitWithAnalyticsFromJson(Map json) => + $checkedCreate( + 'TopHitWithAnalytics', + json, + ($checkedConvert) { + final val = TopHitWithAnalytics( + hit: $checkedConvert('hit', (v) => v as String), + count: $checkedConvert('count', (v) => v as int), + clickThroughRate: + $checkedConvert('clickThroughRate', (v) => (v as num).toDouble()), + conversionRate: + $checkedConvert('conversionRate', (v) => (v as num).toDouble()), + trackedSearchCount: + $checkedConvert('trackedSearchCount', (v) => v as int), + clickCount: $checkedConvert('clickCount', (v) => v as int), + conversionCount: $checkedConvert('conversionCount', (v) => v as int), + ); + return val; + }, + ); + +Map _$TopHitWithAnalyticsToJson( + TopHitWithAnalytics instance) => + { + 'hit': instance.hit, + 'count': instance.count, + 'clickThroughRate': instance.clickThroughRate, + 'conversionRate': instance.conversionRate, + 'trackedSearchCount': instance.trackedSearchCount, + 'clickCount': instance.clickCount, + 'conversionCount': instance.conversionCount, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hits_response.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hits_response.dart new file mode 100644 index 0000000000..ac069f99ee --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hits_response.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_analytics/src/model/top_hit.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'top_hits_response.g.dart'; + +@JsonSerializable() +final class TopHitsResponse { + /// Returns a new [TopHitsResponse] instance. + const TopHitsResponse({ + required this.hits, + }); + + /// Top hits. + @JsonKey(name: r'hits') + final List hits; + + @override + bool operator ==(Object other) => + identical(this, other) || other is TopHitsResponse && other.hits == hits; + + @override + int get hashCode => hits.hashCode; + + factory TopHitsResponse.fromJson(Map json) => + _$TopHitsResponseFromJson(json); + + Map toJson() => _$TopHitsResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hits_response.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hits_response.g.dart new file mode 100644 index 0000000000..4aae2b7c94 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hits_response.g.dart @@ -0,0 +1,28 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'top_hits_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TopHitsResponse _$TopHitsResponseFromJson(Map json) => + $checkedCreate( + 'TopHitsResponse', + json, + ($checkedConvert) { + final val = TopHitsResponse( + hits: $checkedConvert( + 'hits', + (v) => (v as List) + .map((e) => TopHit.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$TopHitsResponseToJson(TopHitsResponse instance) => + { + 'hits': instance.hits.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hits_response_with_analytics.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hits_response_with_analytics.dart new file mode 100644 index 0000000000..01b3b007cf --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hits_response_with_analytics.dart @@ -0,0 +1,37 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_analytics/src/model/top_hit_with_analytics.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'top_hits_response_with_analytics.g.dart'; + +@JsonSerializable() +final class TopHitsResponseWithAnalytics { + /// Returns a new [TopHitsResponseWithAnalytics] instance. + const TopHitsResponseWithAnalytics({ + required this.hits, + }); + + /// Top hits. + @JsonKey(name: r'hits') + final List hits; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TopHitsResponseWithAnalytics && other.hits == hits; + + @override + int get hashCode => hits.hashCode; + + factory TopHitsResponseWithAnalytics.fromJson(Map json) => + _$TopHitsResponseWithAnalyticsFromJson(json); + + Map toJson() => _$TopHitsResponseWithAnalyticsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hits_response_with_analytics.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hits_response_with_analytics.g.dart new file mode 100644 index 0000000000..05a18c0537 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_hits_response_with_analytics.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'top_hits_response_with_analytics.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TopHitsResponseWithAnalytics _$TopHitsResponseWithAnalyticsFromJson( + Map json) => + $checkedCreate( + 'TopHitsResponseWithAnalytics', + json, + ($checkedConvert) { + final val = TopHitsResponseWithAnalytics( + hits: $checkedConvert( + 'hits', + (v) => (v as List) + .map((e) => + TopHitWithAnalytics.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$TopHitsResponseWithAnalyticsToJson( + TopHitsResponseWithAnalytics instance) => + { + 'hits': instance.hits.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_search.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_search.dart new file mode 100644 index 0000000000..e5211eab68 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_search.dart @@ -0,0 +1,49 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'top_search.g.dart'; + +@JsonSerializable() +final class TopSearch { + /// Returns a new [TopSearch] instance. + const TopSearch({ + required this.search, + required this.count, + required this.nbHits, + }); + + /// User query. + @JsonKey(name: r'search') + final String search; + + /// Number of tracked _and_ untracked searches (where the `clickAnalytics` parameter isn't `true`). + @JsonKey(name: r'count') + final int count; + + /// Number of hits the search query matched. + @JsonKey(name: r'nbHits') + final int nbHits; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TopSearch && + other.search == search && + other.count == count && + other.nbHits == nbHits; + + @override + int get hashCode => search.hashCode + count.hashCode + nbHits.hashCode; + + factory TopSearch.fromJson(Map json) => + _$TopSearchFromJson(json); + + Map toJson() => _$TopSearchToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_search.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_search.g.dart new file mode 100644 index 0000000000..36f3b42110 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_search.g.dart @@ -0,0 +1,26 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'top_search.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TopSearch _$TopSearchFromJson(Map json) => $checkedCreate( + 'TopSearch', + json, + ($checkedConvert) { + final val = TopSearch( + search: $checkedConvert('search', (v) => v as String), + count: $checkedConvert('count', (v) => v as int), + nbHits: $checkedConvert('nbHits', (v) => v as int), + ); + return val; + }, + ); + +Map _$TopSearchToJson(TopSearch instance) => { + 'search': instance.search, + 'count': instance.count, + 'nbHits': instance.nbHits, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_search_with_analytics.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_search_with_analytics.dart new file mode 100644 index 0000000000..ee0879ffad --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_search_with_analytics.dart @@ -0,0 +1,96 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'top_search_with_analytics.g.dart'; + +@JsonSerializable() +final class TopSearchWithAnalytics { + /// Returns a new [TopSearchWithAnalytics] instance. + const TopSearchWithAnalytics({ + required this.search, + required this.count, + required this.clickThroughRate, + required this.averageClickPosition, + required this.conversionRate, + required this.trackedSearchCount, + required this.clickCount, + required this.conversionCount, + required this.nbHits, + }); + + /// User query. + @JsonKey(name: r'search') + final String search; + + /// Number of tracked _and_ untracked searches (where the `clickAnalytics` parameter isn't `true`). + @JsonKey(name: r'count') + final int count; + + /// [Click-through rate (CTR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate). + // minimum: 0 + // maximum: 1 + @JsonKey(name: r'clickThroughRate') + final double clickThroughRate; + + /// Average [position](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-position) of clicked search result. + @JsonKey(name: r'averageClickPosition') + final int averageClickPosition; + + /// [Conversion rate (CR)](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#conversion-rate). + @JsonKey(name: r'conversionRate') + final double conversionRate; + + /// Number of tracked searches. This is the number of search requests where the `clickAnalytics` parameter is `true`. + @JsonKey(name: r'trackedSearchCount') + final int trackedSearchCount; + + /// Number of click events. + @JsonKey(name: r'clickCount') + final int clickCount; + + /// Number of converted clicks. + @JsonKey(name: r'conversionCount') + final int conversionCount; + + /// Number of hits the search query matched. + @JsonKey(name: r'nbHits') + final int nbHits; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TopSearchWithAnalytics && + other.search == search && + other.count == count && + other.clickThroughRate == clickThroughRate && + other.averageClickPosition == averageClickPosition && + other.conversionRate == conversionRate && + other.trackedSearchCount == trackedSearchCount && + other.clickCount == clickCount && + other.conversionCount == conversionCount && + other.nbHits == nbHits; + + @override + int get hashCode => + search.hashCode + + count.hashCode + + clickThroughRate.hashCode + + averageClickPosition.hashCode + + conversionRate.hashCode + + trackedSearchCount.hashCode + + clickCount.hashCode + + conversionCount.hashCode + + nbHits.hashCode; + + factory TopSearchWithAnalytics.fromJson(Map json) => + _$TopSearchWithAnalyticsFromJson(json); + + Map toJson() => _$TopSearchWithAnalyticsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_search_with_analytics.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_search_with_analytics.g.dart new file mode 100644 index 0000000000..36949418ba --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_search_with_analytics.g.dart @@ -0,0 +1,46 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'top_search_with_analytics.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TopSearchWithAnalytics _$TopSearchWithAnalyticsFromJson( + Map json) => + $checkedCreate( + 'TopSearchWithAnalytics', + json, + ($checkedConvert) { + final val = TopSearchWithAnalytics( + search: $checkedConvert('search', (v) => v as String), + count: $checkedConvert('count', (v) => v as int), + clickThroughRate: + $checkedConvert('clickThroughRate', (v) => (v as num).toDouble()), + averageClickPosition: + $checkedConvert('averageClickPosition', (v) => v as int), + conversionRate: + $checkedConvert('conversionRate', (v) => (v as num).toDouble()), + trackedSearchCount: + $checkedConvert('trackedSearchCount', (v) => v as int), + clickCount: $checkedConvert('clickCount', (v) => v as int), + conversionCount: $checkedConvert('conversionCount', (v) => v as int), + nbHits: $checkedConvert('nbHits', (v) => v as int), + ); + return val; + }, + ); + +Map _$TopSearchWithAnalyticsToJson( + TopSearchWithAnalytics instance) => + { + 'search': instance.search, + 'count': instance.count, + 'clickThroughRate': instance.clickThroughRate, + 'averageClickPosition': instance.averageClickPosition, + 'conversionRate': instance.conversionRate, + 'trackedSearchCount': instance.trackedSearchCount, + 'clickCount': instance.clickCount, + 'conversionCount': instance.conversionCount, + 'nbHits': instance.nbHits, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_searches_response.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_searches_response.dart new file mode 100644 index 0000000000..152a2e82bc --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_searches_response.dart @@ -0,0 +1,37 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_analytics/src/model/top_search.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'top_searches_response.g.dart'; + +@JsonSerializable() +final class TopSearchesResponse { + /// Returns a new [TopSearchesResponse] instance. + const TopSearchesResponse({ + required this.searches, + }); + + /// Top searches with their hits count. + @JsonKey(name: r'searches') + final List searches; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TopSearchesResponse && other.searches == searches; + + @override + int get hashCode => searches.hashCode; + + factory TopSearchesResponse.fromJson(Map json) => + _$TopSearchesResponseFromJson(json); + + Map toJson() => _$TopSearchesResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_searches_response.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_searches_response.g.dart new file mode 100644 index 0000000000..9b56a7b758 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_searches_response.g.dart @@ -0,0 +1,29 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'top_searches_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TopSearchesResponse _$TopSearchesResponseFromJson(Map json) => + $checkedCreate( + 'TopSearchesResponse', + json, + ($checkedConvert) { + final val = TopSearchesResponse( + searches: $checkedConvert( + 'searches', + (v) => (v as List) + .map((e) => TopSearch.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$TopSearchesResponseToJson( + TopSearchesResponse instance) => + { + 'searches': instance.searches.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_searches_response_with_analytics.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_searches_response_with_analytics.dart new file mode 100644 index 0000000000..4de984c06e --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_searches_response_with_analytics.dart @@ -0,0 +1,39 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_analytics/src/model/top_search_with_analytics.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'top_searches_response_with_analytics.g.dart'; + +@JsonSerializable() +final class TopSearchesResponseWithAnalytics { + /// Returns a new [TopSearchesResponseWithAnalytics] instance. + const TopSearchesResponseWithAnalytics({ + required this.searches, + }); + + /// Top searches with their hits count and analytics. + @JsonKey(name: r'searches') + final List searches; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TopSearchesResponseWithAnalytics && other.searches == searches; + + @override + int get hashCode => searches.hashCode; + + factory TopSearchesResponseWithAnalytics.fromJson( + Map json) => + _$TopSearchesResponseWithAnalyticsFromJson(json); + + Map toJson() => + _$TopSearchesResponseWithAnalyticsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_searches_response_with_analytics.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_searches_response_with_analytics.g.dart new file mode 100644 index 0000000000..a3fe77b097 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/top_searches_response_with_analytics.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'top_searches_response_with_analytics.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TopSearchesResponseWithAnalytics _$TopSearchesResponseWithAnalyticsFromJson( + Map json) => + $checkedCreate( + 'TopSearchesResponseWithAnalytics', + json, + ($checkedConvert) { + final val = TopSearchesResponseWithAnalytics( + searches: $checkedConvert( + 'searches', + (v) => (v as List) + .map((e) => TopSearchWithAnalytics.fromJson( + e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$TopSearchesResponseWithAnalyticsToJson( + TopSearchesResponseWithAnalytics instance) => + { + 'searches': instance.searches.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/user_with_date.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/user_with_date.dart new file mode 100644 index 0000000000..4f5d3991ea --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/user_with_date.dart @@ -0,0 +1,41 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'user_with_date.g.dart'; + +@JsonSerializable() +final class UserWithDate { + /// Returns a new [UserWithDate] instance. + const UserWithDate({ + required this.date, + required this.count, + }); + + /// Date of the event in the format YYYY-MM-DD. + @JsonKey(name: r'date') + final String date; + + /// Number of occurrences. + @JsonKey(name: r'count') + final int count; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is UserWithDate && other.date == date && other.count == count; + + @override + int get hashCode => date.hashCode + count.hashCode; + + factory UserWithDate.fromJson(Map json) => + _$UserWithDateFromJson(json); + + Map toJson() => _$UserWithDateToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/user_with_date.g.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/user_with_date.g.dart new file mode 100644 index 0000000000..67f994a9bc --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/model/user_with_date.g.dart @@ -0,0 +1,26 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'user_with_date.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +UserWithDate _$UserWithDateFromJson(Map json) => + $checkedCreate( + 'UserWithDate', + json, + ($checkedConvert) { + final val = UserWithDate( + date: $checkedConvert('date', (v) => v as String), + count: $checkedConvert('count', (v) => v as int), + ); + return val; + }, + ); + +Map _$UserWithDateToJson(UserWithDate instance) => + { + 'date': instance.date, + 'count': instance.count, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/version.dart b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/version.dart new file mode 100644 index 0000000000..03e065a0a8 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/lib/src/version.dart @@ -0,0 +1,2 @@ +/// Current package version +const packageVersion = '0.1.2'; diff --git a/clients/algoliasearch-client-dart/packages/client_analytics/pubspec.yaml b/clients/algoliasearch-client-dart/packages/client_analytics/pubspec.yaml new file mode 100644 index 0000000000..2dd61e2734 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_analytics/pubspec.yaml @@ -0,0 +1,24 @@ +name: algolia_client_analytics +version: 0.1.2 +description: A sub-package of the AlgoliaSearch library, offering analytics-specific functionalities for enhanced search and discovery in Dart/Flutter apps. +homepage: https://www.algolia.com/doc/ +repository: https://github.com/algolia/algoliasearch-client-dart/tree/main/packages/client_analytics +topics: + - search + - discovery + +environment: + sdk: '>=3.0.0 <4.0.0' + +dependencies: + # Pinning versions until the API stabilizes. + algolia_client_core: 0.1.1+4 + json_annotation: ^4.8.1 + collection: ^1.17.1 + +dev_dependencies: + build_runner: ^2.4.4 + json_serializable: ^6.7.0 + lints: ^2.1.1 + logging: ^1.2.0 + test: ^1.24.3 diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/build.yaml b/clients/algoliasearch-client-dart/packages/client_ingestion/build.yaml new file mode 100644 index 0000000000..6d71b406a7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/build.yaml @@ -0,0 +1,14 @@ +targets: + $default: + builders: + json_serializable: + options: + any_map: false + checked: true + create_factory: true + create_to_json: true + disallow_unrecognized_keys: false + explicit_to_json: true + field_rename: none + ignore_unannotated: false + include_if_null: false diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/algolia_client_ingestion.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/algolia_client_ingestion.dart new file mode 100644 index 0000000000..09d9ee7b2b --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/algolia_client_ingestion.dart @@ -0,0 +1,102 @@ +// A sub-package of the AlgoliaSearch library, offering ingestion-specific functionalities for enhanced search and discovery in Dart/Flutter apps. +library algolia_client_ingestion; + +export 'package:algolia_client_core/algolia_client_core.dart'; + +export 'src/api/ingestion_client.dart'; + +export 'src/model/action_type.dart'; +export 'src/model/auth_api_key.dart'; +export 'src/model/auth_api_key_partial.dart'; +export 'src/model/auth_algolia.dart'; +export 'src/model/auth_algolia_partial.dart'; +export 'src/model/auth_basic.dart'; +export 'src/model/auth_basic_partial.dart'; +export 'src/model/auth_google_service_account.dart'; +export 'src/model/auth_google_service_account_partial.dart'; +export 'src/model/auth_o_auth.dart'; +export 'src/model/auth_o_auth_partial.dart'; +export 'src/model/authentication.dart'; +export 'src/model/authentication_create.dart'; +export 'src/model/authentication_create_response.dart'; +export 'src/model/authentication_search.dart'; +export 'src/model/authentication_sort_keys.dart'; +export 'src/model/authentication_type.dart'; +export 'src/model/authentication_update.dart'; +export 'src/model/authentication_update_response.dart'; +export 'src/model/big_commerce_channel.dart'; +export 'src/model/big_query_data_type.dart'; +export 'src/model/delete_response.dart'; +export 'src/model/destination.dart'; +export 'src/model/destination_create.dart'; +export 'src/model/destination_create_response.dart'; +export 'src/model/destination_index_name.dart'; +export 'src/model/destination_index_prefix.dart'; +export 'src/model/destination_search.dart'; +export 'src/model/destination_sort_keys.dart'; +export 'src/model/destination_type.dart'; +export 'src/model/destination_update.dart'; +export 'src/model/destination_update_response.dart'; +export 'src/model/docker_image_type.dart'; +export 'src/model/docker_registry.dart'; +export 'src/model/error_base.dart'; +export 'src/model/event.dart'; +export 'src/model/event_sort_keys.dart'; +export 'src/model/event_status.dart'; +export 'src/model/event_type.dart'; +export 'src/model/list_authentications_response.dart'; +export 'src/model/list_destinations_response.dart'; +export 'src/model/list_events_response.dart'; +export 'src/model/list_sources_response.dart'; +export 'src/model/list_tasks_response.dart'; +export 'src/model/mapping_type_csv.dart'; +export 'src/model/method_type.dart'; +export 'src/model/on_demand_date_utils_input.dart'; +export 'src/model/on_demand_trigger.dart'; +export 'src/model/on_demand_trigger_input.dart'; +export 'src/model/on_demand_trigger_type.dart'; +export 'src/model/order_keys.dart'; +export 'src/model/pagination.dart'; +export 'src/model/platform.dart'; +export 'src/model/platform_none.dart'; +export 'src/model/run.dart'; +export 'src/model/run_list_response.dart'; +export 'src/model/run_outcome.dart'; +export 'src/model/run_progress.dart'; +export 'src/model/run_reason_code.dart'; +export 'src/model/run_response.dart'; +export 'src/model/run_sort_keys.dart'; +export 'src/model/run_status.dart'; +export 'src/model/run_type.dart'; +export 'src/model/schedule_date_utils_input.dart'; +export 'src/model/schedule_trigger.dart'; +export 'src/model/schedule_trigger_input.dart'; +export 'src/model/schedule_trigger_type.dart'; +export 'src/model/source.dart'; +export 'src/model/source_big_commerce.dart'; +export 'src/model/source_big_query.dart'; +export 'src/model/source_csv.dart'; +export 'src/model/source_commercetools.dart'; +export 'src/model/source_create.dart'; +export 'src/model/source_create_response.dart'; +export 'src/model/source_docker.dart'; +export 'src/model/source_json.dart'; +export 'src/model/source_search.dart'; +export 'src/model/source_sort_keys.dart'; +export 'src/model/source_type.dart'; +export 'src/model/source_update.dart'; +export 'src/model/source_update_commercetools.dart'; +export 'src/model/source_update_response.dart'; +export 'src/model/subscription_trigger.dart'; +export 'src/model/subscription_trigger_type.dart'; +export 'src/model/task.dart'; +export 'src/model/task_create.dart'; +export 'src/model/task_create_response.dart'; +export 'src/model/task_search.dart'; +export 'src/model/task_sort_keys.dart'; +export 'src/model/task_update.dart'; +export 'src/model/task_update_response.dart'; +export 'src/model/trigger_input.dart'; +export 'src/model/trigger_type.dart'; + +export 'src/extension.dart'; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/api/ingestion_client.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/api/ingestion_client.dart new file mode 100644 index 0000000000..46a79b0b65 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/api/ingestion_client.dart @@ -0,0 +1,1268 @@ +// 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. + +import 'package:algolia_client_core/algolia_client_core.dart'; +import 'package:algolia_client_ingestion/src/deserialize.dart'; +import 'package:algolia_client_ingestion/src/version.dart'; + +import 'package:algolia_client_ingestion/src/model/action_type.dart'; +import 'package:algolia_client_ingestion/src/model/authentication.dart'; +import 'package:algolia_client_ingestion/src/model/authentication_create.dart'; +import 'package:algolia_client_ingestion/src/model/authentication_create_response.dart'; +import 'package:algolia_client_ingestion/src/model/authentication_search.dart'; +import 'package:algolia_client_ingestion/src/model/authentication_sort_keys.dart'; +import 'package:algolia_client_ingestion/src/model/authentication_type.dart'; +import 'package:algolia_client_ingestion/src/model/authentication_update.dart'; +import 'package:algolia_client_ingestion/src/model/authentication_update_response.dart'; +import 'package:algolia_client_ingestion/src/model/delete_response.dart'; +import 'package:algolia_client_ingestion/src/model/destination.dart'; +import 'package:algolia_client_ingestion/src/model/destination_create.dart'; +import 'package:algolia_client_ingestion/src/model/destination_create_response.dart'; +import 'package:algolia_client_ingestion/src/model/destination_search.dart'; +import 'package:algolia_client_ingestion/src/model/destination_sort_keys.dart'; +import 'package:algolia_client_ingestion/src/model/destination_type.dart'; +import 'package:algolia_client_ingestion/src/model/destination_update.dart'; +import 'package:algolia_client_ingestion/src/model/destination_update_response.dart'; +import 'package:algolia_client_ingestion/src/model/event.dart'; +import 'package:algolia_client_ingestion/src/model/event_sort_keys.dart'; +import 'package:algolia_client_ingestion/src/model/event_status.dart'; +import 'package:algolia_client_ingestion/src/model/event_type.dart'; +import 'package:algolia_client_ingestion/src/model/list_authentications_response.dart'; +import 'package:algolia_client_ingestion/src/model/list_destinations_response.dart'; +import 'package:algolia_client_ingestion/src/model/list_events_response.dart'; +import 'package:algolia_client_ingestion/src/model/list_sources_response.dart'; +import 'package:algolia_client_ingestion/src/model/list_tasks_response.dart'; +import 'package:algolia_client_ingestion/src/model/order_keys.dart'; +import 'package:algolia_client_ingestion/src/model/run.dart'; +import 'package:algolia_client_ingestion/src/model/run_list_response.dart'; +import 'package:algolia_client_ingestion/src/model/run_response.dart'; +import 'package:algolia_client_ingestion/src/model/run_sort_keys.dart'; +import 'package:algolia_client_ingestion/src/model/run_status.dart'; +import 'package:algolia_client_ingestion/src/model/source.dart'; +import 'package:algolia_client_ingestion/src/model/source_create.dart'; +import 'package:algolia_client_ingestion/src/model/source_create_response.dart'; +import 'package:algolia_client_ingestion/src/model/source_search.dart'; +import 'package:algolia_client_ingestion/src/model/source_sort_keys.dart'; +import 'package:algolia_client_ingestion/src/model/source_type.dart'; +import 'package:algolia_client_ingestion/src/model/source_update.dart'; +import 'package:algolia_client_ingestion/src/model/source_update_response.dart'; +import 'package:algolia_client_ingestion/src/model/task.dart'; +import 'package:algolia_client_ingestion/src/model/task_create.dart'; +import 'package:algolia_client_ingestion/src/model/task_create_response.dart'; +import 'package:algolia_client_ingestion/src/model/task_search.dart'; +import 'package:algolia_client_ingestion/src/model/task_sort_keys.dart'; +import 'package:algolia_client_ingestion/src/model/task_update.dart'; +import 'package:algolia_client_ingestion/src/model/task_update_response.dart'; +import 'package:algolia_client_ingestion/src/model/trigger_type.dart'; + +final class IngestionClient implements ApiClient { + @override + final String apiKey; + + @override + final String appId; + + @override + final ClientOptions options; + + final String region; + + final RetryStrategy _retryStrategy; + + IngestionClient({ + required this.appId, + required this.apiKey, + this.options = const ClientOptions(), + required this.region, + }) : _retryStrategy = RetryStrategy.create( + segment: AgentSegment(value: "Ingestion", version: packageVersion), + appId: appId, + apiKey: apiKey, + options: options, + defaultHosts: () { + final allowedRegions = ['eu', 'us']; + assert( + allowedRegions.contains(region), + '`region` is required and must be one of the following: ${allowedRegions.join(', ')}', + ); + final url = + 'data.{region}.algolia.com'.replaceAll('{region}', region); + return [Host(url: url)]; + }) { + assert(appId.isNotEmpty, '`appId` is missing.'); + assert(apiKey.isNotEmpty, '`apiKey` is missing.'); + } + + /// Create a authentication. + /// Create a authentication. + /// + /// Parameters: + /// * [authenticationCreate] + /// * [requestOptions] additional request configuration. + Future createAuthentication({ + required AuthenticationCreate authenticationCreate, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1/authentications', + body: authenticationCreate.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'AuthenticationCreateResponse', + growable: true, + ); + } + + /// Create a destination. + /// Create a destination. + /// + /// Parameters: + /// * [destinationCreate] + /// * [requestOptions] additional request configuration. + Future createDestination({ + required DestinationCreate destinationCreate, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1/destinations', + body: destinationCreate.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'DestinationCreateResponse', + growable: true, + ); + } + + /// Create a source. + /// Create a source. + /// + /// Parameters: + /// * [sourceCreate] + /// * [requestOptions] additional request configuration. + Future createSource({ + required SourceCreate sourceCreate, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1/sources', + body: sourceCreate.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'SourceCreateResponse', + growable: true, + ); + } + + /// Create a task. + /// Create a task. + /// + /// Parameters: + /// * [taskCreate] + /// * [requestOptions] additional request configuration. + Future createTask({ + required TaskCreate taskCreate, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1/tasks', + body: taskCreate.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'TaskCreateResponse', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [requestOptions] additional request configuration. + Future del({ + required String path, + Map? parameters, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `del`.', + ); + final request = ApiRequest( + method: RequestMethod.delete, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Delete a authentication. + /// Soft delete the authentication of the given authenticationID. + /// + /// Parameters: + /// * [authenticationID] The authentication UUID. + /// * [requestOptions] additional request configuration. + Future deleteAuthentication({ + required String authenticationID, + RequestOptions? requestOptions, + }) async { + assert( + authenticationID.isNotEmpty, + 'Parameter `authenticationID` is required when calling `deleteAuthentication`.', + ); + final request = ApiRequest( + method: RequestMethod.delete, + path: r'/1/authentications/{authenticationID}'.replaceAll( + '{' r'authenticationID' '}', + Uri.encodeComponent(authenticationID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'DeleteResponse', + growable: true, + ); + } + + /// Delete a destination. + /// Soft delete the destination of the given destinationID. + /// + /// Parameters: + /// * [destinationID] The destination UUID. + /// * [requestOptions] additional request configuration. + Future deleteDestination({ + required String destinationID, + RequestOptions? requestOptions, + }) async { + assert( + destinationID.isNotEmpty, + 'Parameter `destinationID` is required when calling `deleteDestination`.', + ); + final request = ApiRequest( + method: RequestMethod.delete, + path: r'/1/destinations/{destinationID}'.replaceAll( + '{' r'destinationID' '}', + Uri.encodeComponent(destinationID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'DeleteResponse', + growable: true, + ); + } + + /// Delete a source. + /// Soft delete the source of the given sourceID. + /// + /// Parameters: + /// * [sourceID] The source UUID. + /// * [requestOptions] additional request configuration. + Future deleteSource({ + required String sourceID, + RequestOptions? requestOptions, + }) async { + assert( + sourceID.isNotEmpty, + 'Parameter `sourceID` is required when calling `deleteSource`.', + ); + final request = ApiRequest( + method: RequestMethod.delete, + path: r'/1/sources/{sourceID}'.replaceAll( + '{' r'sourceID' '}', Uri.encodeComponent(sourceID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'DeleteResponse', + growable: true, + ); + } + + /// Delete a task. + /// Soft delete the task of the given taskID. + /// + /// Parameters: + /// * [taskID] The task UUID. + /// * [requestOptions] additional request configuration. + Future deleteTask({ + required String taskID, + RequestOptions? requestOptions, + }) async { + assert( + taskID.isNotEmpty, + 'Parameter `taskID` is required when calling `deleteTask`.', + ); + final request = ApiRequest( + method: RequestMethod.delete, + path: r'/1/tasks/{taskID}'.replaceAll( + '{' r'taskID' '}', Uri.encodeComponent(taskID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'DeleteResponse', + growable: true, + ); + } + + /// Disable a task. + /// Disable the task of the given taskID. + /// + /// Parameters: + /// * [taskID] The task UUID. + /// * [requestOptions] additional request configuration. + Future disableTask({ + required String taskID, + RequestOptions? requestOptions, + }) async { + assert( + taskID.isNotEmpty, + 'Parameter `taskID` is required when calling `disableTask`.', + ); + final request = ApiRequest( + method: RequestMethod.put, + path: r'/1/tasks/{taskID}/disable'.replaceAll( + '{' r'taskID' '}', Uri.encodeComponent(taskID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'TaskUpdateResponse', + growable: true, + ); + } + + /// Enable a task. + /// Enable the task of the given taskID. + /// + /// Parameters: + /// * [taskID] The task UUID. + /// * [requestOptions] additional request configuration. + Future enableTask({ + required String taskID, + RequestOptions? requestOptions, + }) async { + assert( + taskID.isNotEmpty, + 'Parameter `taskID` is required when calling `enableTask`.', + ); + final request = ApiRequest( + method: RequestMethod.put, + path: r'/1/tasks/{taskID}/enable'.replaceAll( + '{' r'taskID' '}', Uri.encodeComponent(taskID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'TaskUpdateResponse', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [requestOptions] additional request configuration. + Future get({ + required String path, + Map? parameters, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `get`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Get a authentication. + /// Get the authentication of the given authenticationID. + /// + /// Parameters: + /// * [authenticationID] The authentication UUID. + /// * [requestOptions] additional request configuration. + Future getAuthentication({ + required String authenticationID, + RequestOptions? requestOptions, + }) async { + assert( + authenticationID.isNotEmpty, + 'Parameter `authenticationID` is required when calling `getAuthentication`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/authentications/{authenticationID}'.replaceAll( + '{' r'authenticationID' '}', + Uri.encodeComponent(authenticationID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Authentication', + growable: true, + ); + } + + /// Get a list of authentications. + /// Get a list of authentications for the given query parameters, with pagination details. + /// + /// Parameters: + /// * [itemsPerPage] The number of items per page to return. + /// * [page] The page number to fetch, starting at 1. + /// * [type] The type of the authentications to retrieve. + /// * [platform] The platform of the authentications to retrieve. - one of types: [Platform], [PlatformNone], + /// * [sort] The key by which the list should be sorted. + /// * [order] The order of the returned list. + /// * [requestOptions] additional request configuration. + Future getAuthentications({ + int? itemsPerPage, + int? page, + List? type, + Iterable? platform, + AuthenticationSortKeys? sort, + OrderKeys? order, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/authentications', + queryParams: { + if (itemsPerPage != null) 'itemsPerPage': itemsPerPage, + if (page != null) 'page': page, + if (type != null) 'type': type.join(','), + if (platform != null) 'platform': platform.join(','), + if (sort != null) 'sort': sort, + if (order != null) 'order': order, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'ListAuthenticationsResponse', + growable: true, + ); + } + + /// Get a destination. + /// Get the destination of the given destinationID. + /// + /// Parameters: + /// * [destinationID] The destination UUID. + /// * [requestOptions] additional request configuration. + Future getDestination({ + required String destinationID, + RequestOptions? requestOptions, + }) async { + assert( + destinationID.isNotEmpty, + 'Parameter `destinationID` is required when calling `getDestination`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/destinations/{destinationID}'.replaceAll( + '{' r'destinationID' '}', + Uri.encodeComponent(destinationID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Destination', + growable: true, + ); + } + + /// Get a list of destinations. + /// Get a list of destinations for the given query parameters, with pagination details. + /// + /// Parameters: + /// * [itemsPerPage] The number of items per page to return. + /// * [page] The page number to fetch, starting at 1. + /// * [type] The type of the destinations to retrive. + /// * [authenticationID] The authenticationIDs of the destinations to retrive. + /// * [sort] The key by which the list should be sorted. + /// * [order] The order of the returned list. + /// * [requestOptions] additional request configuration. + Future getDestinations({ + int? itemsPerPage, + int? page, + List? type, + List? authenticationID, + DestinationSortKeys? sort, + OrderKeys? order, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/destinations', + queryParams: { + if (itemsPerPage != null) 'itemsPerPage': itemsPerPage, + if (page != null) 'page': page, + if (type != null) 'type': type.join(','), + if (authenticationID != null) + 'authenticationID': authenticationID.join(','), + if (sort != null) 'sort': sort, + if (order != null) 'order': order, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'ListDestinationsResponse', + growable: true, + ); + } + + /// Get an event. + /// Get a single event for a specific runID. + /// + /// Parameters: + /// * [runID] The run UUID. + /// * [eventID] The event UUID. + /// * [requestOptions] additional request configuration. + Future getEvent({ + required String runID, + required String eventID, + RequestOptions? requestOptions, + }) async { + assert( + runID.isNotEmpty, + 'Parameter `runID` is required when calling `getEvent`.', + ); + assert( + eventID.isNotEmpty, + 'Parameter `eventID` is required when calling `getEvent`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/runs/{runID}/events/{eventID}' + .replaceAll('{' r'runID' '}', Uri.encodeComponent(runID.toString())) + .replaceAll( + '{' r'eventID' '}', Uri.encodeComponent(eventID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Event', + growable: true, + ); + } + + /// Get a list of events. + /// Get a list of events associated to the given runID, for the given query parameters. + /// + /// Parameters: + /// * [runID] The run UUID. + /// * [itemsPerPage] The number of items per page to return. + /// * [page] The page number to fetch, starting at 1. + /// * [status] Filter the status of the events. + /// * [type] Filter the type of the events. + /// * [sort] The key by which the list should be sorted. + /// * [order] The order of the returned list. + /// * [requestOptions] additional request configuration. + Future getEvents({ + required String runID, + int? itemsPerPage, + int? page, + List? status, + List? type, + EventSortKeys? sort, + OrderKeys? order, + RequestOptions? requestOptions, + }) async { + assert( + runID.isNotEmpty, + 'Parameter `runID` is required when calling `getEvents`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/runs/{runID}/events' + .replaceAll('{' r'runID' '}', Uri.encodeComponent(runID.toString())), + queryParams: { + if (itemsPerPage != null) 'itemsPerPage': itemsPerPage, + if (page != null) 'page': page, + if (status != null) 'status': status.join(','), + if (type != null) 'type': type.join(','), + if (sort != null) 'sort': sort, + if (order != null) 'order': order, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'ListEventsResponse', + growable: true, + ); + } + + /// Get a run. + /// Get a single run for the given ID. + /// + /// Parameters: + /// * [runID] The run UUID. + /// * [requestOptions] additional request configuration. + Future getRun({ + required String runID, + RequestOptions? requestOptions, + }) async { + assert( + runID.isNotEmpty, + 'Parameter `runID` is required when calling `getRun`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/runs/{runID}' + .replaceAll('{' r'runID' '}', Uri.encodeComponent(runID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Run', + growable: true, + ); + } + + /// Get a list of runs. + /// Get a list of runs for the given query parameters, with pagination details. + /// + /// Parameters: + /// * [itemsPerPage] The number of items per page to return. + /// * [page] The page number to fetch, starting at 1. + /// * [status] Filter the status of the runs. + /// * [taskID] Filter by taskID. + /// * [sort] The key by which the list should be sorted. + /// * [order] The order of the returned list. + /// * [startDate] The start date (in RFC3339 format) of the runs fetching window. Defaults to 'now'-7 days if omitted. The timespan between `startDate` and `endDate` must be smaller than 7 days. + /// * [endDate] The end date (in RFC3339 format) of the runs fetching window. Defaults to 'now' days if omitted. The timespan between `startDate` and `endDate` must be smaller than 7 days. + /// * [requestOptions] additional request configuration. + Future getRuns({ + int? itemsPerPage, + int? page, + List? status, + String? taskID, + RunSortKeys? sort, + OrderKeys? order, + String? startDate, + String? endDate, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/runs', + queryParams: { + if (itemsPerPage != null) 'itemsPerPage': itemsPerPage, + if (page != null) 'page': page, + if (status != null) 'status': status.join(','), + if (taskID != null) 'taskID': taskID, + if (sort != null) 'sort': sort, + if (order != null) 'order': order, + if (startDate != null) 'startDate': startDate, + if (endDate != null) 'endDate': endDate, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'RunListResponse', + growable: true, + ); + } + + /// Get a source. + /// Get the source of the given sourceID. + /// + /// Parameters: + /// * [sourceID] The source UUID. + /// * [requestOptions] additional request configuration. + Future getSource({ + required String sourceID, + RequestOptions? requestOptions, + }) async { + assert( + sourceID.isNotEmpty, + 'Parameter `sourceID` is required when calling `getSource`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/sources/{sourceID}'.replaceAll( + '{' r'sourceID' '}', Uri.encodeComponent(sourceID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Source', + growable: true, + ); + } + + /// Get a list of sources. + /// Get a list of sources for the given query parameters, with pagination details. + /// + /// Parameters: + /// * [itemsPerPage] The number of items per page to return. + /// * [page] The page number to fetch, starting at 1. + /// * [type] The type of the sources to retrieve. + /// * [authenticationID] The authenticationIDs of the sources to retrieve. 'none' returns sources that doesn't have an authentication. + /// * [sort] The key by which the list should be sorted. + /// * [order] The order of the returned list. + /// * [requestOptions] additional request configuration. + Future getSources({ + int? itemsPerPage, + int? page, + List? type, + List? authenticationID, + SourceSortKeys? sort, + OrderKeys? order, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/sources', + queryParams: { + if (itemsPerPage != null) 'itemsPerPage': itemsPerPage, + if (page != null) 'page': page, + if (type != null) 'type': type.join(','), + if (authenticationID != null) + 'authenticationID': authenticationID.join(','), + if (sort != null) 'sort': sort, + if (order != null) 'order': order, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'ListSourcesResponse', + growable: true, + ); + } + + /// Get a task. + /// Get the task of the given taskID. + /// + /// Parameters: + /// * [taskID] The task UUID. + /// * [requestOptions] additional request configuration. + Future getTask({ + required String taskID, + RequestOptions? requestOptions, + }) async { + assert( + taskID.isNotEmpty, + 'Parameter `taskID` is required when calling `getTask`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/tasks/{taskID}'.replaceAll( + '{' r'taskID' '}', Uri.encodeComponent(taskID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Task', + growable: true, + ); + } + + /// Get a list of tasks. + /// Get a list of tasks for the given query parameters, with pagination details. + /// + /// Parameters: + /// * [itemsPerPage] The number of items per page to return. + /// * [page] The page number to fetch, starting at 1. + /// * [action] The action of the tasks to retrieve. + /// * [enabled] Whether the task is enabled or not. + /// * [sourceID] The sourceIDs of the tasks to retrive. + /// * [destinationID] The destinationIDs of the tasks to retrive. + /// * [triggerType] The trigger type of the task. + /// * [sort] The key by which the list should be sorted. + /// * [order] The order of the returned list. + /// * [requestOptions] additional request configuration. + Future getTasks({ + int? itemsPerPage, + int? page, + List? action, + bool? enabled, + List? sourceID, + List? destinationID, + List? triggerType, + TaskSortKeys? sort, + OrderKeys? order, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/tasks', + queryParams: { + if (itemsPerPage != null) 'itemsPerPage': itemsPerPage, + if (page != null) 'page': page, + if (action != null) 'action': action.join(','), + if (enabled != null) 'enabled': enabled, + if (sourceID != null) 'sourceID': sourceID.join(','), + if (destinationID != null) 'destinationID': destinationID.join(','), + if (triggerType != null) 'triggerType': triggerType.join(','), + if (sort != null) 'sort': sort, + if (order != null) 'order': order, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'ListTasksResponse', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [body] Parameters to send with the custom request. + /// * [requestOptions] additional request configuration. + Future post({ + required String path, + Map? parameters, + Object? body, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `post`.', + ); + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + body: body, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [body] Parameters to send with the custom request. + /// * [requestOptions] additional request configuration. + Future put({ + required String path, + Map? parameters, + Object? body, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `put`.', + ); + final request = ApiRequest( + method: RequestMethod.put, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + body: body, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Run a task. + /// Run the task of the given taskID. + /// + /// Parameters: + /// * [taskID] The task UUID. + /// * [requestOptions] additional request configuration. + Future runTask({ + required String taskID, + RequestOptions? requestOptions, + }) async { + assert( + taskID.isNotEmpty, + 'Parameter `taskID` is required when calling `runTask`.', + ); + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1/tasks/{taskID}/run'.replaceAll( + '{' r'taskID' '}', Uri.encodeComponent(taskID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'RunResponse', + growable: true, + ); + } + + /// Search among authentications. + /// Search among authentications with a defined set of parameters. + /// + /// Parameters: + /// * [authenticationSearch] + /// * [requestOptions] additional request configuration. + Future> searchAuthentications({ + required AuthenticationSearch authenticationSearch, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1/authentications/search', + body: authenticationSearch.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize, Authentication>( + response, + 'List', + growable: true, + ); + } + + /// Search among destinations. + /// Search among destinations with a defined set of parameters. + /// + /// Parameters: + /// * [destinationSearch] + /// * [requestOptions] additional request configuration. + Future> searchDestinations({ + required DestinationSearch destinationSearch, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1/destinations/search', + body: destinationSearch.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize, Destination>( + response, + 'List', + growable: true, + ); + } + + /// Search among sources. + /// Search among sources with a defined set of parameters. + /// + /// Parameters: + /// * [sourceSearch] + /// * [requestOptions] additional request configuration. + Future> searchSources({ + required SourceSearch sourceSearch, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1/sources/search', + body: sourceSearch.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize, Source>( + response, + 'List', + growable: true, + ); + } + + /// Search among tasks. + /// Search among tasks with a defined set of parameters. + /// + /// Parameters: + /// * [taskSearch] + /// * [requestOptions] additional request configuration. + Future> searchTasks({ + required TaskSearch taskSearch, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1/tasks/search', + body: taskSearch.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize, Task>( + response, + 'List', + growable: true, + ); + } + + /// Update a authentication. + /// Update the authentication of the given authenticationID. + /// + /// Parameters: + /// * [authenticationID] The authentication UUID. + /// * [authenticationUpdate] + /// * [requestOptions] additional request configuration. + Future updateAuthentication({ + required String authenticationID, + required AuthenticationUpdate authenticationUpdate, + RequestOptions? requestOptions, + }) async { + assert( + authenticationID.isNotEmpty, + 'Parameter `authenticationID` is required when calling `updateAuthentication`.', + ); + final request = ApiRequest( + method: RequestMethod.patch, + path: r'/1/authentications/{authenticationID}'.replaceAll( + '{' r'authenticationID' '}', + Uri.encodeComponent(authenticationID.toString())), + body: authenticationUpdate.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'AuthenticationUpdateResponse', + growable: true, + ); + } + + /// Update a destination. + /// Update the destination of the given destinationID. + /// + /// Parameters: + /// * [destinationID] The destination UUID. + /// * [destinationUpdate] + /// * [requestOptions] additional request configuration. + Future updateDestination({ + required String destinationID, + required DestinationUpdate destinationUpdate, + RequestOptions? requestOptions, + }) async { + assert( + destinationID.isNotEmpty, + 'Parameter `destinationID` is required when calling `updateDestination`.', + ); + final request = ApiRequest( + method: RequestMethod.patch, + path: r'/1/destinations/{destinationID}'.replaceAll( + '{' r'destinationID' '}', + Uri.encodeComponent(destinationID.toString())), + body: destinationUpdate.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'DestinationUpdateResponse', + growable: true, + ); + } + + /// Update a source. + /// Update the source of the given sourceID. + /// + /// Parameters: + /// * [sourceID] The source UUID. + /// * [sourceUpdate] + /// * [requestOptions] additional request configuration. + Future updateSource({ + required String sourceID, + required SourceUpdate sourceUpdate, + RequestOptions? requestOptions, + }) async { + assert( + sourceID.isNotEmpty, + 'Parameter `sourceID` is required when calling `updateSource`.', + ); + final request = ApiRequest( + method: RequestMethod.patch, + path: r'/1/sources/{sourceID}'.replaceAll( + '{' r'sourceID' '}', Uri.encodeComponent(sourceID.toString())), + body: sourceUpdate.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'SourceUpdateResponse', + growable: true, + ); + } + + /// Update a task. + /// Update the task of the given taskID. + /// + /// Parameters: + /// * [taskID] The task UUID. + /// * [taskUpdate] + /// * [requestOptions] additional request configuration. + Future updateTask({ + required String taskID, + required TaskUpdate taskUpdate, + RequestOptions? requestOptions, + }) async { + assert( + taskID.isNotEmpty, + 'Parameter `taskID` is required when calling `updateTask`.', + ); + final request = ApiRequest( + method: RequestMethod.patch, + path: r'/1/tasks/{taskID}'.replaceAll( + '{' r'taskID' '}', Uri.encodeComponent(taskID.toString())), + body: taskUpdate.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'TaskUpdateResponse', + growable: true, + ); + } + + @override + void dispose() => _retryStrategy.dispose(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/deserialize.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/deserialize.dart new file mode 100644 index 0000000000..99de2fa9f9 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/deserialize.dart @@ -0,0 +1,376 @@ +import 'package:algolia_client_ingestion/src/model/action_type.dart'; +import 'package:algolia_client_ingestion/src/model/auth_api_key.dart'; +import 'package:algolia_client_ingestion/src/model/auth_api_key_partial.dart'; +import 'package:algolia_client_ingestion/src/model/auth_algolia.dart'; +import 'package:algolia_client_ingestion/src/model/auth_algolia_partial.dart'; +import 'package:algolia_client_ingestion/src/model/auth_basic.dart'; +import 'package:algolia_client_ingestion/src/model/auth_basic_partial.dart'; +import 'package:algolia_client_ingestion/src/model/auth_google_service_account.dart'; +import 'package:algolia_client_ingestion/src/model/auth_google_service_account_partial.dart'; +import 'package:algolia_client_ingestion/src/model/auth_o_auth.dart'; +import 'package:algolia_client_ingestion/src/model/auth_o_auth_partial.dart'; +import 'package:algolia_client_ingestion/src/model/authentication.dart'; +import 'package:algolia_client_ingestion/src/model/authentication_create.dart'; +import 'package:algolia_client_ingestion/src/model/authentication_create_response.dart'; +import 'package:algolia_client_ingestion/src/model/authentication_search.dart'; +import 'package:algolia_client_ingestion/src/model/authentication_sort_keys.dart'; +import 'package:algolia_client_ingestion/src/model/authentication_type.dart'; +import 'package:algolia_client_ingestion/src/model/authentication_update.dart'; +import 'package:algolia_client_ingestion/src/model/authentication_update_response.dart'; +import 'package:algolia_client_ingestion/src/model/big_commerce_channel.dart'; +import 'package:algolia_client_ingestion/src/model/big_query_data_type.dart'; +import 'package:algolia_client_ingestion/src/model/delete_response.dart'; +import 'package:algolia_client_ingestion/src/model/destination.dart'; +import 'package:algolia_client_ingestion/src/model/destination_create.dart'; +import 'package:algolia_client_ingestion/src/model/destination_create_response.dart'; +import 'package:algolia_client_ingestion/src/model/destination_index_name.dart'; +import 'package:algolia_client_ingestion/src/model/destination_index_prefix.dart'; +import 'package:algolia_client_ingestion/src/model/destination_search.dart'; +import 'package:algolia_client_ingestion/src/model/destination_sort_keys.dart'; +import 'package:algolia_client_ingestion/src/model/destination_type.dart'; +import 'package:algolia_client_ingestion/src/model/destination_update.dart'; +import 'package:algolia_client_ingestion/src/model/destination_update_response.dart'; +import 'package:algolia_client_ingestion/src/model/docker_image_type.dart'; +import 'package:algolia_client_ingestion/src/model/docker_registry.dart'; +import 'package:algolia_client_ingestion/src/model/error_base.dart'; +import 'package:algolia_client_ingestion/src/model/event.dart'; +import 'package:algolia_client_ingestion/src/model/event_sort_keys.dart'; +import 'package:algolia_client_ingestion/src/model/event_status.dart'; +import 'package:algolia_client_ingestion/src/model/event_type.dart'; +import 'package:algolia_client_ingestion/src/model/list_authentications_response.dart'; +import 'package:algolia_client_ingestion/src/model/list_destinations_response.dart'; +import 'package:algolia_client_ingestion/src/model/list_events_response.dart'; +import 'package:algolia_client_ingestion/src/model/list_sources_response.dart'; +import 'package:algolia_client_ingestion/src/model/list_tasks_response.dart'; +import 'package:algolia_client_ingestion/src/model/mapping_type_csv.dart'; +import 'package:algolia_client_ingestion/src/model/method_type.dart'; +import 'package:algolia_client_ingestion/src/model/on_demand_date_utils_input.dart'; +import 'package:algolia_client_ingestion/src/model/on_demand_trigger.dart'; +import 'package:algolia_client_ingestion/src/model/on_demand_trigger_input.dart'; +import 'package:algolia_client_ingestion/src/model/on_demand_trigger_type.dart'; +import 'package:algolia_client_ingestion/src/model/order_keys.dart'; +import 'package:algolia_client_ingestion/src/model/pagination.dart'; +import 'package:algolia_client_ingestion/src/model/platform.dart'; +import 'package:algolia_client_ingestion/src/model/platform_none.dart'; +import 'package:algolia_client_ingestion/src/model/run.dart'; +import 'package:algolia_client_ingestion/src/model/run_list_response.dart'; +import 'package:algolia_client_ingestion/src/model/run_outcome.dart'; +import 'package:algolia_client_ingestion/src/model/run_progress.dart'; +import 'package:algolia_client_ingestion/src/model/run_reason_code.dart'; +import 'package:algolia_client_ingestion/src/model/run_response.dart'; +import 'package:algolia_client_ingestion/src/model/run_sort_keys.dart'; +import 'package:algolia_client_ingestion/src/model/run_status.dart'; +import 'package:algolia_client_ingestion/src/model/run_type.dart'; +import 'package:algolia_client_ingestion/src/model/schedule_date_utils_input.dart'; +import 'package:algolia_client_ingestion/src/model/schedule_trigger.dart'; +import 'package:algolia_client_ingestion/src/model/schedule_trigger_input.dart'; +import 'package:algolia_client_ingestion/src/model/schedule_trigger_type.dart'; +import 'package:algolia_client_ingestion/src/model/source.dart'; +import 'package:algolia_client_ingestion/src/model/source_big_commerce.dart'; +import 'package:algolia_client_ingestion/src/model/source_big_query.dart'; +import 'package:algolia_client_ingestion/src/model/source_csv.dart'; +import 'package:algolia_client_ingestion/src/model/source_commercetools.dart'; +import 'package:algolia_client_ingestion/src/model/source_create.dart'; +import 'package:algolia_client_ingestion/src/model/source_create_response.dart'; +import 'package:algolia_client_ingestion/src/model/source_docker.dart'; +import 'package:algolia_client_ingestion/src/model/source_json.dart'; +import 'package:algolia_client_ingestion/src/model/source_search.dart'; +import 'package:algolia_client_ingestion/src/model/source_sort_keys.dart'; +import 'package:algolia_client_ingestion/src/model/source_type.dart'; +import 'package:algolia_client_ingestion/src/model/source_update.dart'; +import 'package:algolia_client_ingestion/src/model/source_update_commercetools.dart'; +import 'package:algolia_client_ingestion/src/model/source_update_response.dart'; +import 'package:algolia_client_ingestion/src/model/subscription_trigger.dart'; +import 'package:algolia_client_ingestion/src/model/subscription_trigger_type.dart'; +import 'package:algolia_client_ingestion/src/model/task.dart'; +import 'package:algolia_client_ingestion/src/model/task_create.dart'; +import 'package:algolia_client_ingestion/src/model/task_create_response.dart'; +import 'package:algolia_client_ingestion/src/model/task_search.dart'; +import 'package:algolia_client_ingestion/src/model/task_sort_keys.dart'; +import 'package:algolia_client_ingestion/src/model/task_update.dart'; +import 'package:algolia_client_ingestion/src/model/task_update_response.dart'; +import 'package:algolia_client_ingestion/src/model/trigger_input.dart'; +import 'package:algolia_client_ingestion/src/model/trigger_type.dart'; + +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + +ReturnType deserialize(dynamic value, String targetType, + {bool growable = true}) { + switch (targetType) { + case 'String': + return '$value' as ReturnType; + case 'int': + return (value is int ? value : int.parse('$value')) as ReturnType; + case 'bool': + if (value is bool) { + return value as ReturnType; + } + final valueString = '$value'.toLowerCase(); + return (valueString == 'true' || valueString == '1') as ReturnType; + case 'double': + return (value is double ? value : double.parse('$value')) as ReturnType; + case 'ActionType': + return ActionType.fromJson(value) as ReturnType; + case 'AuthAPIKey': + return AuthAPIKey.fromJson(value as Map) as ReturnType; + case 'AuthAPIKeyPartial': + return AuthAPIKeyPartial.fromJson(value as Map) + as ReturnType; + case 'AuthAlgolia': + return AuthAlgolia.fromJson(value as Map) as ReturnType; + case 'AuthAlgoliaPartial': + return AuthAlgoliaPartial.fromJson(value as Map) + as ReturnType; + case 'AuthBasic': + return AuthBasic.fromJson(value as Map) as ReturnType; + case 'AuthBasicPartial': + return AuthBasicPartial.fromJson(value as Map) + as ReturnType; + case 'AuthGoogleServiceAccount': + return AuthGoogleServiceAccount.fromJson(value as Map) + as ReturnType; + case 'AuthGoogleServiceAccountPartial': + return AuthGoogleServiceAccountPartial.fromJson( + value as Map) as ReturnType; + case 'AuthOAuth': + return AuthOAuth.fromJson(value as Map) as ReturnType; + case 'AuthOAuthPartial': + return AuthOAuthPartial.fromJson(value as Map) + as ReturnType; + case 'Authentication': + return Authentication.fromJson(value as Map) + as ReturnType; + case 'AuthenticationCreate': + return AuthenticationCreate.fromJson(value as Map) + as ReturnType; + case 'AuthenticationCreateResponse': + return AuthenticationCreateResponse.fromJson( + value as Map) as ReturnType; + case 'AuthenticationSearch': + return AuthenticationSearch.fromJson(value as Map) + as ReturnType; + case 'AuthenticationSortKeys': + return AuthenticationSortKeys.fromJson(value) as ReturnType; + case 'AuthenticationType': + return AuthenticationType.fromJson(value) as ReturnType; + case 'AuthenticationUpdate': + return AuthenticationUpdate.fromJson(value as Map) + as ReturnType; + case 'AuthenticationUpdateResponse': + return AuthenticationUpdateResponse.fromJson( + value as Map) as ReturnType; + case 'BigCommerceChannel': + return BigCommerceChannel.fromJson(value as Map) + as ReturnType; + case 'BigQueryDataType': + return BigQueryDataType.fromJson(value) as ReturnType; + case 'DeleteResponse': + return DeleteResponse.fromJson(value as Map) + as ReturnType; + case 'Destination': + return Destination.fromJson(value as Map) as ReturnType; + case 'DestinationCreate': + return DestinationCreate.fromJson(value as Map) + as ReturnType; + case 'DestinationCreateResponse': + return DestinationCreateResponse.fromJson(value as Map) + as ReturnType; + case 'DestinationIndexName': + return DestinationIndexName.fromJson(value as Map) + as ReturnType; + case 'DestinationIndexPrefix': + return DestinationIndexPrefix.fromJson(value as Map) + as ReturnType; + case 'DestinationSearch': + return DestinationSearch.fromJson(value as Map) + as ReturnType; + case 'DestinationSortKeys': + return DestinationSortKeys.fromJson(value) as ReturnType; + case 'DestinationType': + return DestinationType.fromJson(value) as ReturnType; + case 'DestinationUpdate': + return DestinationUpdate.fromJson(value as Map) + as ReturnType; + case 'DestinationUpdateResponse': + return DestinationUpdateResponse.fromJson(value as Map) + as ReturnType; + case 'DockerImageType': + return DockerImageType.fromJson(value) as ReturnType; + case 'DockerRegistry': + return DockerRegistry.fromJson(value) as ReturnType; + case 'ErrorBase': + return ErrorBase.fromJson(value as Map) as ReturnType; + case 'Event': + return Event.fromJson(value as Map) as ReturnType; + case 'EventSortKeys': + return EventSortKeys.fromJson(value) as ReturnType; + case 'EventStatus': + return EventStatus.fromJson(value) as ReturnType; + case 'EventType': + return EventType.fromJson(value) as ReturnType; + case 'ListAuthenticationsResponse': + return ListAuthenticationsResponse.fromJson(value as Map) + as ReturnType; + case 'ListDestinationsResponse': + return ListDestinationsResponse.fromJson(value as Map) + as ReturnType; + case 'ListEventsResponse': + return ListEventsResponse.fromJson(value as Map) + as ReturnType; + case 'ListSourcesResponse': + return ListSourcesResponse.fromJson(value as Map) + as ReturnType; + case 'ListTasksResponse': + return ListTasksResponse.fromJson(value as Map) + as ReturnType; + case 'MappingTypeCSV': + return MappingTypeCSV.fromJson(value) as ReturnType; + case 'MethodType': + return MethodType.fromJson(value) as ReturnType; + case 'OnDemandDateUtilsInput': + return OnDemandDateUtilsInput.fromJson(value as Map) + as ReturnType; + case 'OnDemandTrigger': + return OnDemandTrigger.fromJson(value as Map) + as ReturnType; + case 'OnDemandTriggerInput': + return OnDemandTriggerInput.fromJson(value as Map) + as ReturnType; + case 'OnDemandTriggerType': + return OnDemandTriggerType.fromJson(value) as ReturnType; + case 'OrderKeys': + return OrderKeys.fromJson(value) as ReturnType; + case 'Pagination': + return Pagination.fromJson(value as Map) as ReturnType; + case 'Platform': + return Platform.fromJson(value) as ReturnType; + case 'PlatformNone': + return PlatformNone.fromJson(value) as ReturnType; + case 'Run': + return Run.fromJson(value as Map) as ReturnType; + case 'RunListResponse': + return RunListResponse.fromJson(value as Map) + as ReturnType; + case 'RunOutcome': + return RunOutcome.fromJson(value) as ReturnType; + case 'RunProgress': + return RunProgress.fromJson(value as Map) as ReturnType; + case 'RunReasonCode': + return RunReasonCode.fromJson(value) as ReturnType; + case 'RunResponse': + return RunResponse.fromJson(value as Map) as ReturnType; + case 'RunSortKeys': + return RunSortKeys.fromJson(value) as ReturnType; + case 'RunStatus': + return RunStatus.fromJson(value) as ReturnType; + case 'RunType': + return RunType.fromJson(value) as ReturnType; + case 'ScheduleDateUtilsInput': + return ScheduleDateUtilsInput.fromJson(value as Map) + as ReturnType; + case 'ScheduleTrigger': + return ScheduleTrigger.fromJson(value as Map) + as ReturnType; + case 'ScheduleTriggerInput': + return ScheduleTriggerInput.fromJson(value as Map) + as ReturnType; + case 'ScheduleTriggerType': + return ScheduleTriggerType.fromJson(value) as ReturnType; + case 'Source': + return Source.fromJson(value as Map) as ReturnType; + case 'SourceBigCommerce': + return SourceBigCommerce.fromJson(value as Map) + as ReturnType; + case 'SourceBigQuery': + return SourceBigQuery.fromJson(value as Map) + as ReturnType; + case 'SourceCSV': + return SourceCSV.fromJson(value as Map) as ReturnType; + case 'SourceCommercetools': + return SourceCommercetools.fromJson(value as Map) + as ReturnType; + case 'SourceCreate': + return SourceCreate.fromJson(value as Map) as ReturnType; + case 'SourceCreateResponse': + return SourceCreateResponse.fromJson(value as Map) + as ReturnType; + case 'SourceDocker': + return SourceDocker.fromJson(value as Map) as ReturnType; + case 'SourceJSON': + return SourceJSON.fromJson(value as Map) as ReturnType; + case 'SourceSearch': + return SourceSearch.fromJson(value as Map) as ReturnType; + case 'SourceSortKeys': + return SourceSortKeys.fromJson(value) as ReturnType; + case 'SourceType': + return SourceType.fromJson(value) as ReturnType; + case 'SourceUpdate': + return SourceUpdate.fromJson(value as Map) as ReturnType; + case 'SourceUpdateCommercetools': + return SourceUpdateCommercetools.fromJson(value as Map) + as ReturnType; + case 'SourceUpdateResponse': + return SourceUpdateResponse.fromJson(value as Map) + as ReturnType; + case 'SubscriptionTrigger': + return SubscriptionTrigger.fromJson(value as Map) + as ReturnType; + case 'SubscriptionTriggerType': + return SubscriptionTriggerType.fromJson(value) as ReturnType; + case 'Task': + return Task.fromJson(value as Map) as ReturnType; + case 'TaskCreate': + return TaskCreate.fromJson(value as Map) as ReturnType; + case 'TaskCreateResponse': + return TaskCreateResponse.fromJson(value as Map) + as ReturnType; + case 'TaskSearch': + return TaskSearch.fromJson(value as Map) as ReturnType; + case 'TaskSortKeys': + return TaskSortKeys.fromJson(value) as ReturnType; + case 'TaskUpdate': + return TaskUpdate.fromJson(value as Map) as ReturnType; + case 'TaskUpdateResponse': + return TaskUpdateResponse.fromJson(value as Map) + as ReturnType; + case 'TriggerInput': + return TriggerInput.fromJson(value as Map) as ReturnType; + case 'TriggerType': + return TriggerType.fromJson(value) as ReturnType; + default: + RegExpMatch? match; + + if (value is List && (match = _regList.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toList(growable: growable) as ReturnType; + } + if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toSet() as ReturnType; + } + if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return Map.fromIterables( + value.keys, + value.values.map((dynamic v) => deserialize( + v, targetType, + growable: growable)), + ) as ReturnType; + } + if (targetType == 'Object') { + return value; + } + break; + } + throw Exception('Cannot deserialize'); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/action_type.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/action_type.dart new file mode 100644 index 0000000000..c34e20cf68 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/action_type.dart @@ -0,0 +1,28 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// The action to perform on the Algolia index. +@JsonEnum(valueField: 'raw') +enum ActionType { + /// The action to perform on the Algolia index. + replace(r'replace'), + + /// The action to perform on the Algolia index. + save(r'save'); + + const ActionType(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static ActionType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_algolia.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_algolia.dart new file mode 100644 index 0000000000..54541f9907 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_algolia.dart @@ -0,0 +1,41 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'auth_algolia.g.dart'; + +@JsonSerializable() +final class AuthAlgolia { + /// Returns a new [AuthAlgolia] instance. + const AuthAlgolia({ + required this.appID, + required this.apiKey, + }); + + /// Algolia Application ID. + @JsonKey(name: r'appID') + final String appID; + + /// Algolia API Key, with the correct rights to push to an index and change settings. + @JsonKey(name: r'apiKey') + final String apiKey; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AuthAlgolia && other.appID == appID && other.apiKey == apiKey; + + @override + int get hashCode => appID.hashCode + apiKey.hashCode; + + factory AuthAlgolia.fromJson(Map json) => + _$AuthAlgoliaFromJson(json); + + Map toJson() => _$AuthAlgoliaToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_algolia.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_algolia.g.dart new file mode 100644 index 0000000000..0ebf7ba37f --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_algolia.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'auth_algolia.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AuthAlgolia _$AuthAlgoliaFromJson(Map json) => $checkedCreate( + 'AuthAlgolia', + json, + ($checkedConvert) { + final val = AuthAlgolia( + appID: $checkedConvert('appID', (v) => v as String), + apiKey: $checkedConvert('apiKey', (v) => v as String), + ); + return val; + }, + ); + +Map _$AuthAlgoliaToJson(AuthAlgolia instance) => + { + 'appID': instance.appID, + 'apiKey': instance.apiKey, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_algolia_partial.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_algolia_partial.dart new file mode 100644 index 0000000000..e1f0d05098 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_algolia_partial.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'auth_algolia_partial.g.dart'; + +@JsonSerializable() +final class AuthAlgoliaPartial { + /// Returns a new [AuthAlgoliaPartial] instance. + const AuthAlgoliaPartial({ + this.appID, + this.apiKey, + }); + + /// Algolia Application ID. + @JsonKey(name: r'appID') + final String? appID; + + /// Algolia API Key, with the correct rights to push to an index and change settings. + @JsonKey(name: r'apiKey') + final String? apiKey; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AuthAlgoliaPartial && + other.appID == appID && + other.apiKey == apiKey; + + @override + int get hashCode => appID.hashCode + apiKey.hashCode; + + factory AuthAlgoliaPartial.fromJson(Map json) => + _$AuthAlgoliaPartialFromJson(json); + + Map toJson() => _$AuthAlgoliaPartialToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_algolia_partial.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_algolia_partial.g.dart new file mode 100644 index 0000000000..30934513d5 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_algolia_partial.g.dart @@ -0,0 +1,34 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'auth_algolia_partial.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AuthAlgoliaPartial _$AuthAlgoliaPartialFromJson(Map json) => + $checkedCreate( + 'AuthAlgoliaPartial', + json, + ($checkedConvert) { + final val = AuthAlgoliaPartial( + appID: $checkedConvert('appID', (v) => v as String?), + apiKey: $checkedConvert('apiKey', (v) => v as String?), + ); + return val; + }, + ); + +Map _$AuthAlgoliaPartialToJson(AuthAlgoliaPartial instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('appID', instance.appID); + writeNotNull('apiKey', instance.apiKey); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_api_key.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_api_key.dart new file mode 100644 index 0000000000..a6ecf8f2e8 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_api_key.dart @@ -0,0 +1,34 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'auth_api_key.g.dart'; + +@JsonSerializable() +final class AuthAPIKey { + /// Returns a new [AuthAPIKey] instance. + const AuthAPIKey({ + required this.key, + }); + + @JsonKey(name: r'key') + final String key; + + @override + bool operator ==(Object other) => + identical(this, other) || other is AuthAPIKey && other.key == key; + + @override + int get hashCode => key.hashCode; + + factory AuthAPIKey.fromJson(Map json) => + _$AuthAPIKeyFromJson(json); + + Map toJson() => _$AuthAPIKeyToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_api_key.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_api_key.g.dart new file mode 100644 index 0000000000..a180cff1c1 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_api_key.g.dart @@ -0,0 +1,23 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'auth_api_key.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AuthAPIKey _$AuthAPIKeyFromJson(Map json) => $checkedCreate( + 'AuthAPIKey', + json, + ($checkedConvert) { + final val = AuthAPIKey( + key: $checkedConvert('key', (v) => v as String), + ); + return val; + }, + ); + +Map _$AuthAPIKeyToJson(AuthAPIKey instance) => + { + 'key': instance.key, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_api_key_partial.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_api_key_partial.dart new file mode 100644 index 0000000000..69f1e2b7e1 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_api_key_partial.dart @@ -0,0 +1,34 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'auth_api_key_partial.g.dart'; + +@JsonSerializable() +final class AuthAPIKeyPartial { + /// Returns a new [AuthAPIKeyPartial] instance. + const AuthAPIKeyPartial({ + this.key, + }); + + @JsonKey(name: r'key') + final String? key; + + @override + bool operator ==(Object other) => + identical(this, other) || other is AuthAPIKeyPartial && other.key == key; + + @override + int get hashCode => key.hashCode; + + factory AuthAPIKeyPartial.fromJson(Map json) => + _$AuthAPIKeyPartialFromJson(json); + + Map toJson() => _$AuthAPIKeyPartialToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_api_key_partial.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_api_key_partial.g.dart new file mode 100644 index 0000000000..18ea03781d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_api_key_partial.g.dart @@ -0,0 +1,32 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'auth_api_key_partial.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AuthAPIKeyPartial _$AuthAPIKeyPartialFromJson(Map json) => + $checkedCreate( + 'AuthAPIKeyPartial', + json, + ($checkedConvert) { + final val = AuthAPIKeyPartial( + key: $checkedConvert('key', (v) => v as String?), + ); + return val; + }, + ); + +Map _$AuthAPIKeyPartialToJson(AuthAPIKeyPartial instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('key', instance.key); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_basic.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_basic.dart new file mode 100644 index 0000000000..c72b815378 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_basic.dart @@ -0,0 +1,41 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'auth_basic.g.dart'; + +@JsonSerializable() +final class AuthBasic { + /// Returns a new [AuthBasic] instance. + const AuthBasic({ + required this.username, + required this.password, + }); + + @JsonKey(name: r'username') + final String username; + + @JsonKey(name: r'password') + final String password; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AuthBasic && + other.username == username && + other.password == password; + + @override + int get hashCode => username.hashCode + password.hashCode; + + factory AuthBasic.fromJson(Map json) => + _$AuthBasicFromJson(json); + + Map toJson() => _$AuthBasicToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_basic.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_basic.g.dart new file mode 100644 index 0000000000..003ac18780 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_basic.g.dart @@ -0,0 +1,24 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'auth_basic.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AuthBasic _$AuthBasicFromJson(Map json) => $checkedCreate( + 'AuthBasic', + json, + ($checkedConvert) { + final val = AuthBasic( + username: $checkedConvert('username', (v) => v as String), + password: $checkedConvert('password', (v) => v as String), + ); + return val; + }, + ); + +Map _$AuthBasicToJson(AuthBasic instance) => { + 'username': instance.username, + 'password': instance.password, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_basic_partial.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_basic_partial.dart new file mode 100644 index 0000000000..881251cb39 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_basic_partial.dart @@ -0,0 +1,41 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'auth_basic_partial.g.dart'; + +@JsonSerializable() +final class AuthBasicPartial { + /// Returns a new [AuthBasicPartial] instance. + const AuthBasicPartial({ + this.username, + this.password, + }); + + @JsonKey(name: r'username') + final String? username; + + @JsonKey(name: r'password') + final String? password; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AuthBasicPartial && + other.username == username && + other.password == password; + + @override + int get hashCode => username.hashCode + password.hashCode; + + factory AuthBasicPartial.fromJson(Map json) => + _$AuthBasicPartialFromJson(json); + + Map toJson() => _$AuthBasicPartialToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_basic_partial.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_basic_partial.g.dart new file mode 100644 index 0000000000..bc747e6bb8 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_basic_partial.g.dart @@ -0,0 +1,34 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'auth_basic_partial.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AuthBasicPartial _$AuthBasicPartialFromJson(Map json) => + $checkedCreate( + 'AuthBasicPartial', + json, + ($checkedConvert) { + final val = AuthBasicPartial( + username: $checkedConvert('username', (v) => v as String?), + password: $checkedConvert('password', (v) => v as String?), + ); + return val; + }, + ); + +Map _$AuthBasicPartialToJson(AuthBasicPartial instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('username', instance.username); + writeNotNull('password', instance.password); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_google_service_account.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_google_service_account.dart new file mode 100644 index 0000000000..b3dd5bf863 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_google_service_account.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'auth_google_service_account.g.dart'; + +@JsonSerializable() +final class AuthGoogleServiceAccount { + /// Returns a new [AuthGoogleServiceAccount] instance. + const AuthGoogleServiceAccount({ + required this.clientEmail, + required this.privateKey, + }); + + /// Email address of the Service Account. + @JsonKey(name: r'clientEmail') + final String clientEmail; + + /// Private key of the Service Account. + @JsonKey(name: r'privateKey') + final String privateKey; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AuthGoogleServiceAccount && + other.clientEmail == clientEmail && + other.privateKey == privateKey; + + @override + int get hashCode => clientEmail.hashCode + privateKey.hashCode; + + factory AuthGoogleServiceAccount.fromJson(Map json) => + _$AuthGoogleServiceAccountFromJson(json); + + Map toJson() => _$AuthGoogleServiceAccountToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_google_service_account.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_google_service_account.g.dart new file mode 100644 index 0000000000..b9fa9dfa64 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_google_service_account.g.dart @@ -0,0 +1,28 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'auth_google_service_account.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AuthGoogleServiceAccount _$AuthGoogleServiceAccountFromJson( + Map json) => + $checkedCreate( + 'AuthGoogleServiceAccount', + json, + ($checkedConvert) { + final val = AuthGoogleServiceAccount( + clientEmail: $checkedConvert('clientEmail', (v) => v as String), + privateKey: $checkedConvert('privateKey', (v) => v as String), + ); + return val; + }, + ); + +Map _$AuthGoogleServiceAccountToJson( + AuthGoogleServiceAccount instance) => + { + 'clientEmail': instance.clientEmail, + 'privateKey': instance.privateKey, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_google_service_account_partial.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_google_service_account_partial.dart new file mode 100644 index 0000000000..7da84f232d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_google_service_account_partial.dart @@ -0,0 +1,44 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'auth_google_service_account_partial.g.dart'; + +@JsonSerializable() +final class AuthGoogleServiceAccountPartial { + /// Returns a new [AuthGoogleServiceAccountPartial] instance. + const AuthGoogleServiceAccountPartial({ + this.clientEmail, + this.privateKey, + }); + + /// Email address of the Service Account. + @JsonKey(name: r'clientEmail') + final String? clientEmail; + + /// Private key of the Service Account. + @JsonKey(name: r'privateKey') + final String? privateKey; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AuthGoogleServiceAccountPartial && + other.clientEmail == clientEmail && + other.privateKey == privateKey; + + @override + int get hashCode => clientEmail.hashCode + privateKey.hashCode; + + factory AuthGoogleServiceAccountPartial.fromJson(Map json) => + _$AuthGoogleServiceAccountPartialFromJson(json); + + Map toJson() => + _$AuthGoogleServiceAccountPartialToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_google_service_account_partial.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_google_service_account_partial.g.dart new file mode 100644 index 0000000000..a97aa9d13d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_google_service_account_partial.g.dart @@ -0,0 +1,36 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'auth_google_service_account_partial.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AuthGoogleServiceAccountPartial _$AuthGoogleServiceAccountPartialFromJson( + Map json) => + $checkedCreate( + 'AuthGoogleServiceAccountPartial', + json, + ($checkedConvert) { + final val = AuthGoogleServiceAccountPartial( + clientEmail: $checkedConvert('clientEmail', (v) => v as String?), + privateKey: $checkedConvert('privateKey', (v) => v as String?), + ); + return val; + }, + ); + +Map _$AuthGoogleServiceAccountPartialToJson( + AuthGoogleServiceAccountPartial instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('clientEmail', instance.clientEmail); + writeNotNull('privateKey', instance.privateKey); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_o_auth.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_o_auth.dart new file mode 100644 index 0000000000..08a276d5f7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_o_auth.dart @@ -0,0 +1,49 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'auth_o_auth.g.dart'; + +@JsonSerializable() +final class AuthOAuth { + /// Returns a new [AuthOAuth] instance. + const AuthOAuth({ + required this.url, + required this.clientId, + required this.clientSecret, + }); + + /// The OAuth endpoint URL. + @JsonKey(name: r'url') + final String url; + + /// The clientID. + @JsonKey(name: r'client_id') + final String clientId; + + /// The secret. + @JsonKey(name: r'client_secret') + final String clientSecret; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AuthOAuth && + other.url == url && + other.clientId == clientId && + other.clientSecret == clientSecret; + + @override + int get hashCode => url.hashCode + clientId.hashCode + clientSecret.hashCode; + + factory AuthOAuth.fromJson(Map json) => + _$AuthOAuthFromJson(json); + + Map toJson() => _$AuthOAuthToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_o_auth.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_o_auth.g.dart new file mode 100644 index 0000000000..bc39bc286c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_o_auth.g.dart @@ -0,0 +1,30 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'auth_o_auth.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AuthOAuth _$AuthOAuthFromJson(Map json) => $checkedCreate( + 'AuthOAuth', + json, + ($checkedConvert) { + final val = AuthOAuth( + url: $checkedConvert('url', (v) => v as String), + clientId: $checkedConvert('client_id', (v) => v as String), + clientSecret: $checkedConvert('client_secret', (v) => v as String), + ); + return val; + }, + fieldKeyMap: const { + 'clientId': 'client_id', + 'clientSecret': 'client_secret' + }, + ); + +Map _$AuthOAuthToJson(AuthOAuth instance) => { + 'url': instance.url, + 'client_id': instance.clientId, + 'client_secret': instance.clientSecret, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_o_auth_partial.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_o_auth_partial.dart new file mode 100644 index 0000000000..2b7e369267 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_o_auth_partial.dart @@ -0,0 +1,49 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'auth_o_auth_partial.g.dart'; + +@JsonSerializable() +final class AuthOAuthPartial { + /// Returns a new [AuthOAuthPartial] instance. + const AuthOAuthPartial({ + this.url, + this.clientId, + this.clientSecret, + }); + + /// The OAuth endpoint URL. + @JsonKey(name: r'url') + final String? url; + + /// The clientID. + @JsonKey(name: r'client_id') + final String? clientId; + + /// The secret. + @JsonKey(name: r'client_secret') + final String? clientSecret; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AuthOAuthPartial && + other.url == url && + other.clientId == clientId && + other.clientSecret == clientSecret; + + @override + int get hashCode => url.hashCode + clientId.hashCode + clientSecret.hashCode; + + factory AuthOAuthPartial.fromJson(Map json) => + _$AuthOAuthPartialFromJson(json); + + Map toJson() => _$AuthOAuthPartialToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_o_auth_partial.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_o_auth_partial.g.dart new file mode 100644 index 0000000000..8c66b3453d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/auth_o_auth_partial.g.dart @@ -0,0 +1,40 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'auth_o_auth_partial.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AuthOAuthPartial _$AuthOAuthPartialFromJson(Map json) => + $checkedCreate( + 'AuthOAuthPartial', + json, + ($checkedConvert) { + final val = AuthOAuthPartial( + url: $checkedConvert('url', (v) => v as String?), + clientId: $checkedConvert('client_id', (v) => v as String?), + clientSecret: $checkedConvert('client_secret', (v) => v as String?), + ); + return val; + }, + fieldKeyMap: const { + 'clientId': 'client_id', + 'clientSecret': 'client_secret' + }, + ); + +Map _$AuthOAuthPartialToJson(AuthOAuthPartial instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('url', instance.url); + writeNotNull('client_id', instance.clientId); + writeNotNull('client_secret', instance.clientSecret); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication.dart new file mode 100644 index 0000000000..66bf113011 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication.dart @@ -0,0 +1,85 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/authentication_type.dart'; +import 'package:algolia_client_ingestion/src/model/platform.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'authentication.g.dart'; + +@JsonSerializable() +final class Authentication { + /// Returns a new [Authentication] instance. + const Authentication({ + required this.authenticationID, + required this.type, + required this.name, + this.platform, + required this.input, + required this.createdAt, + this.updatedAt, + }); + + /// The authentication UUID. + @JsonKey(name: r'authenticationID') + final String authenticationID; + + @JsonKey(name: r'type') + final AuthenticationType type; + + /// An human readable name describing the object. + @JsonKey(name: r'name') + final String name; + + @JsonKey(name: r'platform') + final Platform? platform; + + /// One of types: + /// - [AuthBasic] + /// - [AuthOAuth] + /// - [AuthGoogleServiceAccount] + /// - [AuthAlgolia] + /// - [AuthAPIKey] + @JsonKey(name: r'input') + final dynamic input; + + /// Date of creation (RFC3339 format). + @JsonKey(name: r'createdAt') + final String createdAt; + + /// Date of last update (RFC3339 format). + @JsonKey(name: r'updatedAt') + final String? updatedAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Authentication && + other.authenticationID == authenticationID && + other.type == type && + other.name == name && + other.platform == platform && + other.input == input && + other.createdAt == createdAt && + other.updatedAt == updatedAt; + + @override + int get hashCode => + authenticationID.hashCode + + type.hashCode + + name.hashCode + + platform.hashCode + + input.hashCode + + createdAt.hashCode + + updatedAt.hashCode; + + factory Authentication.fromJson(Map json) => + _$AuthenticationFromJson(json); + + Map toJson() => _$AuthenticationToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication.g.dart new file mode 100644 index 0000000000..e99e5d91c6 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication.g.dart @@ -0,0 +1,61 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'authentication.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Authentication _$AuthenticationFromJson(Map json) => + $checkedCreate( + 'Authentication', + json, + ($checkedConvert) { + final val = Authentication( + authenticationID: + $checkedConvert('authenticationID', (v) => v as String), + type: $checkedConvert( + 'type', (v) => $enumDecode(_$AuthenticationTypeEnumMap, v)), + name: $checkedConvert('name', (v) => v as String), + platform: $checkedConvert( + 'platform', (v) => $enumDecodeNullable(_$PlatformEnumMap, v)), + input: $checkedConvert('input', (v) => v), + createdAt: $checkedConvert('createdAt', (v) => v as String), + updatedAt: $checkedConvert('updatedAt', (v) => v as String?), + ); + return val; + }, + ); + +Map _$AuthenticationToJson(Authentication instance) { + final val = { + 'authenticationID': instance.authenticationID, + 'type': instance.type.toJson(), + 'name': instance.name, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('platform', instance.platform?.toJson()); + writeNotNull('input', instance.input); + val['createdAt'] = instance.createdAt; + writeNotNull('updatedAt', instance.updatedAt); + return val; +} + +const _$AuthenticationTypeEnumMap = { + AuthenticationType.googleServiceAccount: 'googleServiceAccount', + AuthenticationType.basic: 'basic', + AuthenticationType.apiKey: 'apiKey', + AuthenticationType.oauth: 'oauth', + AuthenticationType.algolia: 'algolia', +}; + +const _$PlatformEnumMap = { + Platform.bigcommerce: 'bigcommerce', + Platform.commercetools: 'commercetools', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_create.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_create.dart new file mode 100644 index 0000000000..03696dd8c7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_create.dart @@ -0,0 +1,61 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/authentication_type.dart'; +import 'package:algolia_client_ingestion/src/model/platform.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'authentication_create.g.dart'; + +@JsonSerializable() +final class AuthenticationCreate { + /// Returns a new [AuthenticationCreate] instance. + const AuthenticationCreate({ + required this.type, + required this.name, + this.platform, + required this.input, + }); + + @JsonKey(name: r'type') + final AuthenticationType type; + + /// An human readable name describing the object. + @JsonKey(name: r'name') + final String name; + + @JsonKey(name: r'platform') + final Platform? platform; + + /// One of types: + /// - [AuthBasic] + /// - [AuthOAuth] + /// - [AuthGoogleServiceAccount] + /// - [AuthAlgolia] + /// - [AuthAPIKey] + @JsonKey(name: r'input') + final dynamic input; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AuthenticationCreate && + other.type == type && + other.name == name && + other.platform == platform && + other.input == input; + + @override + int get hashCode => + type.hashCode + name.hashCode + platform.hashCode + input.hashCode; + + factory AuthenticationCreate.fromJson(Map json) => + _$AuthenticationCreateFromJson(json); + + Map toJson() => _$AuthenticationCreateToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_create.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_create.g.dart new file mode 100644 index 0000000000..e39c2bdab9 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_create.g.dart @@ -0,0 +1,56 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'authentication_create.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AuthenticationCreate _$AuthenticationCreateFromJson( + Map json) => + $checkedCreate( + 'AuthenticationCreate', + json, + ($checkedConvert) { + final val = AuthenticationCreate( + type: $checkedConvert( + 'type', (v) => $enumDecode(_$AuthenticationTypeEnumMap, v)), + name: $checkedConvert('name', (v) => v as String), + platform: $checkedConvert( + 'platform', (v) => $enumDecodeNullable(_$PlatformEnumMap, v)), + input: $checkedConvert('input', (v) => v), + ); + return val; + }, + ); + +Map _$AuthenticationCreateToJson( + AuthenticationCreate instance) { + final val = { + 'type': instance.type.toJson(), + 'name': instance.name, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('platform', instance.platform?.toJson()); + writeNotNull('input', instance.input); + return val; +} + +const _$AuthenticationTypeEnumMap = { + AuthenticationType.googleServiceAccount: 'googleServiceAccount', + AuthenticationType.basic: 'basic', + AuthenticationType.apiKey: 'apiKey', + AuthenticationType.oauth: 'oauth', + AuthenticationType.algolia: 'algolia', +}; + +const _$PlatformEnumMap = { + Platform.bigcommerce: 'bigcommerce', + Platform.commercetools: 'commercetools', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_create_response.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_create_response.dart new file mode 100644 index 0000000000..b1f47976c4 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_create_response.dart @@ -0,0 +1,50 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'authentication_create_response.g.dart'; + +@JsonSerializable() +final class AuthenticationCreateResponse { + /// Returns a new [AuthenticationCreateResponse] instance. + const AuthenticationCreateResponse({ + required this.authenticationID, + required this.name, + required this.createdAt, + }); + + /// The authentication UUID. + @JsonKey(name: r'authenticationID') + final String authenticationID; + + /// An human readable name describing the object. + @JsonKey(name: r'name') + final String name; + + /// Date of creation (RFC3339 format). + @JsonKey(name: r'createdAt') + final String createdAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AuthenticationCreateResponse && + other.authenticationID == authenticationID && + other.name == name && + other.createdAt == createdAt; + + @override + int get hashCode => + authenticationID.hashCode + name.hashCode + createdAt.hashCode; + + factory AuthenticationCreateResponse.fromJson(Map json) => + _$AuthenticationCreateResponseFromJson(json); + + Map toJson() => _$AuthenticationCreateResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_create_response.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_create_response.g.dart new file mode 100644 index 0000000000..cdb3bd3483 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_create_response.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'authentication_create_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AuthenticationCreateResponse _$AuthenticationCreateResponseFromJson( + Map json) => + $checkedCreate( + 'AuthenticationCreateResponse', + json, + ($checkedConvert) { + final val = AuthenticationCreateResponse( + authenticationID: + $checkedConvert('authenticationID', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + createdAt: $checkedConvert('createdAt', (v) => v as String), + ); + return val; + }, + ); + +Map _$AuthenticationCreateResponseToJson( + AuthenticationCreateResponse instance) => + { + 'authenticationID': instance.authenticationID, + 'name': instance.name, + 'createdAt': instance.createdAt, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_search.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_search.dart new file mode 100644 index 0000000000..066ebb084d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_search.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'authentication_search.g.dart'; + +@JsonSerializable() +final class AuthenticationSearch { + /// Returns a new [AuthenticationSearch] instance. + const AuthenticationSearch({ + required this.authenticationIDs, + }); + + @JsonKey(name: r'authenticationIDs') + final List authenticationIDs; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AuthenticationSearch && + other.authenticationIDs == authenticationIDs; + + @override + int get hashCode => authenticationIDs.hashCode; + + factory AuthenticationSearch.fromJson(Map json) => + _$AuthenticationSearchFromJson(json); + + Map toJson() => _$AuthenticationSearchToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_search.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_search.g.dart new file mode 100644 index 0000000000..95101d3237 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_search.g.dart @@ -0,0 +1,27 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'authentication_search.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AuthenticationSearch _$AuthenticationSearchFromJson( + Map json) => + $checkedCreate( + 'AuthenticationSearch', + json, + ($checkedConvert) { + final val = AuthenticationSearch( + authenticationIDs: $checkedConvert('authenticationIDs', + (v) => (v as List).map((e) => e as String).toList()), + ); + return val; + }, + ); + +Map _$AuthenticationSearchToJson( + AuthenticationSearch instance) => + { + 'authenticationIDs': instance.authenticationIDs, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_sort_keys.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_sort_keys.dart new file mode 100644 index 0000000000..ffdd905434 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_sort_keys.dart @@ -0,0 +1,37 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Used to sort the Authentication list endpoint. +@JsonEnum(valueField: 'raw') +enum AuthenticationSortKeys { + /// Used to sort the Authentication list endpoint. + name(r'name'), + + /// Used to sort the Authentication list endpoint. + authType(r'auth_type'), + + /// Used to sort the Authentication list endpoint. + platform(r'platform'), + + /// Used to sort the Authentication list endpoint. + updatedAt(r'updatedAt'), + + /// Used to sort the Authentication list endpoint. + createdAt(r'createdAt'); + + const AuthenticationSortKeys(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static AuthenticationSortKeys fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_type.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_type.dart new file mode 100644 index 0000000000..21a9dc220c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_type.dart @@ -0,0 +1,37 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Type of the Authentication, defines what kind of object is stored in the input. +@JsonEnum(valueField: 'raw') +enum AuthenticationType { + /// Type of the Authentication, defines what kind of object is stored in the input. + googleServiceAccount(r'googleServiceAccount'), + + /// Type of the Authentication, defines what kind of object is stored in the input. + basic(r'basic'), + + /// Type of the Authentication, defines what kind of object is stored in the input. + apiKey(r'apiKey'), + + /// Type of the Authentication, defines what kind of object is stored in the input. + oauth(r'oauth'), + + /// Type of the Authentication, defines what kind of object is stored in the input. + algolia(r'algolia'); + + const AuthenticationType(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static AuthenticationType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_update.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_update.dart new file mode 100644 index 0000000000..ce4f90da63 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_update.dart @@ -0,0 +1,61 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/authentication_type.dart'; +import 'package:algolia_client_ingestion/src/model/platform.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'authentication_update.g.dart'; + +@JsonSerializable() +final class AuthenticationUpdate { + /// Returns a new [AuthenticationUpdate] instance. + const AuthenticationUpdate({ + this.type, + this.name, + this.platform, + this.input, + }); + + @JsonKey(name: r'type') + final AuthenticationType? type; + + /// An human readable name describing the object. + @JsonKey(name: r'name') + final String? name; + + @JsonKey(name: r'platform') + final Platform? platform; + + /// One of types: + /// - [AuthOAuthPartial] + /// - [AuthBasicPartial] + /// - [AuthGoogleServiceAccountPartial] + /// - [AuthAPIKeyPartial] + /// - [AuthAlgoliaPartial] + @JsonKey(name: r'input') + final dynamic input; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AuthenticationUpdate && + other.type == type && + other.name == name && + other.platform == platform && + other.input == input; + + @override + int get hashCode => + type.hashCode + name.hashCode + platform.hashCode + input.hashCode; + + factory AuthenticationUpdate.fromJson(Map json) => + _$AuthenticationUpdateFromJson(json); + + Map toJson() => _$AuthenticationUpdateToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_update.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_update.g.dart new file mode 100644 index 0000000000..bba1bd0ead --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_update.g.dart @@ -0,0 +1,55 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'authentication_update.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AuthenticationUpdate _$AuthenticationUpdateFromJson( + Map json) => + $checkedCreate( + 'AuthenticationUpdate', + json, + ($checkedConvert) { + final val = AuthenticationUpdate( + type: $checkedConvert('type', + (v) => $enumDecodeNullable(_$AuthenticationTypeEnumMap, v)), + name: $checkedConvert('name', (v) => v as String?), + platform: $checkedConvert( + 'platform', (v) => $enumDecodeNullable(_$PlatformEnumMap, v)), + input: $checkedConvert('input', (v) => v), + ); + return val; + }, + ); + +Map _$AuthenticationUpdateToJson( + AuthenticationUpdate instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('type', instance.type?.toJson()); + writeNotNull('name', instance.name); + writeNotNull('platform', instance.platform?.toJson()); + writeNotNull('input', instance.input); + return val; +} + +const _$AuthenticationTypeEnumMap = { + AuthenticationType.googleServiceAccount: 'googleServiceAccount', + AuthenticationType.basic: 'basic', + AuthenticationType.apiKey: 'apiKey', + AuthenticationType.oauth: 'oauth', + AuthenticationType.algolia: 'algolia', +}; + +const _$PlatformEnumMap = { + Platform.bigcommerce: 'bigcommerce', + Platform.commercetools: 'commercetools', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_update_response.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_update_response.dart new file mode 100644 index 0000000000..f0b1e47e83 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_update_response.dart @@ -0,0 +1,50 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'authentication_update_response.g.dart'; + +@JsonSerializable() +final class AuthenticationUpdateResponse { + /// Returns a new [AuthenticationUpdateResponse] instance. + const AuthenticationUpdateResponse({ + required this.authenticationID, + required this.name, + required this.updatedAt, + }); + + /// The authentication UUID. + @JsonKey(name: r'authenticationID') + final String authenticationID; + + /// An human readable name describing the object. + @JsonKey(name: r'name') + final String name; + + /// Date of last update (RFC3339 format). + @JsonKey(name: r'updatedAt') + final String updatedAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AuthenticationUpdateResponse && + other.authenticationID == authenticationID && + other.name == name && + other.updatedAt == updatedAt; + + @override + int get hashCode => + authenticationID.hashCode + name.hashCode + updatedAt.hashCode; + + factory AuthenticationUpdateResponse.fromJson(Map json) => + _$AuthenticationUpdateResponseFromJson(json); + + Map toJson() => _$AuthenticationUpdateResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_update_response.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_update_response.g.dart new file mode 100644 index 0000000000..e112e6c67a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/authentication_update_response.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'authentication_update_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AuthenticationUpdateResponse _$AuthenticationUpdateResponseFromJson( + Map json) => + $checkedCreate( + 'AuthenticationUpdateResponse', + json, + ($checkedConvert) { + final val = AuthenticationUpdateResponse( + authenticationID: + $checkedConvert('authenticationID', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + updatedAt: $checkedConvert('updatedAt', (v) => v as String), + ); + return val; + }, + ); + +Map _$AuthenticationUpdateResponseToJson( + AuthenticationUpdateResponse instance) => + { + 'authenticationID': instance.authenticationID, + 'name': instance.name, + 'updatedAt': instance.updatedAt, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/big_commerce_channel.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/big_commerce_channel.dart new file mode 100644 index 0000000000..467ddbaef5 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/big_commerce_channel.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'big_commerce_channel.g.dart'; + +@JsonSerializable() +final class BigCommerceChannel { + /// Returns a new [BigCommerceChannel] instance. + const BigCommerceChannel({ + required this.id, + this.currencies, + }); + + /// The ID of the bigcommerce channel. + @JsonKey(name: r'id') + final int id; + + /// An array of currencies for the given channel `ID`, a currency is a trigram string that represents the currency code. + @JsonKey(name: r'currencies') + final List? currencies; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BigCommerceChannel && + other.id == id && + other.currencies == currencies; + + @override + int get hashCode => id.hashCode + currencies.hashCode; + + factory BigCommerceChannel.fromJson(Map json) => + _$BigCommerceChannelFromJson(json); + + Map toJson() => _$BigCommerceChannelToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/big_commerce_channel.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/big_commerce_channel.g.dart new file mode 100644 index 0000000000..59e86ba368 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/big_commerce_channel.g.dart @@ -0,0 +1,36 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'big_commerce_channel.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BigCommerceChannel _$BigCommerceChannelFromJson(Map json) => + $checkedCreate( + 'BigCommerceChannel', + json, + ($checkedConvert) { + final val = BigCommerceChannel( + id: $checkedConvert('id', (v) => v as int), + currencies: $checkedConvert('currencies', + (v) => (v as List?)?.map((e) => e as String).toList()), + ); + return val; + }, + ); + +Map _$BigCommerceChannelToJson(BigCommerceChannel instance) { + final val = { + 'id': instance.id, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('currencies', instance.currencies); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/big_query_data_type.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/big_query_data_type.dart new file mode 100644 index 0000000000..2797da38ad --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/big_query_data_type.dart @@ -0,0 +1,24 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum BigQueryDataType { + ga4(r'ga4'), + ga360(r'ga360'); + + const BigQueryDataType(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static BigQueryDataType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/delete_response.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/delete_response.dart new file mode 100644 index 0000000000..69c4b4e069 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/delete_response.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'delete_response.g.dart'; + +@JsonSerializable() +final class DeleteResponse { + /// Returns a new [DeleteResponse] instance. + const DeleteResponse({ + required this.deletedAt, + }); + + /// Date of deletion (RFC3339 format). + @JsonKey(name: r'deletedAt') + final String deletedAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is DeleteResponse && other.deletedAt == deletedAt; + + @override + int get hashCode => deletedAt.hashCode; + + factory DeleteResponse.fromJson(Map json) => + _$DeleteResponseFromJson(json); + + Map toJson() => _$DeleteResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/delete_response.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/delete_response.g.dart new file mode 100644 index 0000000000..d4141addfc --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/delete_response.g.dart @@ -0,0 +1,24 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'delete_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +DeleteResponse _$DeleteResponseFromJson(Map json) => + $checkedCreate( + 'DeleteResponse', + json, + ($checkedConvert) { + final val = DeleteResponse( + deletedAt: $checkedConvert('deletedAt', (v) => v as String), + ); + return val; + }, + ); + +Map _$DeleteResponseToJson(DeleteResponse instance) => + { + 'deletedAt': instance.deletedAt, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination.dart new file mode 100644 index 0000000000..20d158dfc5 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination.dart @@ -0,0 +1,81 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/destination_type.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'destination.g.dart'; + +@JsonSerializable() +final class Destination { + /// Returns a new [Destination] instance. + const Destination({ + required this.destinationID, + required this.type, + required this.name, + required this.input, + required this.createdAt, + this.updatedAt, + this.authenticationID, + }); + + /// The destination UUID. + @JsonKey(name: r'destinationID') + final String destinationID; + + @JsonKey(name: r'type') + final DestinationType type; + + /// An human readable name describing the object. + @JsonKey(name: r'name') + final String name; + + /// One of types: + /// - [DestinationIndexName] + /// - [DestinationIndexPrefix] + @JsonKey(name: r'input') + final dynamic input; + + /// Date of creation (RFC3339 format). + @JsonKey(name: r'createdAt') + final String createdAt; + + /// Date of last update (RFC3339 format). + @JsonKey(name: r'updatedAt') + final String? updatedAt; + + @JsonKey(name: r'authenticationID') + final String? authenticationID; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Destination && + other.destinationID == destinationID && + other.type == type && + other.name == name && + other.input == input && + other.createdAt == createdAt && + other.updatedAt == updatedAt && + other.authenticationID == authenticationID; + + @override + int get hashCode => + destinationID.hashCode + + type.hashCode + + name.hashCode + + input.hashCode + + createdAt.hashCode + + updatedAt.hashCode + + authenticationID.hashCode; + + factory Destination.fromJson(Map json) => + _$DestinationFromJson(json); + + Map toJson() => _$DestinationToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination.g.dart new file mode 100644 index 0000000000..b94df8e929 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination.g.dart @@ -0,0 +1,53 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'destination.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Destination _$DestinationFromJson(Map json) => $checkedCreate( + 'Destination', + json, + ($checkedConvert) { + final val = Destination( + destinationID: $checkedConvert('destinationID', (v) => v as String), + type: $checkedConvert( + 'type', (v) => $enumDecode(_$DestinationTypeEnumMap, v)), + name: $checkedConvert('name', (v) => v as String), + input: $checkedConvert('input', (v) => v), + createdAt: $checkedConvert('createdAt', (v) => v as String), + updatedAt: $checkedConvert('updatedAt', (v) => v as String?), + authenticationID: + $checkedConvert('authenticationID', (v) => v as String?), + ); + return val; + }, + ); + +Map _$DestinationToJson(Destination instance) { + final val = { + 'destinationID': instance.destinationID, + 'type': instance.type.toJson(), + 'name': instance.name, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('input', instance.input); + val['createdAt'] = instance.createdAt; + writeNotNull('updatedAt', instance.updatedAt); + writeNotNull('authenticationID', instance.authenticationID); + return val; +} + +const _$DestinationTypeEnumMap = { + DestinationType.search: 'search', + DestinationType.insights: 'insights', + DestinationType.flow: 'flow', + DestinationType.predict: 'predict', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_create.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_create.dart new file mode 100644 index 0000000000..bec46d7263 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_create.dart @@ -0,0 +1,61 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/destination_type.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'destination_create.g.dart'; + +@JsonSerializable() +final class DestinationCreate { + /// Returns a new [DestinationCreate] instance. + const DestinationCreate({ + required this.type, + required this.name, + required this.input, + this.authenticationID, + }); + + @JsonKey(name: r'type') + final DestinationType type; + + /// An human readable name describing the object. + @JsonKey(name: r'name') + final String name; + + /// One of types: + /// - [DestinationIndexName] + /// - [DestinationIndexPrefix] + @JsonKey(name: r'input') + final dynamic input; + + /// The authentication UUID. + @JsonKey(name: r'authenticationID') + final String? authenticationID; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is DestinationCreate && + other.type == type && + other.name == name && + other.input == input && + other.authenticationID == authenticationID; + + @override + int get hashCode => + type.hashCode + + name.hashCode + + input.hashCode + + authenticationID.hashCode; + + factory DestinationCreate.fromJson(Map json) => + _$DestinationCreateFromJson(json); + + Map toJson() => _$DestinationCreateToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_create.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_create.g.dart new file mode 100644 index 0000000000..f757100ccd --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_create.g.dart @@ -0,0 +1,48 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'destination_create.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +DestinationCreate _$DestinationCreateFromJson(Map json) => + $checkedCreate( + 'DestinationCreate', + json, + ($checkedConvert) { + final val = DestinationCreate( + type: $checkedConvert( + 'type', (v) => $enumDecode(_$DestinationTypeEnumMap, v)), + name: $checkedConvert('name', (v) => v as String), + input: $checkedConvert('input', (v) => v), + authenticationID: + $checkedConvert('authenticationID', (v) => v as String?), + ); + return val; + }, + ); + +Map _$DestinationCreateToJson(DestinationCreate instance) { + final val = { + 'type': instance.type.toJson(), + 'name': instance.name, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('input', instance.input); + writeNotNull('authenticationID', instance.authenticationID); + return val; +} + +const _$DestinationTypeEnumMap = { + DestinationType.search: 'search', + DestinationType.insights: 'insights', + DestinationType.flow: 'flow', + DestinationType.predict: 'predict', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_create_response.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_create_response.dart new file mode 100644 index 0000000000..ba80f87ec2 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_create_response.dart @@ -0,0 +1,50 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'destination_create_response.g.dart'; + +@JsonSerializable() +final class DestinationCreateResponse { + /// Returns a new [DestinationCreateResponse] instance. + const DestinationCreateResponse({ + required this.destinationID, + required this.name, + required this.createdAt, + }); + + /// The destination UUID. + @JsonKey(name: r'destinationID') + final String destinationID; + + /// An human readable name describing the object. + @JsonKey(name: r'name') + final String name; + + /// Date of creation (RFC3339 format). + @JsonKey(name: r'createdAt') + final String createdAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is DestinationCreateResponse && + other.destinationID == destinationID && + other.name == name && + other.createdAt == createdAt; + + @override + int get hashCode => + destinationID.hashCode + name.hashCode + createdAt.hashCode; + + factory DestinationCreateResponse.fromJson(Map json) => + _$DestinationCreateResponseFromJson(json); + + Map toJson() => _$DestinationCreateResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_create_response.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_create_response.g.dart new file mode 100644 index 0000000000..2af90f5cf3 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_create_response.g.dart @@ -0,0 +1,30 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'destination_create_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +DestinationCreateResponse _$DestinationCreateResponseFromJson( + Map json) => + $checkedCreate( + 'DestinationCreateResponse', + json, + ($checkedConvert) { + final val = DestinationCreateResponse( + destinationID: $checkedConvert('destinationID', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + createdAt: $checkedConvert('createdAt', (v) => v as String), + ); + return val; + }, + ); + +Map _$DestinationCreateResponseToJson( + DestinationCreateResponse instance) => + { + 'destinationID': instance.destinationID, + 'name': instance.name, + 'createdAt': instance.createdAt, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_index_name.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_index_name.dart new file mode 100644 index 0000000000..a46d06da4d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_index_name.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'destination_index_name.g.dart'; + +@JsonSerializable() +final class DestinationIndexName { + /// Returns a new [DestinationIndexName] instance. + const DestinationIndexName({ + required this.indexName, + }); + + /// The index name to store data in. + @JsonKey(name: r'indexName') + final String indexName; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is DestinationIndexName && other.indexName == indexName; + + @override + int get hashCode => indexName.hashCode; + + factory DestinationIndexName.fromJson(Map json) => + _$DestinationIndexNameFromJson(json); + + Map toJson() => _$DestinationIndexNameToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_index_name.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_index_name.g.dart new file mode 100644 index 0000000000..a90cbf3e12 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_index_name.g.dart @@ -0,0 +1,26 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'destination_index_name.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +DestinationIndexName _$DestinationIndexNameFromJson( + Map json) => + $checkedCreate( + 'DestinationIndexName', + json, + ($checkedConvert) { + final val = DestinationIndexName( + indexName: $checkedConvert('indexName', (v) => v as String), + ); + return val; + }, + ); + +Map _$DestinationIndexNameToJson( + DestinationIndexName instance) => + { + 'indexName': instance.indexName, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_index_prefix.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_index_prefix.dart new file mode 100644 index 0000000000..b859ad36d3 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_index_prefix.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'destination_index_prefix.g.dart'; + +@JsonSerializable() +final class DestinationIndexPrefix { + /// Returns a new [DestinationIndexPrefix] instance. + const DestinationIndexPrefix({ + required this.indexPrefix, + }); + + /// The prefix of the final index name. + @JsonKey(name: r'indexPrefix') + final String indexPrefix; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is DestinationIndexPrefix && other.indexPrefix == indexPrefix; + + @override + int get hashCode => indexPrefix.hashCode; + + factory DestinationIndexPrefix.fromJson(Map json) => + _$DestinationIndexPrefixFromJson(json); + + Map toJson() => _$DestinationIndexPrefixToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_index_prefix.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_index_prefix.g.dart new file mode 100644 index 0000000000..09ca53c19b --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_index_prefix.g.dart @@ -0,0 +1,26 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'destination_index_prefix.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +DestinationIndexPrefix _$DestinationIndexPrefixFromJson( + Map json) => + $checkedCreate( + 'DestinationIndexPrefix', + json, + ($checkedConvert) { + final val = DestinationIndexPrefix( + indexPrefix: $checkedConvert('indexPrefix', (v) => v as String), + ); + return val; + }, + ); + +Map _$DestinationIndexPrefixToJson( + DestinationIndexPrefix instance) => + { + 'indexPrefix': instance.indexPrefix, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_search.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_search.dart new file mode 100644 index 0000000000..bc35621fa7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_search.dart @@ -0,0 +1,35 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'destination_search.g.dart'; + +@JsonSerializable() +final class DestinationSearch { + /// Returns a new [DestinationSearch] instance. + const DestinationSearch({ + required this.destinationIDs, + }); + + @JsonKey(name: r'destinationIDs') + final List destinationIDs; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is DestinationSearch && other.destinationIDs == destinationIDs; + + @override + int get hashCode => destinationIDs.hashCode; + + factory DestinationSearch.fromJson(Map json) => + _$DestinationSearchFromJson(json); + + Map toJson() => _$DestinationSearchToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_search.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_search.g.dart new file mode 100644 index 0000000000..e2ab611235 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_search.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'destination_search.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +DestinationSearch _$DestinationSearchFromJson(Map json) => + $checkedCreate( + 'DestinationSearch', + json, + ($checkedConvert) { + final val = DestinationSearch( + destinationIDs: $checkedConvert('destinationIDs', + (v) => (v as List).map((e) => e as String).toList()), + ); + return val; + }, + ); + +Map _$DestinationSearchToJson(DestinationSearch instance) => + { + 'destinationIDs': instance.destinationIDs, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_sort_keys.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_sort_keys.dart new file mode 100644 index 0000000000..23ec98b876 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_sort_keys.dart @@ -0,0 +1,34 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Used to sort the Destination list endpoint. +@JsonEnum(valueField: 'raw') +enum DestinationSortKeys { + /// Used to sort the Destination list endpoint. + name(r'name'), + + /// Used to sort the Destination list endpoint. + type(r'type'), + + /// Used to sort the Destination list endpoint. + updatedAt(r'updatedAt'), + + /// Used to sort the Destination list endpoint. + createdAt(r'createdAt'); + + const DestinationSortKeys(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static DestinationSortKeys fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_type.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_type.dart new file mode 100644 index 0000000000..1d1538a52d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_type.dart @@ -0,0 +1,34 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Type of the Destination, defines in which Algolia product the data will be stored. +@JsonEnum(valueField: 'raw') +enum DestinationType { + /// Type of the Destination, defines in which Algolia product the data will be stored. + search(r'search'), + + /// Type of the Destination, defines in which Algolia product the data will be stored. + insights(r'insights'), + + /// Type of the Destination, defines in which Algolia product the data will be stored. + flow(r'flow'), + + /// Type of the Destination, defines in which Algolia product the data will be stored. + predict(r'predict'); + + const DestinationType(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static DestinationType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_update.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_update.dart new file mode 100644 index 0000000000..0dead8528b --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_update.dart @@ -0,0 +1,60 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/destination_type.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'destination_update.g.dart'; + +@JsonSerializable() +final class DestinationUpdate { + /// Returns a new [DestinationUpdate] instance. + const DestinationUpdate({ + this.type, + this.name, + this.input, + this.authenticationID, + }); + + @JsonKey(name: r'type') + final DestinationType? type; + + /// An human readable name describing the object. + @JsonKey(name: r'name') + final String? name; + + /// One of types: + /// - [DestinationIndexName] + /// - [DestinationIndexPrefix] + @JsonKey(name: r'input') + final dynamic input; + + @JsonKey(name: r'authenticationID') + final String? authenticationID; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is DestinationUpdate && + other.type == type && + other.name == name && + other.input == input && + other.authenticationID == authenticationID; + + @override + int get hashCode => + type.hashCode + + name.hashCode + + input.hashCode + + authenticationID.hashCode; + + factory DestinationUpdate.fromJson(Map json) => + _$DestinationUpdateFromJson(json); + + Map toJson() => _$DestinationUpdateToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_update.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_update.g.dart new file mode 100644 index 0000000000..f6d20139dd --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_update.g.dart @@ -0,0 +1,47 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'destination_update.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +DestinationUpdate _$DestinationUpdateFromJson(Map json) => + $checkedCreate( + 'DestinationUpdate', + json, + ($checkedConvert) { + final val = DestinationUpdate( + type: $checkedConvert( + 'type', (v) => $enumDecodeNullable(_$DestinationTypeEnumMap, v)), + name: $checkedConvert('name', (v) => v as String?), + input: $checkedConvert('input', (v) => v), + authenticationID: + $checkedConvert('authenticationID', (v) => v as String?), + ); + return val; + }, + ); + +Map _$DestinationUpdateToJson(DestinationUpdate instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('type', instance.type?.toJson()); + writeNotNull('name', instance.name); + writeNotNull('input', instance.input); + writeNotNull('authenticationID', instance.authenticationID); + return val; +} + +const _$DestinationTypeEnumMap = { + DestinationType.search: 'search', + DestinationType.insights: 'insights', + DestinationType.flow: 'flow', + DestinationType.predict: 'predict', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_update_response.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_update_response.dart new file mode 100644 index 0000000000..8b0f21994f --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_update_response.dart @@ -0,0 +1,50 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'destination_update_response.g.dart'; + +@JsonSerializable() +final class DestinationUpdateResponse { + /// Returns a new [DestinationUpdateResponse] instance. + const DestinationUpdateResponse({ + required this.destinationID, + required this.name, + required this.updatedAt, + }); + + /// The destination UUID. + @JsonKey(name: r'destinationID') + final String destinationID; + + /// An human readable name describing the object. + @JsonKey(name: r'name') + final String name; + + /// Date of last update (RFC3339 format). + @JsonKey(name: r'updatedAt') + final String updatedAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is DestinationUpdateResponse && + other.destinationID == destinationID && + other.name == name && + other.updatedAt == updatedAt; + + @override + int get hashCode => + destinationID.hashCode + name.hashCode + updatedAt.hashCode; + + factory DestinationUpdateResponse.fromJson(Map json) => + _$DestinationUpdateResponseFromJson(json); + + Map toJson() => _$DestinationUpdateResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_update_response.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_update_response.g.dart new file mode 100644 index 0000000000..e23c53ba3a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/destination_update_response.g.dart @@ -0,0 +1,30 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'destination_update_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +DestinationUpdateResponse _$DestinationUpdateResponseFromJson( + Map json) => + $checkedCreate( + 'DestinationUpdateResponse', + json, + ($checkedConvert) { + final val = DestinationUpdateResponse( + destinationID: $checkedConvert('destinationID', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + updatedAt: $checkedConvert('updatedAt', (v) => v as String), + ); + return val; + }, + ); + +Map _$DestinationUpdateResponseToJson( + DestinationUpdateResponse instance) => + { + 'destinationID': instance.destinationID, + 'name': instance.name, + 'updatedAt': instance.updatedAt, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/docker_image_type.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/docker_image_type.dart new file mode 100644 index 0000000000..c3f1c1dbb2 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/docker_image_type.dart @@ -0,0 +1,31 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// The type of the image. +@JsonEnum(valueField: 'raw') +enum DockerImageType { + /// The type of the image. + singer(r'singer'), + + /// The type of the image. + custom(r'custom'), + + /// The type of the image. + airbyte(r'airbyte'); + + const DockerImageType(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static DockerImageType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/docker_registry.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/docker_registry.dart new file mode 100644 index 0000000000..de650ee752 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/docker_registry.dart @@ -0,0 +1,28 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// The registry where the image is stored. +@JsonEnum(valueField: 'raw') +enum DockerRegistry { + /// The registry where the image is stored. + dockerhub(r'dockerhub'), + + /// The registry where the image is stored. + ghcr(r'ghcr'); + + const DockerRegistry(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static DockerRegistry fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/error_base.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/error_base.dart new file mode 100644 index 0000000000..df5d4ade57 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/error_base.dart @@ -0,0 +1,47 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:collection/collection.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'error_base.g.dart'; + +@JsonSerializable(createFieldMap: true) +final class ErrorBase extends DelegatingMap { + /// Returns a new [ErrorBase] instance. + const ErrorBase({ + this.message, + Map additionalProperties = const {}, + }) : super(additionalProperties); + + @JsonKey(name: r'message') + final String? message; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ErrorBase && + other.message == message && + const MapEquality().equals(this, this); + + @override + int get hashCode => + message.hashCode + const MapEquality().hash(this); + + factory ErrorBase.fromJson(Map json) { + final instance = _$ErrorBaseFromJson(json); + final additionalProperties = Map.from(json) + ..removeWhere((key, value) => _$ErrorBaseFieldMap.containsKey(key)); + return ErrorBase( + message: instance.message, + additionalProperties: additionalProperties, + ); + } + + Map toJson() => _$ErrorBaseToJson(this)..addAll(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/error_base.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/error_base.g.dart new file mode 100644 index 0000000000..f796166fb2 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/error_base.g.dart @@ -0,0 +1,35 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'error_base.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ErrorBase _$ErrorBaseFromJson(Map json) => $checkedCreate( + 'ErrorBase', + json, + ($checkedConvert) { + final val = ErrorBase( + message: $checkedConvert('message', (v) => v as String?), + ); + return val; + }, + ); + +const _$ErrorBaseFieldMap = { + 'message': 'message', +}; + +Map _$ErrorBaseToJson(ErrorBase instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('message', instance.message); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/event.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/event.dart new file mode 100644 index 0000000000..befc39da49 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/event.dart @@ -0,0 +1,78 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/event_type.dart'; +import 'package:algolia_client_ingestion/src/model/event_status.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'event.g.dart'; + +@JsonSerializable() +final class Event { + /// Returns a new [Event] instance. + const Event({ + required this.eventID, + required this.runID, + this.parentID, + required this.status, + required this.type, + this.data, + required this.publishedAt, + }); + + /// The event UUID. + @JsonKey(name: r'eventID') + final String eventID; + + /// The run UUID. + @JsonKey(name: r'runID') + final String runID; + + /// The parent event, the cause of this event. + @JsonKey(name: r'parentID') + final String? parentID; + + @JsonKey(name: r'status') + final EventStatus status; + + @JsonKey(name: r'type') + final EventType type; + + @JsonKey(name: r'data') + final Map? data; + + /// Date of publish (RFC3339 format). + @JsonKey(name: r'publishedAt') + final String publishedAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Event && + other.eventID == eventID && + other.runID == runID && + other.parentID == parentID && + other.status == status && + other.type == type && + other.data == data && + other.publishedAt == publishedAt; + + @override + int get hashCode => + eventID.hashCode + + runID.hashCode + + parentID.hashCode + + status.hashCode + + type.hashCode + + data.hashCode + + publishedAt.hashCode; + + factory Event.fromJson(Map json) => _$EventFromJson(json); + + Map toJson() => _$EventToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/event.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/event.g.dart new file mode 100644 index 0000000000..7a296e692b --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/event.g.dart @@ -0,0 +1,65 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'event.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Event _$EventFromJson(Map json) => $checkedCreate( + 'Event', + json, + ($checkedConvert) { + final val = Event( + eventID: $checkedConvert('eventID', (v) => v as String), + runID: $checkedConvert('runID', (v) => v as String), + parentID: $checkedConvert('parentID', (v) => v as String?), + status: $checkedConvert( + 'status', (v) => $enumDecode(_$EventStatusEnumMap, v)), + type: $checkedConvert( + 'type', (v) => $enumDecode(_$EventTypeEnumMap, v)), + data: $checkedConvert( + 'data', + (v) => (v as Map?)?.map( + (k, e) => MapEntry(k, e as Object), + )), + publishedAt: $checkedConvert('publishedAt', (v) => v as String), + ); + return val; + }, + ); + +Map _$EventToJson(Event instance) { + final val = { + 'eventID': instance.eventID, + 'runID': instance.runID, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('parentID', instance.parentID); + val['status'] = instance.status.toJson(); + val['type'] = instance.type.toJson(); + writeNotNull('data', instance.data); + val['publishedAt'] = instance.publishedAt; + return val; +} + +const _$EventStatusEnumMap = { + EventStatus.created: 'created', + EventStatus.started: 'started', + EventStatus.retried: 'retried', + EventStatus.failed: 'failed', + EventStatus.succeeded: 'succeeded', +}; + +const _$EventTypeEnumMap = { + EventType.fetch: 'fetch', + EventType.record: 'record', + EventType.log: 'log', + EventType.transform: 'transform', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/event_sort_keys.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/event_sort_keys.dart new file mode 100644 index 0000000000..b7e8970b84 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/event_sort_keys.dart @@ -0,0 +1,31 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Used to sort the Event list endpoint. +@JsonEnum(valueField: 'raw') +enum EventSortKeys { + /// Used to sort the Event list endpoint. + status(r'status'), + + /// Used to sort the Event list endpoint. + type(r'type'), + + /// Used to sort the Event list endpoint. + publishedAt(r'publishedAt'); + + const EventSortKeys(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static EventSortKeys fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/event_status.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/event_status.dart new file mode 100644 index 0000000000..d35f100fc3 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/event_status.dart @@ -0,0 +1,27 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum EventStatus { + created(r'created'), + started(r'started'), + retried(r'retried'), + failed(r'failed'), + succeeded(r'succeeded'); + + const EventStatus(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static EventStatus fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/event_type.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/event_type.dart new file mode 100644 index 0000000000..a36083fa60 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/event_type.dart @@ -0,0 +1,26 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum EventType { + fetch(r'fetch'), + record(r'record'), + log(r'log'), + transform(r'transform'); + + const EventType(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static EventType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_authentications_response.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_authentications_response.dart new file mode 100644 index 0000000000..702db796cc --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_authentications_response.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/pagination.dart'; +import 'package:algolia_client_ingestion/src/model/authentication.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'list_authentications_response.g.dart'; + +@JsonSerializable() +final class ListAuthenticationsResponse { + /// Returns a new [ListAuthenticationsResponse] instance. + const ListAuthenticationsResponse({ + required this.authentications, + required this.pagination, + }); + + @JsonKey(name: r'authentications') + final List authentications; + + @JsonKey(name: r'pagination') + final Pagination pagination; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ListAuthenticationsResponse && + other.authentications == authentications && + other.pagination == pagination; + + @override + int get hashCode => authentications.hashCode + pagination.hashCode; + + factory ListAuthenticationsResponse.fromJson(Map json) => + _$ListAuthenticationsResponseFromJson(json); + + Map toJson() => _$ListAuthenticationsResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_authentications_response.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_authentications_response.g.dart new file mode 100644 index 0000000000..d64ddfed97 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_authentications_response.g.dart @@ -0,0 +1,35 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'list_authentications_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ListAuthenticationsResponse _$ListAuthenticationsResponseFromJson( + Map json) => + $checkedCreate( + 'ListAuthenticationsResponse', + json, + ($checkedConvert) { + final val = ListAuthenticationsResponse( + authentications: $checkedConvert( + 'authentications', + (v) => (v as List) + .map( + (e) => Authentication.fromJson(e as Map)) + .toList()), + pagination: $checkedConvert('pagination', + (v) => Pagination.fromJson(v as Map)), + ); + return val; + }, + ); + +Map _$ListAuthenticationsResponseToJson( + ListAuthenticationsResponse instance) => + { + 'authentications': + instance.authentications.map((e) => e.toJson()).toList(), + 'pagination': instance.pagination.toJson(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_destinations_response.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_destinations_response.dart new file mode 100644 index 0000000000..e60f4b7bc7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_destinations_response.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/pagination.dart'; +import 'package:algolia_client_ingestion/src/model/destination.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'list_destinations_response.g.dart'; + +@JsonSerializable() +final class ListDestinationsResponse { + /// Returns a new [ListDestinationsResponse] instance. + const ListDestinationsResponse({ + required this.destinations, + required this.pagination, + }); + + @JsonKey(name: r'destinations') + final List destinations; + + @JsonKey(name: r'pagination') + final Pagination pagination; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ListDestinationsResponse && + other.destinations == destinations && + other.pagination == pagination; + + @override + int get hashCode => destinations.hashCode + pagination.hashCode; + + factory ListDestinationsResponse.fromJson(Map json) => + _$ListDestinationsResponseFromJson(json); + + Map toJson() => _$ListDestinationsResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_destinations_response.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_destinations_response.g.dart new file mode 100644 index 0000000000..3bd987ec86 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_destinations_response.g.dart @@ -0,0 +1,33 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'list_destinations_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ListDestinationsResponse _$ListDestinationsResponseFromJson( + Map json) => + $checkedCreate( + 'ListDestinationsResponse', + json, + ($checkedConvert) { + final val = ListDestinationsResponse( + destinations: $checkedConvert( + 'destinations', + (v) => (v as List) + .map((e) => Destination.fromJson(e as Map)) + .toList()), + pagination: $checkedConvert('pagination', + (v) => Pagination.fromJson(v as Map)), + ); + return val; + }, + ); + +Map _$ListDestinationsResponseToJson( + ListDestinationsResponse instance) => + { + 'destinations': instance.destinations.map((e) => e.toJson()).toList(), + 'pagination': instance.pagination.toJson(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_events_response.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_events_response.dart new file mode 100644 index 0000000000..28dac3aa68 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_events_response.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/pagination.dart'; +import 'package:algolia_client_ingestion/src/model/event.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'list_events_response.g.dart'; + +@JsonSerializable() +final class ListEventsResponse { + /// Returns a new [ListEventsResponse] instance. + const ListEventsResponse({ + required this.events, + required this.pagination, + }); + + @JsonKey(name: r'events') + final List events; + + @JsonKey(name: r'pagination') + final Pagination pagination; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ListEventsResponse && + other.events == events && + other.pagination == pagination; + + @override + int get hashCode => events.hashCode + pagination.hashCode; + + factory ListEventsResponse.fromJson(Map json) => + _$ListEventsResponseFromJson(json); + + Map toJson() => _$ListEventsResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_events_response.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_events_response.g.dart new file mode 100644 index 0000000000..592af6e203 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_events_response.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'list_events_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ListEventsResponse _$ListEventsResponseFromJson(Map json) => + $checkedCreate( + 'ListEventsResponse', + json, + ($checkedConvert) { + final val = ListEventsResponse( + events: $checkedConvert( + 'events', + (v) => (v as List) + .map((e) => Event.fromJson(e as Map)) + .toList()), + pagination: $checkedConvert('pagination', + (v) => Pagination.fromJson(v as Map)), + ); + return val; + }, + ); + +Map _$ListEventsResponseToJson(ListEventsResponse instance) => + { + 'events': instance.events.map((e) => e.toJson()).toList(), + 'pagination': instance.pagination.toJson(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_sources_response.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_sources_response.dart new file mode 100644 index 0000000000..9d91c0be33 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_sources_response.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/pagination.dart'; +import 'package:algolia_client_ingestion/src/model/source.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'list_sources_response.g.dart'; + +@JsonSerializable() +final class ListSourcesResponse { + /// Returns a new [ListSourcesResponse] instance. + const ListSourcesResponse({ + required this.sources, + required this.pagination, + }); + + @JsonKey(name: r'sources') + final List sources; + + @JsonKey(name: r'pagination') + final Pagination pagination; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ListSourcesResponse && + other.sources == sources && + other.pagination == pagination; + + @override + int get hashCode => sources.hashCode + pagination.hashCode; + + factory ListSourcesResponse.fromJson(Map json) => + _$ListSourcesResponseFromJson(json); + + Map toJson() => _$ListSourcesResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_sources_response.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_sources_response.g.dart new file mode 100644 index 0000000000..e0ee523e92 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_sources_response.g.dart @@ -0,0 +1,32 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'list_sources_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ListSourcesResponse _$ListSourcesResponseFromJson(Map json) => + $checkedCreate( + 'ListSourcesResponse', + json, + ($checkedConvert) { + final val = ListSourcesResponse( + sources: $checkedConvert( + 'sources', + (v) => (v as List) + .map((e) => Source.fromJson(e as Map)) + .toList()), + pagination: $checkedConvert('pagination', + (v) => Pagination.fromJson(v as Map)), + ); + return val; + }, + ); + +Map _$ListSourcesResponseToJson( + ListSourcesResponse instance) => + { + 'sources': instance.sources.map((e) => e.toJson()).toList(), + 'pagination': instance.pagination.toJson(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_tasks_response.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_tasks_response.dart new file mode 100644 index 0000000000..17f58c0d34 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_tasks_response.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/pagination.dart'; +import 'package:algolia_client_ingestion/src/model/task.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'list_tasks_response.g.dart'; + +@JsonSerializable() +final class ListTasksResponse { + /// Returns a new [ListTasksResponse] instance. + const ListTasksResponse({ + required this.tasks, + required this.pagination, + }); + + @JsonKey(name: r'tasks') + final List tasks; + + @JsonKey(name: r'pagination') + final Pagination pagination; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ListTasksResponse && + other.tasks == tasks && + other.pagination == pagination; + + @override + int get hashCode => tasks.hashCode + pagination.hashCode; + + factory ListTasksResponse.fromJson(Map json) => + _$ListTasksResponseFromJson(json); + + Map toJson() => _$ListTasksResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_tasks_response.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_tasks_response.g.dart new file mode 100644 index 0000000000..c8b45fa612 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/list_tasks_response.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'list_tasks_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ListTasksResponse _$ListTasksResponseFromJson(Map json) => + $checkedCreate( + 'ListTasksResponse', + json, + ($checkedConvert) { + final val = ListTasksResponse( + tasks: $checkedConvert( + 'tasks', + (v) => (v as List) + .map((e) => Task.fromJson(e as Map)) + .toList()), + pagination: $checkedConvert('pagination', + (v) => Pagination.fromJson(v as Map)), + ); + return val; + }, + ); + +Map _$ListTasksResponseToJson(ListTasksResponse instance) => + { + 'tasks': instance.tasks.map((e) => e.toJson()).toList(), + 'pagination': instance.pagination.toJson(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/mapping_type_csv.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/mapping_type_csv.dart new file mode 100644 index 0000000000..787db6cfa6 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/mapping_type_csv.dart @@ -0,0 +1,27 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum MappingTypeCSV { + string(r'string'), + integer(r'integer'), + float(r'float'), + boolean(r'boolean'), + json(r'json'); + + const MappingTypeCSV(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static MappingTypeCSV fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/method_type.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/method_type.dart new file mode 100644 index 0000000000..d595b680b3 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/method_type.dart @@ -0,0 +1,24 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum MethodType { + get(r'GET'), + post(r'POST'); + + const MethodType(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static MethodType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_date_utils_input.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_date_utils_input.dart new file mode 100644 index 0000000000..0dd3188865 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_date_utils_input.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'on_demand_date_utils_input.g.dart'; + +@JsonSerializable() +final class OnDemandDateUtilsInput { + /// Returns a new [OnDemandDateUtilsInput] instance. + const OnDemandDateUtilsInput({ + required this.startDate, + required this.endDate, + }); + + /// The start date of the extraction (RFC3339 format). + @JsonKey(name: r'startDate') + final String startDate; + + /// The end date of the extraction (RFC3339 format). + @JsonKey(name: r'endDate') + final String endDate; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is OnDemandDateUtilsInput && + other.startDate == startDate && + other.endDate == endDate; + + @override + int get hashCode => startDate.hashCode + endDate.hashCode; + + factory OnDemandDateUtilsInput.fromJson(Map json) => + _$OnDemandDateUtilsInputFromJson(json); + + Map toJson() => _$OnDemandDateUtilsInputToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_date_utils_input.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_date_utils_input.g.dart new file mode 100644 index 0000000000..5c5c6dadbc --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_date_utils_input.g.dart @@ -0,0 +1,28 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'on_demand_date_utils_input.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +OnDemandDateUtilsInput _$OnDemandDateUtilsInputFromJson( + Map json) => + $checkedCreate( + 'OnDemandDateUtilsInput', + json, + ($checkedConvert) { + final val = OnDemandDateUtilsInput( + startDate: $checkedConvert('startDate', (v) => v as String), + endDate: $checkedConvert('endDate', (v) => v as String), + ); + return val; + }, + ); + +Map _$OnDemandDateUtilsInputToJson( + OnDemandDateUtilsInput instance) => + { + 'startDate': instance.startDate, + 'endDate': instance.endDate, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_trigger.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_trigger.dart new file mode 100644 index 0000000000..7ca9a2df24 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_trigger.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/on_demand_trigger_type.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'on_demand_trigger.g.dart'; + +@JsonSerializable() +final class OnDemandTrigger { + /// Returns a new [OnDemandTrigger] instance. + const OnDemandTrigger({ + required this.type, + this.lastRun, + }); + + @JsonKey(name: r'type') + final OnDemandTriggerType type; + + /// The last time the scheduled task ran (RFC3339 format). + @JsonKey(name: r'lastRun') + final String? lastRun; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is OnDemandTrigger && + other.type == type && + other.lastRun == lastRun; + + @override + int get hashCode => type.hashCode + lastRun.hashCode; + + factory OnDemandTrigger.fromJson(Map json) => + _$OnDemandTriggerFromJson(json); + + Map toJson() => _$OnDemandTriggerToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_trigger.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_trigger.g.dart new file mode 100644 index 0000000000..1773b4c041 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_trigger.g.dart @@ -0,0 +1,40 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'on_demand_trigger.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +OnDemandTrigger _$OnDemandTriggerFromJson(Map json) => + $checkedCreate( + 'OnDemandTrigger', + json, + ($checkedConvert) { + final val = OnDemandTrigger( + type: $checkedConvert( + 'type', (v) => $enumDecode(_$OnDemandTriggerTypeEnumMap, v)), + lastRun: $checkedConvert('lastRun', (v) => v as String?), + ); + return val; + }, + ); + +Map _$OnDemandTriggerToJson(OnDemandTrigger instance) { + final val = { + 'type': instance.type.toJson(), + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('lastRun', instance.lastRun); + return val; +} + +const _$OnDemandTriggerTypeEnumMap = { + OnDemandTriggerType.onDemand: 'onDemand', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_trigger_input.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_trigger_input.dart new file mode 100644 index 0000000000..9e5c99380b --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_trigger_input.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/on_demand_trigger_type.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'on_demand_trigger_input.g.dart'; + +@JsonSerializable() +final class OnDemandTriggerInput { + /// Returns a new [OnDemandTriggerInput] instance. + const OnDemandTriggerInput({ + required this.type, + }); + + @JsonKey(name: r'type') + final OnDemandTriggerType type; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is OnDemandTriggerInput && other.type == type; + + @override + int get hashCode => type.hashCode; + + factory OnDemandTriggerInput.fromJson(Map json) => + _$OnDemandTriggerInputFromJson(json); + + Map toJson() => _$OnDemandTriggerInputToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_trigger_input.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_trigger_input.g.dart new file mode 100644 index 0000000000..ea29fbf1bc --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_trigger_input.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'on_demand_trigger_input.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +OnDemandTriggerInput _$OnDemandTriggerInputFromJson( + Map json) => + $checkedCreate( + 'OnDemandTriggerInput', + json, + ($checkedConvert) { + final val = OnDemandTriggerInput( + type: $checkedConvert( + 'type', (v) => $enumDecode(_$OnDemandTriggerTypeEnumMap, v)), + ); + return val; + }, + ); + +Map _$OnDemandTriggerInputToJson( + OnDemandTriggerInput instance) => + { + 'type': instance.type.toJson(), + }; + +const _$OnDemandTriggerTypeEnumMap = { + OnDemandTriggerType.onDemand: 'onDemand', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_trigger_type.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_trigger_type.dart new file mode 100644 index 0000000000..a9b40c2194 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/on_demand_trigger_type.dart @@ -0,0 +1,25 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// A task which is manually executed via the run task endpoint. +@JsonEnum(valueField: 'raw') +enum OnDemandTriggerType { + /// A task which is manually executed via the run task endpoint. + onDemand(r'onDemand'); + + const OnDemandTriggerType(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static OnDemandTriggerType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/order_keys.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/order_keys.dart new file mode 100644 index 0000000000..4af9dd3527 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/order_keys.dart @@ -0,0 +1,28 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Used to order a sorted request. +@JsonEnum(valueField: 'raw') +enum OrderKeys { + /// Used to order a sorted request. + asc(r'asc'), + + /// Used to order a sorted request. + desc(r'desc'); + + const OrderKeys(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static OrderKeys fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/pagination.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/pagination.dart new file mode 100644 index 0000000000..abfa392d0b --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/pagination.dart @@ -0,0 +1,55 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'pagination.g.dart'; + +@JsonSerializable() +final class Pagination { + /// Returns a new [Pagination] instance. + const Pagination({ + required this.nbPages, + required this.page, + required this.nbItems, + required this.itemsPerPage, + }); + + @JsonKey(name: r'nbPages') + final int nbPages; + + @JsonKey(name: r'page') + final int page; + + @JsonKey(name: r'nbItems') + final int nbItems; + + @JsonKey(name: r'itemsPerPage') + final int itemsPerPage; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Pagination && + other.nbPages == nbPages && + other.page == page && + other.nbItems == nbItems && + other.itemsPerPage == itemsPerPage; + + @override + int get hashCode => + nbPages.hashCode + + page.hashCode + + nbItems.hashCode + + itemsPerPage.hashCode; + + factory Pagination.fromJson(Map json) => + _$PaginationFromJson(json); + + Map toJson() => _$PaginationToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/pagination.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/pagination.g.dart new file mode 100644 index 0000000000..9b08462425 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/pagination.g.dart @@ -0,0 +1,29 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'pagination.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Pagination _$PaginationFromJson(Map json) => $checkedCreate( + 'Pagination', + json, + ($checkedConvert) { + final val = Pagination( + nbPages: $checkedConvert('nbPages', (v) => v as int), + page: $checkedConvert('page', (v) => v as int), + nbItems: $checkedConvert('nbItems', (v) => v as int), + itemsPerPage: $checkedConvert('itemsPerPage', (v) => v as int), + ); + return val; + }, + ); + +Map _$PaginationToJson(Pagination instance) => + { + 'nbPages': instance.nbPages, + 'page': instance.page, + 'nbItems': instance.nbItems, + 'itemsPerPage': instance.itemsPerPage, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/platform.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/platform.dart new file mode 100644 index 0000000000..2d97f7d485 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/platform.dart @@ -0,0 +1,28 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Describe which platform the Authentication is used for. +@JsonEnum(valueField: 'raw') +enum Platform { + /// Describe which platform the Authentication is used for. + bigcommerce(r'bigcommerce'), + + /// Describe which platform the Authentication is used for. + commercetools(r'commercetools'); + + const Platform(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static Platform fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/platform_none.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/platform_none.dart new file mode 100644 index 0000000000..6e71af25b3 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/platform_none.dart @@ -0,0 +1,25 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Used to filter Authentication without platform property. +@JsonEnum(valueField: 'raw') +enum PlatformNone { + /// Used to filter Authentication without platform property. + none(r'none'); + + const PlatformNone(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static PlatformNone fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run.dart new file mode 100644 index 0000000000..119d89c64a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run.dart @@ -0,0 +1,113 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/run_progress.dart'; +import 'package:algolia_client_ingestion/src/model/run_outcome.dart'; +import 'package:algolia_client_ingestion/src/model/run_status.dart'; +import 'package:algolia_client_ingestion/src/model/run_type.dart'; +import 'package:algolia_client_ingestion/src/model/run_reason_code.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'run.g.dart'; + +@JsonSerializable() +final class Run { + /// Returns a new [Run] instance. + const Run({ + required this.runID, + required this.appID, + required this.taskID, + required this.status, + this.progress, + this.outcome, + this.reason, + this.reasonCode, + required this.type, + required this.createdAt, + this.startedAt, + this.finishedAt, + }); + + /// The run UUID. + @JsonKey(name: r'runID') + final String runID; + + @JsonKey(name: r'appID') + final String appID; + + /// The task UUID. + @JsonKey(name: r'taskID') + final String taskID; + + @JsonKey(name: r'status') + final RunStatus status; + + @JsonKey(name: r'progress') + final RunProgress? progress; + + @JsonKey(name: r'outcome') + final RunOutcome? outcome; + + /// Explains the result of outcome. + @JsonKey(name: r'reason') + final String? reason; + + @JsonKey(name: r'reasonCode') + final RunReasonCode? reasonCode; + + @JsonKey(name: r'type') + final RunType type; + + /// Date of creation (RFC3339 format). + @JsonKey(name: r'createdAt') + final String createdAt; + + /// Date of start (RFC3339 format). + @JsonKey(name: r'startedAt') + final String? startedAt; + + /// Date of finish (RFC3339 format). + @JsonKey(name: r'finishedAt') + final String? finishedAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Run && + other.runID == runID && + other.appID == appID && + other.taskID == taskID && + other.status == status && + other.progress == progress && + other.outcome == outcome && + other.reason == reason && + other.reasonCode == reasonCode && + other.type == type && + other.createdAt == createdAt && + other.startedAt == startedAt && + other.finishedAt == finishedAt; + + @override + int get hashCode => + runID.hashCode + + appID.hashCode + + taskID.hashCode + + status.hashCode + + progress.hashCode + + outcome.hashCode + + reason.hashCode + + reasonCode.hashCode + + type.hashCode + + createdAt.hashCode + + startedAt.hashCode + + finishedAt.hashCode; + + factory Run.fromJson(Map json) => _$RunFromJson(json); + + Map toJson() => _$RunToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run.g.dart new file mode 100644 index 0000000000..3c1ce1e937 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run.g.dart @@ -0,0 +1,91 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'run.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Run _$RunFromJson(Map json) => $checkedCreate( + 'Run', + json, + ($checkedConvert) { + final val = Run( + runID: $checkedConvert('runID', (v) => v as String), + appID: $checkedConvert('appID', (v) => v as String), + taskID: $checkedConvert('taskID', (v) => v as String), + status: $checkedConvert( + 'status', (v) => $enumDecode(_$RunStatusEnumMap, v)), + progress: $checkedConvert( + 'progress', + (v) => v == null + ? null + : RunProgress.fromJson(v as Map)), + outcome: $checkedConvert( + 'outcome', (v) => $enumDecodeNullable(_$RunOutcomeEnumMap, v)), + reason: $checkedConvert('reason', (v) => v as String?), + reasonCode: $checkedConvert('reasonCode', + (v) => $enumDecodeNullable(_$RunReasonCodeEnumMap, v)), + type: + $checkedConvert('type', (v) => $enumDecode(_$RunTypeEnumMap, v)), + createdAt: $checkedConvert('createdAt', (v) => v as String), + startedAt: $checkedConvert('startedAt', (v) => v as String?), + finishedAt: $checkedConvert('finishedAt', (v) => v as String?), + ); + return val; + }, + ); + +Map _$RunToJson(Run instance) { + final val = { + 'runID': instance.runID, + 'appID': instance.appID, + 'taskID': instance.taskID, + 'status': instance.status.toJson(), + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('progress', instance.progress?.toJson()); + writeNotNull('outcome', instance.outcome?.toJson()); + writeNotNull('reason', instance.reason); + writeNotNull('reasonCode', instance.reasonCode?.toJson()); + val['type'] = instance.type.toJson(); + val['createdAt'] = instance.createdAt; + writeNotNull('startedAt', instance.startedAt); + writeNotNull('finishedAt', instance.finishedAt); + return val; +} + +const _$RunStatusEnumMap = { + RunStatus.created: 'created', + RunStatus.started: 'started', + RunStatus.idled: 'idled', + RunStatus.finished: 'finished', + RunStatus.skipped: 'skipped', +}; + +const _$RunOutcomeEnumMap = { + RunOutcome.success: 'success', + RunOutcome.failure: 'failure', + RunOutcome.processing: 'processing', +}; + +const _$RunReasonCodeEnumMap = { + RunReasonCode.internal: 'internal', + RunReasonCode.critical: 'critical', + RunReasonCode.noEvents: 'no_events', + RunReasonCode.tooManyErrors: 'too_many_errors', + RunReasonCode.ok: 'ok', + RunReasonCode.discarded: 'discarded', + RunReasonCode.blocking: 'blocking', +}; + +const _$RunTypeEnumMap = { + RunType.reindex: 'reindex', + RunType.update: 'update', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_list_response.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_list_response.dart new file mode 100644 index 0000000000..d99bba04f1 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_list_response.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/pagination.dart'; +import 'package:algolia_client_ingestion/src/model/run.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'run_list_response.g.dart'; + +@JsonSerializable() +final class RunListResponse { + /// Returns a new [RunListResponse] instance. + const RunListResponse({ + required this.runs, + required this.pagination, + }); + + @JsonKey(name: r'runs') + final List runs; + + @JsonKey(name: r'pagination') + final Pagination pagination; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is RunListResponse && + other.runs == runs && + other.pagination == pagination; + + @override + int get hashCode => runs.hashCode + pagination.hashCode; + + factory RunListResponse.fromJson(Map json) => + _$RunListResponseFromJson(json); + + Map toJson() => _$RunListResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_list_response.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_list_response.g.dart new file mode 100644 index 0000000000..82fe57a207 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_list_response.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'run_list_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +RunListResponse _$RunListResponseFromJson(Map json) => + $checkedCreate( + 'RunListResponse', + json, + ($checkedConvert) { + final val = RunListResponse( + runs: $checkedConvert( + 'runs', + (v) => (v as List) + .map((e) => Run.fromJson(e as Map)) + .toList()), + pagination: $checkedConvert('pagination', + (v) => Pagination.fromJson(v as Map)), + ); + return val; + }, + ); + +Map _$RunListResponseToJson(RunListResponse instance) => + { + 'runs': instance.runs.map((e) => e.toJson()).toList(), + 'pagination': instance.pagination.toJson(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_outcome.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_outcome.dart new file mode 100644 index 0000000000..9743e90f90 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_outcome.dart @@ -0,0 +1,25 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum RunOutcome { + success(r'success'), + failure(r'failure'), + processing(r'processing'); + + const RunOutcome(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static RunOutcome fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_progress.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_progress.dart new file mode 100644 index 0000000000..58f6bec847 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_progress.dart @@ -0,0 +1,41 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'run_progress.g.dart'; + +@JsonSerializable() +final class RunProgress { + /// Returns a new [RunProgress] instance. + const RunProgress({ + this.expectedNbOfEvents, + this.receivedNbOfEvents, + }); + + @JsonKey(name: r'expectedNbOfEvents') + final int? expectedNbOfEvents; + + @JsonKey(name: r'receivedNbOfEvents') + final int? receivedNbOfEvents; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is RunProgress && + other.expectedNbOfEvents == expectedNbOfEvents && + other.receivedNbOfEvents == receivedNbOfEvents; + + @override + int get hashCode => expectedNbOfEvents.hashCode + receivedNbOfEvents.hashCode; + + factory RunProgress.fromJson(Map json) => + _$RunProgressFromJson(json); + + Map toJson() => _$RunProgressToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_progress.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_progress.g.dart new file mode 100644 index 0000000000..64b274a772 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_progress.g.dart @@ -0,0 +1,35 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'run_progress.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +RunProgress _$RunProgressFromJson(Map json) => $checkedCreate( + 'RunProgress', + json, + ($checkedConvert) { + final val = RunProgress( + expectedNbOfEvents: + $checkedConvert('expectedNbOfEvents', (v) => v as int?), + receivedNbOfEvents: + $checkedConvert('receivedNbOfEvents', (v) => v as int?), + ); + return val; + }, + ); + +Map _$RunProgressToJson(RunProgress instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('expectedNbOfEvents', instance.expectedNbOfEvents); + writeNotNull('receivedNbOfEvents', instance.receivedNbOfEvents); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_reason_code.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_reason_code.dart new file mode 100644 index 0000000000..84e6fac87f --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_reason_code.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// An identifier that pairs with the outcome reason. +@JsonEnum(valueField: 'raw') +enum RunReasonCode { + /// An identifier that pairs with the outcome reason. + internal(r'internal'), + + /// An identifier that pairs with the outcome reason. + critical(r'critical'), + + /// An identifier that pairs with the outcome reason. + noEvents(r'no_events'), + + /// An identifier that pairs with the outcome reason. + tooManyErrors(r'too_many_errors'), + + /// An identifier that pairs with the outcome reason. + ok(r'ok'), + + /// An identifier that pairs with the outcome reason. + discarded(r'discarded'), + + /// An identifier that pairs with the outcome reason. + blocking(r'blocking'); + + const RunReasonCode(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static RunReasonCode fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_response.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_response.dart new file mode 100644 index 0000000000..5a30dde10d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_response.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'run_response.g.dart'; + +@JsonSerializable() +final class RunResponse { + /// Returns a new [RunResponse] instance. + const RunResponse({ + required this.runID, + required this.createdAt, + }); + + /// The run UUID. + @JsonKey(name: r'runID') + final String runID; + + /// Date of creation (RFC3339 format). + @JsonKey(name: r'createdAt') + final String createdAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is RunResponse && + other.runID == runID && + other.createdAt == createdAt; + + @override + int get hashCode => runID.hashCode + createdAt.hashCode; + + factory RunResponse.fromJson(Map json) => + _$RunResponseFromJson(json); + + Map toJson() => _$RunResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_response.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_response.g.dart new file mode 100644 index 0000000000..c34e10a58f --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_response.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'run_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +RunResponse _$RunResponseFromJson(Map json) => $checkedCreate( + 'RunResponse', + json, + ($checkedConvert) { + final val = RunResponse( + runID: $checkedConvert('runID', (v) => v as String), + createdAt: $checkedConvert('createdAt', (v) => v as String), + ); + return val; + }, + ); + +Map _$RunResponseToJson(RunResponse instance) => + { + 'runID': instance.runID, + 'createdAt': instance.createdAt, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_sort_keys.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_sort_keys.dart new file mode 100644 index 0000000000..4593e5a48c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_sort_keys.dart @@ -0,0 +1,31 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Used to sort the Run list endpoint. +@JsonEnum(valueField: 'raw') +enum RunSortKeys { + /// Used to sort the Run list endpoint. + status(r'status'), + + /// Used to sort the Run list endpoint. + updatedAt(r'updatedAt'), + + /// Used to sort the Run list endpoint. + createdAt(r'createdAt'); + + const RunSortKeys(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static RunSortKeys fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_status.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_status.dart new file mode 100644 index 0000000000..cc80b086e1 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_status.dart @@ -0,0 +1,27 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum RunStatus { + created(r'created'), + started(r'started'), + idled(r'idled'), + finished(r'finished'), + skipped(r'skipped'); + + const RunStatus(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static RunStatus fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_type.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_type.dart new file mode 100644 index 0000000000..2d2a893e36 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/run_type.dart @@ -0,0 +1,24 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum RunType { + reindex(r'reindex'), + update(r'update'); + + const RunType(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static RunType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_date_utils_input.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_date_utils_input.dart new file mode 100644 index 0000000000..0bf939536e --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_date_utils_input.dart @@ -0,0 +1,38 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'schedule_date_utils_input.g.dart'; + +@JsonSerializable() +final class ScheduleDateUtilsInput { + /// Returns a new [ScheduleDateUtilsInput] instance. + const ScheduleDateUtilsInput({ + required this.timeframe, + }); + + /// The timeframe of the extraction, in number of days from today. + // minimum: 1 + // maximum: 30 + @JsonKey(name: r'timeframe') + final int timeframe; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ScheduleDateUtilsInput && other.timeframe == timeframe; + + @override + int get hashCode => timeframe.hashCode; + + factory ScheduleDateUtilsInput.fromJson(Map json) => + _$ScheduleDateUtilsInputFromJson(json); + + Map toJson() => _$ScheduleDateUtilsInputToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_date_utils_input.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_date_utils_input.g.dart new file mode 100644 index 0000000000..e2a282c9c0 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_date_utils_input.g.dart @@ -0,0 +1,26 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'schedule_date_utils_input.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ScheduleDateUtilsInput _$ScheduleDateUtilsInputFromJson( + Map json) => + $checkedCreate( + 'ScheduleDateUtilsInput', + json, + ($checkedConvert) { + final val = ScheduleDateUtilsInput( + timeframe: $checkedConvert('timeframe', (v) => v as int), + ); + return val; + }, + ); + +Map _$ScheduleDateUtilsInputToJson( + ScheduleDateUtilsInput instance) => + { + 'timeframe': instance.timeframe, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_trigger.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_trigger.dart new file mode 100644 index 0000000000..014e843598 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_trigger.dart @@ -0,0 +1,56 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/schedule_trigger_type.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'schedule_trigger.g.dart'; + +@JsonSerializable() +final class ScheduleTrigger { + /// Returns a new [ScheduleTrigger] instance. + const ScheduleTrigger({ + required this.type, + required this.cron, + this.lastRun, + required this.nextRun, + }); + + @JsonKey(name: r'type') + final ScheduleTriggerType type; + + /// A cron expression that represent at which regularity the task should run. + @JsonKey(name: r'cron') + final String cron; + + /// The last time the scheduled task ran (RFC3339 format). + @JsonKey(name: r'lastRun') + final String? lastRun; + + /// The next scheduled run of the task (RFC3339 format). + @JsonKey(name: r'nextRun') + final String nextRun; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ScheduleTrigger && + other.type == type && + other.cron == cron && + other.lastRun == lastRun && + other.nextRun == nextRun; + + @override + int get hashCode => + type.hashCode + cron.hashCode + lastRun.hashCode + nextRun.hashCode; + + factory ScheduleTrigger.fromJson(Map json) => + _$ScheduleTriggerFromJson(json); + + Map toJson() => _$ScheduleTriggerToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_trigger.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_trigger.g.dart new file mode 100644 index 0000000000..7a8b34ef1c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_trigger.g.dart @@ -0,0 +1,44 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'schedule_trigger.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ScheduleTrigger _$ScheduleTriggerFromJson(Map json) => + $checkedCreate( + 'ScheduleTrigger', + json, + ($checkedConvert) { + final val = ScheduleTrigger( + type: $checkedConvert( + 'type', (v) => $enumDecode(_$ScheduleTriggerTypeEnumMap, v)), + cron: $checkedConvert('cron', (v) => v as String), + lastRun: $checkedConvert('lastRun', (v) => v as String?), + nextRun: $checkedConvert('nextRun', (v) => v as String), + ); + return val; + }, + ); + +Map _$ScheduleTriggerToJson(ScheduleTrigger instance) { + final val = { + 'type': instance.type.toJson(), + 'cron': instance.cron, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('lastRun', instance.lastRun); + val['nextRun'] = instance.nextRun; + return val; +} + +const _$ScheduleTriggerTypeEnumMap = { + ScheduleTriggerType.schedule: 'schedule', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_trigger_input.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_trigger_input.dart new file mode 100644 index 0000000000..b0d0055e20 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_trigger_input.dart @@ -0,0 +1,41 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/schedule_trigger_type.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'schedule_trigger_input.g.dart'; + +@JsonSerializable() +final class ScheduleTriggerInput { + /// Returns a new [ScheduleTriggerInput] instance. + const ScheduleTriggerInput({ + required this.type, + required this.cron, + }); + + @JsonKey(name: r'type') + final ScheduleTriggerType type; + + /// A cron expression that represent at which regularity the task should run. + @JsonKey(name: r'cron') + final String cron; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ScheduleTriggerInput && other.type == type && other.cron == cron; + + @override + int get hashCode => type.hashCode + cron.hashCode; + + factory ScheduleTriggerInput.fromJson(Map json) => + _$ScheduleTriggerInputFromJson(json); + + Map toJson() => _$ScheduleTriggerInputToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_trigger_input.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_trigger_input.g.dart new file mode 100644 index 0000000000..9274e21be8 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_trigger_input.g.dart @@ -0,0 +1,33 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'schedule_trigger_input.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ScheduleTriggerInput _$ScheduleTriggerInputFromJson( + Map json) => + $checkedCreate( + 'ScheduleTriggerInput', + json, + ($checkedConvert) { + final val = ScheduleTriggerInput( + type: $checkedConvert( + 'type', (v) => $enumDecode(_$ScheduleTriggerTypeEnumMap, v)), + cron: $checkedConvert('cron', (v) => v as String), + ); + return val; + }, + ); + +Map _$ScheduleTriggerInputToJson( + ScheduleTriggerInput instance) => + { + 'type': instance.type.toJson(), + 'cron': instance.cron, + }; + +const _$ScheduleTriggerTypeEnumMap = { + ScheduleTriggerType.schedule: 'schedule', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_trigger_type.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_trigger_type.dart new file mode 100644 index 0000000000..e67fd82df7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/schedule_trigger_type.dart @@ -0,0 +1,25 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// A task which is triggered by a schedule (cron expression). +@JsonEnum(valueField: 'raw') +enum ScheduleTriggerType { + /// A task which is triggered by a schedule (cron expression). + schedule(r'schedule'); + + const ScheduleTriggerType(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static ScheduleTriggerType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source.dart new file mode 100644 index 0000000000..18b5482794 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source.dart @@ -0,0 +1,84 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/source_type.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'source.g.dart'; + +@JsonSerializable() +final class Source { + /// Returns a new [Source] instance. + const Source({ + required this.sourceID, + required this.type, + required this.name, + required this.input, + this.authenticationID, + required this.createdAt, + this.updatedAt, + }); + + /// The source UUID. + @JsonKey(name: r'sourceID') + final String sourceID; + + @JsonKey(name: r'type') + final SourceType type; + + @JsonKey(name: r'name') + final String name; + + /// One of types: + /// - [SourceBigQuery] + /// - [SourceDocker] + /// - [SourceCommercetools] + /// - [SourceCSV] + /// - [SourceJSON] + /// - [SourceBigCommerce] + @JsonKey(name: r'input') + final dynamic input; + + /// The authentication UUID. + @JsonKey(name: r'authenticationID') + final String? authenticationID; + + /// Date of creation (RFC3339 format). + @JsonKey(name: r'createdAt') + final String createdAt; + + /// Date of last update (RFC3339 format). + @JsonKey(name: r'updatedAt') + final String? updatedAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Source && + other.sourceID == sourceID && + other.type == type && + other.name == name && + other.input == input && + other.authenticationID == authenticationID && + other.createdAt == createdAt && + other.updatedAt == updatedAt; + + @override + int get hashCode => + sourceID.hashCode + + type.hashCode + + name.hashCode + + input.hashCode + + authenticationID.hashCode + + createdAt.hashCode + + updatedAt.hashCode; + + factory Source.fromJson(Map json) => _$SourceFromJson(json); + + Map toJson() => _$SourceToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source.g.dart new file mode 100644 index 0000000000..21e6937dd9 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source.g.dart @@ -0,0 +1,55 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'source.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Source _$SourceFromJson(Map json) => $checkedCreate( + 'Source', + json, + ($checkedConvert) { + final val = Source( + sourceID: $checkedConvert('sourceID', (v) => v as String), + type: $checkedConvert( + 'type', (v) => $enumDecode(_$SourceTypeEnumMap, v)), + name: $checkedConvert('name', (v) => v as String), + input: $checkedConvert('input', (v) => v), + authenticationID: + $checkedConvert('authenticationID', (v) => v as String?), + createdAt: $checkedConvert('createdAt', (v) => v as String), + updatedAt: $checkedConvert('updatedAt', (v) => v as String?), + ); + return val; + }, + ); + +Map _$SourceToJson(Source instance) { + final val = { + 'sourceID': instance.sourceID, + 'type': instance.type.toJson(), + 'name': instance.name, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('input', instance.input); + writeNotNull('authenticationID', instance.authenticationID); + val['createdAt'] = instance.createdAt; + writeNotNull('updatedAt', instance.updatedAt); + return val; +} + +const _$SourceTypeEnumMap = { + SourceType.bigcommerce: 'bigcommerce', + SourceType.commercetools: 'commercetools', + SourceType.json: 'json', + SourceType.csv: 'csv', + SourceType.bigquery: 'bigquery', + SourceType.docker: 'docker', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_big_commerce.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_big_commerce.dart new file mode 100644 index 0000000000..9477cb5453 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_big_commerce.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/big_commerce_channel.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'source_big_commerce.g.dart'; + +@JsonSerializable() +final class SourceBigCommerce { + /// Returns a new [SourceBigCommerce] instance. + const SourceBigCommerce({ + this.storeHash, + this.channel, + }); + + /// The store hash identifying the store the shopper is signing in to. + @JsonKey(name: r'storeHash') + final String? storeHash; + + @JsonKey(name: r'channel') + final BigCommerceChannel? channel; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SourceBigCommerce && + other.storeHash == storeHash && + other.channel == channel; + + @override + int get hashCode => storeHash.hashCode + channel.hashCode; + + factory SourceBigCommerce.fromJson(Map json) => + _$SourceBigCommerceFromJson(json); + + Map toJson() => _$SourceBigCommerceToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_big_commerce.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_big_commerce.g.dart new file mode 100644 index 0000000000..eb535714d1 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_big_commerce.g.dart @@ -0,0 +1,38 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'source_big_commerce.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SourceBigCommerce _$SourceBigCommerceFromJson(Map json) => + $checkedCreate( + 'SourceBigCommerce', + json, + ($checkedConvert) { + final val = SourceBigCommerce( + storeHash: $checkedConvert('storeHash', (v) => v as String?), + channel: $checkedConvert( + 'channel', + (v) => v == null + ? null + : BigCommerceChannel.fromJson(v as Map)), + ); + return val; + }, + ); + +Map _$SourceBigCommerceToJson(SourceBigCommerce instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('storeHash', instance.storeHash); + writeNotNull('channel', instance.channel?.toJson()); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_big_query.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_big_query.dart new file mode 100644 index 0000000000..0fc399717d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_big_query.dart @@ -0,0 +1,80 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/big_query_data_type.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'source_big_query.g.dart'; + +@JsonSerializable() +final class SourceBigQuery { + /// Returns a new [SourceBigQuery] instance. + const SourceBigQuery({ + required this.projectID, + required this.datasetID, + this.dataType, + this.table, + this.tablePrefix, + this.customSQLRequest, + this.uniqueIDColumn, + }); + + /// Project ID of the BigQuery Source. + @JsonKey(name: r'projectID') + final String projectID; + + /// Dataset ID of the BigQuery Source. + @JsonKey(name: r'datasetID') + final String datasetID; + + @JsonKey(name: r'dataType') + final BigQueryDataType? dataType; + + /// Table name (for default BQ). + @JsonKey(name: r'table') + final String? table; + + /// Table prefix (for Google Analytics). + @JsonKey(name: r'tablePrefix') + final String? tablePrefix; + + /// Custom SQL request to extract data from the BigQuery table. + @JsonKey(name: r'customSQLRequest') + final String? customSQLRequest; + + /// The name of the column that contains the unique ID, used as `objectID` in Algolia. + @JsonKey(name: r'uniqueIDColumn') + final String? uniqueIDColumn; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SourceBigQuery && + other.projectID == projectID && + other.datasetID == datasetID && + other.dataType == dataType && + other.table == table && + other.tablePrefix == tablePrefix && + other.customSQLRequest == customSQLRequest && + other.uniqueIDColumn == uniqueIDColumn; + + @override + int get hashCode => + projectID.hashCode + + datasetID.hashCode + + dataType.hashCode + + table.hashCode + + tablePrefix.hashCode + + customSQLRequest.hashCode + + uniqueIDColumn.hashCode; + + factory SourceBigQuery.fromJson(Map json) => + _$SourceBigQueryFromJson(json); + + Map toJson() => _$SourceBigQueryToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_big_query.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_big_query.g.dart new file mode 100644 index 0000000000..07ae418cc3 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_big_query.g.dart @@ -0,0 +1,53 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'source_big_query.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SourceBigQuery _$SourceBigQueryFromJson(Map json) => + $checkedCreate( + 'SourceBigQuery', + json, + ($checkedConvert) { + final val = SourceBigQuery( + projectID: $checkedConvert('projectID', (v) => v as String), + datasetID: $checkedConvert('datasetID', (v) => v as String), + dataType: $checkedConvert('dataType', + (v) => $enumDecodeNullable(_$BigQueryDataTypeEnumMap, v)), + table: $checkedConvert('table', (v) => v as String?), + tablePrefix: $checkedConvert('tablePrefix', (v) => v as String?), + customSQLRequest: + $checkedConvert('customSQLRequest', (v) => v as String?), + uniqueIDColumn: + $checkedConvert('uniqueIDColumn', (v) => v as String?), + ); + return val; + }, + ); + +Map _$SourceBigQueryToJson(SourceBigQuery instance) { + final val = { + 'projectID': instance.projectID, + 'datasetID': instance.datasetID, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('dataType', instance.dataType?.toJson()); + writeNotNull('table', instance.table); + writeNotNull('tablePrefix', instance.tablePrefix); + writeNotNull('customSQLRequest', instance.customSQLRequest); + writeNotNull('uniqueIDColumn', instance.uniqueIDColumn); + return val; +} + +const _$BigQueryDataTypeEnumMap = { + BigQueryDataType.ga4: 'ga4', + BigQueryDataType.ga360: 'ga360', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_commercetools.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_commercetools.dart new file mode 100644 index 0000000000..221b5fb730 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_commercetools.dart @@ -0,0 +1,56 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'source_commercetools.g.dart'; + +@JsonSerializable() +final class SourceCommercetools { + /// Returns a new [SourceCommercetools] instance. + const SourceCommercetools({ + this.storeKeys, + this.locales, + required this.url, + required this.projectKey, + }); + + @JsonKey(name: r'storeKeys') + final List? storeKeys; + + /// Array of locales that must match the following pattern: ^[a-z]{2}(-[A-Z]{2})?$. For example [\"fr-FR\", \"en\"]. + @JsonKey(name: r'locales') + final List? locales; + + @JsonKey(name: r'url') + final String url; + + @JsonKey(name: r'projectKey') + final String projectKey; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SourceCommercetools && + other.storeKeys == storeKeys && + other.locales == locales && + other.url == url && + other.projectKey == projectKey; + + @override + int get hashCode => + storeKeys.hashCode + + locales.hashCode + + url.hashCode + + projectKey.hashCode; + + factory SourceCommercetools.fromJson(Map json) => + _$SourceCommercetoolsFromJson(json); + + Map toJson() => _$SourceCommercetoolsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_commercetools.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_commercetools.g.dart new file mode 100644 index 0000000000..7ef71bbdb6 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_commercetools.g.dart @@ -0,0 +1,40 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'source_commercetools.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SourceCommercetools _$SourceCommercetoolsFromJson(Map json) => + $checkedCreate( + 'SourceCommercetools', + json, + ($checkedConvert) { + final val = SourceCommercetools( + storeKeys: $checkedConvert('storeKeys', + (v) => (v as List?)?.map((e) => e as String).toList()), + locales: $checkedConvert('locales', + (v) => (v as List?)?.map((e) => e as String).toList()), + url: $checkedConvert('url', (v) => v as String), + projectKey: $checkedConvert('projectKey', (v) => v as String), + ); + return val; + }, + ); + +Map _$SourceCommercetoolsToJson(SourceCommercetools instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('storeKeys', instance.storeKeys); + writeNotNull('locales', instance.locales); + val['url'] = instance.url; + val['projectKey'] = instance.projectKey; + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_create.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_create.dart new file mode 100644 index 0000000000..3acc3910b7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_create.dart @@ -0,0 +1,64 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/source_type.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'source_create.g.dart'; + +@JsonSerializable() +final class SourceCreate { + /// Returns a new [SourceCreate] instance. + const SourceCreate({ + required this.type, + required this.name, + required this.input, + this.authenticationID, + }); + + @JsonKey(name: r'type') + final SourceType type; + + @JsonKey(name: r'name') + final String name; + + /// One of types: + /// - [SourceBigQuery] + /// - [SourceDocker] + /// - [SourceCommercetools] + /// - [SourceCSV] + /// - [SourceJSON] + /// - [SourceBigCommerce] + @JsonKey(name: r'input') + final dynamic input; + + /// The authentication UUID. + @JsonKey(name: r'authenticationID') + final String? authenticationID; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SourceCreate && + other.type == type && + other.name == name && + other.input == input && + other.authenticationID == authenticationID; + + @override + int get hashCode => + type.hashCode + + name.hashCode + + input.hashCode + + authenticationID.hashCode; + + factory SourceCreate.fromJson(Map json) => + _$SourceCreateFromJson(json); + + Map toJson() => _$SourceCreateToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_create.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_create.g.dart new file mode 100644 index 0000000000..afbd315526 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_create.g.dart @@ -0,0 +1,50 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'source_create.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SourceCreate _$SourceCreateFromJson(Map json) => + $checkedCreate( + 'SourceCreate', + json, + ($checkedConvert) { + final val = SourceCreate( + type: $checkedConvert( + 'type', (v) => $enumDecode(_$SourceTypeEnumMap, v)), + name: $checkedConvert('name', (v) => v as String), + input: $checkedConvert('input', (v) => v), + authenticationID: + $checkedConvert('authenticationID', (v) => v as String?), + ); + return val; + }, + ); + +Map _$SourceCreateToJson(SourceCreate instance) { + final val = { + 'type': instance.type.toJson(), + 'name': instance.name, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('input', instance.input); + writeNotNull('authenticationID', instance.authenticationID); + return val; +} + +const _$SourceTypeEnumMap = { + SourceType.bigcommerce: 'bigcommerce', + SourceType.commercetools: 'commercetools', + SourceType.json: 'json', + SourceType.csv: 'csv', + SourceType.bigquery: 'bigquery', + SourceType.docker: 'docker', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_create_response.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_create_response.dart new file mode 100644 index 0000000000..7203aea752 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_create_response.dart @@ -0,0 +1,48 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'source_create_response.g.dart'; + +@JsonSerializable() +final class SourceCreateResponse { + /// Returns a new [SourceCreateResponse] instance. + const SourceCreateResponse({ + required this.sourceID, + required this.name, + required this.createdAt, + }); + + /// The source UUID. + @JsonKey(name: r'sourceID') + final String sourceID; + + @JsonKey(name: r'name') + final String name; + + /// Date of creation (RFC3339 format). + @JsonKey(name: r'createdAt') + final String createdAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SourceCreateResponse && + other.sourceID == sourceID && + other.name == name && + other.createdAt == createdAt; + + @override + int get hashCode => sourceID.hashCode + name.hashCode + createdAt.hashCode; + + factory SourceCreateResponse.fromJson(Map json) => + _$SourceCreateResponseFromJson(json); + + Map toJson() => _$SourceCreateResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_create_response.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_create_response.g.dart new file mode 100644 index 0000000000..0487cad884 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_create_response.g.dart @@ -0,0 +1,30 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'source_create_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SourceCreateResponse _$SourceCreateResponseFromJson( + Map json) => + $checkedCreate( + 'SourceCreateResponse', + json, + ($checkedConvert) { + final val = SourceCreateResponse( + sourceID: $checkedConvert('sourceID', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + createdAt: $checkedConvert('createdAt', (v) => v as String), + ); + return val; + }, + ); + +Map _$SourceCreateResponseToJson( + SourceCreateResponse instance) => + { + 'sourceID': instance.sourceID, + 'name': instance.name, + 'createdAt': instance.createdAt, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_csv.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_csv.dart new file mode 100644 index 0000000000..3db36179bf --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_csv.dart @@ -0,0 +1,67 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/mapping_type_csv.dart'; +import 'package:algolia_client_ingestion/src/model/method_type.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'source_csv.g.dart'; + +@JsonSerializable() +final class SourceCSV { + /// Returns a new [SourceCSV] instance. + const SourceCSV({ + required this.url, + this.uniqueIDColumn, + this.mapping, + this.method, + this.delimiter, + }); + + /// The URL of the file. + @JsonKey(name: r'url') + final String url; + + /// The name of the column that contains the unique ID, used as `objectID` in Algolia. + @JsonKey(name: r'uniqueIDColumn') + final String? uniqueIDColumn; + + /// Mapping of type for every column. For example {\"myColumn\": \"boolean\", \"myOtherColumn\": \"json\"}. + @JsonKey(name: r'mapping') + final Map? mapping; + + @JsonKey(name: r'method') + final MethodType? method; + + /// The character used to split the value on each line, default to a comma (\\r, \\n, 0xFFFD, and space are forbidden). + @JsonKey(name: r'delimiter') + final String? delimiter; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SourceCSV && + other.url == url && + other.uniqueIDColumn == uniqueIDColumn && + other.mapping == mapping && + other.method == method && + other.delimiter == delimiter; + + @override + int get hashCode => + url.hashCode + + uniqueIDColumn.hashCode + + mapping.hashCode + + method.hashCode + + delimiter.hashCode; + + factory SourceCSV.fromJson(Map json) => + _$SourceCSVFromJson(json); + + Map toJson() => _$SourceCSVToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_csv.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_csv.g.dart new file mode 100644 index 0000000000..abc1f0a636 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_csv.g.dart @@ -0,0 +1,61 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'source_csv.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SourceCSV _$SourceCSVFromJson(Map json) => $checkedCreate( + 'SourceCSV', + json, + ($checkedConvert) { + final val = SourceCSV( + url: $checkedConvert('url', (v) => v as String), + uniqueIDColumn: + $checkedConvert('uniqueIDColumn', (v) => v as String?), + mapping: $checkedConvert( + 'mapping', + (v) => (v as Map?)?.map( + (k, e) => + MapEntry(k, $enumDecode(_$MappingTypeCSVEnumMap, e)), + )), + method: $checkedConvert( + 'method', (v) => $enumDecodeNullable(_$MethodTypeEnumMap, v)), + delimiter: $checkedConvert('delimiter', (v) => v as String?), + ); + return val; + }, + ); + +Map _$SourceCSVToJson(SourceCSV instance) { + final val = { + 'url': instance.url, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('uniqueIDColumn', instance.uniqueIDColumn); + writeNotNull( + 'mapping', instance.mapping?.map((k, e) => MapEntry(k, e.toJson()))); + writeNotNull('method', instance.method?.toJson()); + writeNotNull('delimiter', instance.delimiter); + return val; +} + +const _$MappingTypeCSVEnumMap = { + MappingTypeCSV.string: 'string', + MappingTypeCSV.integer: 'integer', + MappingTypeCSV.float: 'float', + MappingTypeCSV.boolean: 'boolean', + MappingTypeCSV.json: 'json', +}; + +const _$MethodTypeEnumMap = { + MethodType.get: 'GET', + MethodType.post: 'POST', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_docker.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_docker.dart new file mode 100644 index 0000000000..54e5d292ad --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_docker.dart @@ -0,0 +1,73 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/docker_image_type.dart'; +import 'package:algolia_client_ingestion/src/model/docker_registry.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'source_docker.g.dart'; + +@JsonSerializable() +final class SourceDocker { + /// Returns a new [SourceDocker] instance. + const SourceDocker({ + required this.registry, + required this.image, + this.version, + required this.imageType, + this.outputFile, + required this.configuration, + }); + + @JsonKey(name: r'registry') + final DockerRegistry registry; + + /// The name of the image to pull. + @JsonKey(name: r'image') + final String image; + + /// The version of the image, defaults to `latest`. + @JsonKey(name: r'version') + final String? version; + + @JsonKey(name: r'imageType') + final DockerImageType imageType; + + /// The full name of the output file. + @JsonKey(name: r'outputFile') + final String? outputFile; + + /// The configuration of the spec. + @JsonKey(name: r'configuration') + final Object configuration; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SourceDocker && + other.registry == registry && + other.image == image && + other.version == version && + other.imageType == imageType && + other.outputFile == outputFile && + other.configuration == configuration; + + @override + int get hashCode => + registry.hashCode + + image.hashCode + + version.hashCode + + imageType.hashCode + + outputFile.hashCode + + configuration.hashCode; + + factory SourceDocker.fromJson(Map json) => + _$SourceDockerFromJson(json); + + Map toJson() => _$SourceDockerToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_docker.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_docker.g.dart new file mode 100644 index 0000000000..d80dc4c36e --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_docker.g.dart @@ -0,0 +1,56 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'source_docker.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SourceDocker _$SourceDockerFromJson(Map json) => + $checkedCreate( + 'SourceDocker', + json, + ($checkedConvert) { + final val = SourceDocker( + registry: $checkedConvert( + 'registry', (v) => $enumDecode(_$DockerRegistryEnumMap, v)), + image: $checkedConvert('image', (v) => v as String), + version: $checkedConvert('version', (v) => v as String?), + imageType: $checkedConvert( + 'imageType', (v) => $enumDecode(_$DockerImageTypeEnumMap, v)), + outputFile: $checkedConvert('outputFile', (v) => v as String?), + configuration: $checkedConvert('configuration', (v) => v as Object), + ); + return val; + }, + ); + +Map _$SourceDockerToJson(SourceDocker instance) { + final val = { + 'registry': instance.registry.toJson(), + 'image': instance.image, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('version', instance.version); + val['imageType'] = instance.imageType.toJson(); + writeNotNull('outputFile', instance.outputFile); + val['configuration'] = instance.configuration; + return val; +} + +const _$DockerRegistryEnumMap = { + DockerRegistry.dockerhub: 'dockerhub', + DockerRegistry.ghcr: 'ghcr', +}; + +const _$DockerImageTypeEnumMap = { + DockerImageType.singer: 'singer', + DockerImageType.custom: 'custom', + DockerImageType.airbyte: 'airbyte', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_json.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_json.dart new file mode 100644 index 0000000000..facf130470 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_json.dart @@ -0,0 +1,49 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/method_type.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'source_json.g.dart'; + +@JsonSerializable() +final class SourceJSON { + /// Returns a new [SourceJSON] instance. + const SourceJSON({ + required this.url, + this.uniqueIDColumn, + this.method, + }); + + /// The URL of the file. + @JsonKey(name: r'url') + final String url; + + /// The name of the column that contains the unique ID, used as `objectID` in Algolia. + @JsonKey(name: r'uniqueIDColumn') + final String? uniqueIDColumn; + + @JsonKey(name: r'method') + final MethodType? method; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SourceJSON && + other.url == url && + other.uniqueIDColumn == uniqueIDColumn && + other.method == method; + + @override + int get hashCode => url.hashCode + uniqueIDColumn.hashCode + method.hashCode; + + factory SourceJSON.fromJson(Map json) => + _$SourceJSONFromJson(json); + + Map toJson() => _$SourceJSONToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_json.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_json.g.dart new file mode 100644 index 0000000000..d24f9a514c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_json.g.dart @@ -0,0 +1,43 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'source_json.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SourceJSON _$SourceJSONFromJson(Map json) => $checkedCreate( + 'SourceJSON', + json, + ($checkedConvert) { + final val = SourceJSON( + url: $checkedConvert('url', (v) => v as String), + uniqueIDColumn: + $checkedConvert('uniqueIDColumn', (v) => v as String?), + method: $checkedConvert( + 'method', (v) => $enumDecodeNullable(_$MethodTypeEnumMap, v)), + ); + return val; + }, + ); + +Map _$SourceJSONToJson(SourceJSON instance) { + final val = { + 'url': instance.url, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('uniqueIDColumn', instance.uniqueIDColumn); + writeNotNull('method', instance.method?.toJson()); + return val; +} + +const _$MethodTypeEnumMap = { + MethodType.get: 'GET', + MethodType.post: 'POST', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_search.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_search.dart new file mode 100644 index 0000000000..49cc111410 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_search.dart @@ -0,0 +1,35 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'source_search.g.dart'; + +@JsonSerializable() +final class SourceSearch { + /// Returns a new [SourceSearch] instance. + const SourceSearch({ + required this.sourceIDs, + }); + + @JsonKey(name: r'sourceIDs') + final List sourceIDs; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SourceSearch && other.sourceIDs == sourceIDs; + + @override + int get hashCode => sourceIDs.hashCode; + + factory SourceSearch.fromJson(Map json) => + _$SourceSearchFromJson(json); + + Map toJson() => _$SourceSearchToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_search.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_search.g.dart new file mode 100644 index 0000000000..12eb340e99 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_search.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'source_search.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SourceSearch _$SourceSearchFromJson(Map json) => + $checkedCreate( + 'SourceSearch', + json, + ($checkedConvert) { + final val = SourceSearch( + sourceIDs: $checkedConvert('sourceIDs', + (v) => (v as List).map((e) => e as String).toList()), + ); + return val; + }, + ); + +Map _$SourceSearchToJson(SourceSearch instance) => + { + 'sourceIDs': instance.sourceIDs, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_sort_keys.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_sort_keys.dart new file mode 100644 index 0000000000..da42366076 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_sort_keys.dart @@ -0,0 +1,34 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Used to sort the Source list endpoint. +@JsonEnum(valueField: 'raw') +enum SourceSortKeys { + /// Used to sort the Source list endpoint. + name(r'name'), + + /// Used to sort the Source list endpoint. + type(r'type'), + + /// Used to sort the Source list endpoint. + updatedAt(r'updatedAt'), + + /// Used to sort the Source list endpoint. + createdAt(r'createdAt'); + + const SourceSortKeys(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static SourceSortKeys fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_type.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_type.dart new file mode 100644 index 0000000000..4c6ac83357 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_type.dart @@ -0,0 +1,28 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum SourceType { + bigcommerce(r'bigcommerce'), + commercetools(r'commercetools'), + json(r'json'), + csv(r'csv'), + bigquery(r'bigquery'), + docker(r'docker'); + + const SourceType(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static SourceType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update.dart new file mode 100644 index 0000000000..bcdd5eee9e --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update.dart @@ -0,0 +1,54 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'source_update.g.dart'; + +@JsonSerializable() +final class SourceUpdate { + /// Returns a new [SourceUpdate] instance. + const SourceUpdate({ + this.name, + this.input, + this.authenticationID, + }); + + @JsonKey(name: r'name') + final String? name; + + /// One of types: + /// - [SourceBigQuery] + /// - [SourceDocker] + /// - [SourceUpdateCommercetools] + /// - [SourceCSV] + /// - [SourceJSON] + @JsonKey(name: r'input') + final dynamic input; + + /// The authentication UUID. + @JsonKey(name: r'authenticationID') + final String? authenticationID; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SourceUpdate && + other.name == name && + other.input == input && + other.authenticationID == authenticationID; + + @override + int get hashCode => + name.hashCode + input.hashCode + authenticationID.hashCode; + + factory SourceUpdate.fromJson(Map json) => + _$SourceUpdateFromJson(json); + + Map toJson() => _$SourceUpdateToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update.g.dart new file mode 100644 index 0000000000..79dd8fe739 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update.g.dart @@ -0,0 +1,37 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'source_update.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SourceUpdate _$SourceUpdateFromJson(Map json) => + $checkedCreate( + 'SourceUpdate', + json, + ($checkedConvert) { + final val = SourceUpdate( + name: $checkedConvert('name', (v) => v as String?), + input: $checkedConvert('input', (v) => v), + authenticationID: + $checkedConvert('authenticationID', (v) => v as String?), + ); + return val; + }, + ); + +Map _$SourceUpdateToJson(SourceUpdate instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('name', instance.name); + writeNotNull('input', instance.input); + writeNotNull('authenticationID', instance.authenticationID); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update_commercetools.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update_commercetools.dart new file mode 100644 index 0000000000..3b092458ac --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update_commercetools.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'source_update_commercetools.g.dart'; + +@JsonSerializable() +final class SourceUpdateCommercetools { + /// Returns a new [SourceUpdateCommercetools] instance. + const SourceUpdateCommercetools({ + this.storeKeys, + this.locales, + }); + + /// Unique and immutable key of the referenced Store. + @JsonKey(name: r'storeKeys') + final List? storeKeys; + + /// Array of locales that must match the following pattern: ^[a-z]{2}(-[A-Z]{2})?$. For example [\"fr-FR\", \"en\"]. + @JsonKey(name: r'locales') + final List? locales; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SourceUpdateCommercetools && + other.storeKeys == storeKeys && + other.locales == locales; + + @override + int get hashCode => storeKeys.hashCode + locales.hashCode; + + factory SourceUpdateCommercetools.fromJson(Map json) => + _$SourceUpdateCommercetoolsFromJson(json); + + Map toJson() => _$SourceUpdateCommercetoolsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update_commercetools.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update_commercetools.g.dart new file mode 100644 index 0000000000..64ba5f1482 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update_commercetools.g.dart @@ -0,0 +1,38 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'source_update_commercetools.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SourceUpdateCommercetools _$SourceUpdateCommercetoolsFromJson( + Map json) => + $checkedCreate( + 'SourceUpdateCommercetools', + json, + ($checkedConvert) { + final val = SourceUpdateCommercetools( + storeKeys: $checkedConvert('storeKeys', + (v) => (v as List?)?.map((e) => e as String).toList()), + locales: $checkedConvert('locales', + (v) => (v as List?)?.map((e) => e as String).toList()), + ); + return val; + }, + ); + +Map _$SourceUpdateCommercetoolsToJson( + SourceUpdateCommercetools instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('storeKeys', instance.storeKeys); + writeNotNull('locales', instance.locales); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update_response.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update_response.dart new file mode 100644 index 0000000000..8b261cf412 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update_response.dart @@ -0,0 +1,48 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'source_update_response.g.dart'; + +@JsonSerializable() +final class SourceUpdateResponse { + /// Returns a new [SourceUpdateResponse] instance. + const SourceUpdateResponse({ + required this.sourceID, + required this.name, + required this.updatedAt, + }); + + /// The source UUID. + @JsonKey(name: r'sourceID') + final String sourceID; + + @JsonKey(name: r'name') + final String name; + + /// Date of last update (RFC3339 format). + @JsonKey(name: r'updatedAt') + final String updatedAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SourceUpdateResponse && + other.sourceID == sourceID && + other.name == name && + other.updatedAt == updatedAt; + + @override + int get hashCode => sourceID.hashCode + name.hashCode + updatedAt.hashCode; + + factory SourceUpdateResponse.fromJson(Map json) => + _$SourceUpdateResponseFromJson(json); + + Map toJson() => _$SourceUpdateResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update_response.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update_response.g.dart new file mode 100644 index 0000000000..6d90fe2e33 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/source_update_response.g.dart @@ -0,0 +1,30 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'source_update_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SourceUpdateResponse _$SourceUpdateResponseFromJson( + Map json) => + $checkedCreate( + 'SourceUpdateResponse', + json, + ($checkedConvert) { + final val = SourceUpdateResponse( + sourceID: $checkedConvert('sourceID', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + updatedAt: $checkedConvert('updatedAt', (v) => v as String), + ); + return val; + }, + ); + +Map _$SourceUpdateResponseToJson( + SourceUpdateResponse instance) => + { + 'sourceID': instance.sourceID, + 'name': instance.name, + 'updatedAt': instance.updatedAt, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/subscription_trigger.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/subscription_trigger.dart new file mode 100644 index 0000000000..a184259fd7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/subscription_trigger.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/subscription_trigger_type.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'subscription_trigger.g.dart'; + +@JsonSerializable() +final class SubscriptionTrigger { + /// Returns a new [SubscriptionTrigger] instance. + const SubscriptionTrigger({ + required this.type, + }); + + @JsonKey(name: r'type') + final SubscriptionTriggerType type; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SubscriptionTrigger && other.type == type; + + @override + int get hashCode => type.hashCode; + + factory SubscriptionTrigger.fromJson(Map json) => + _$SubscriptionTriggerFromJson(json); + + Map toJson() => _$SubscriptionTriggerToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/subscription_trigger.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/subscription_trigger.g.dart new file mode 100644 index 0000000000..12ed313ccc --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/subscription_trigger.g.dart @@ -0,0 +1,30 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'subscription_trigger.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SubscriptionTrigger _$SubscriptionTriggerFromJson(Map json) => + $checkedCreate( + 'SubscriptionTrigger', + json, + ($checkedConvert) { + final val = SubscriptionTrigger( + type: $checkedConvert( + 'type', (v) => $enumDecode(_$SubscriptionTriggerTypeEnumMap, v)), + ); + return val; + }, + ); + +Map _$SubscriptionTriggerToJson( + SubscriptionTrigger instance) => + { + 'type': instance.type.toJson(), + }; + +const _$SubscriptionTriggerTypeEnumMap = { + SubscriptionTriggerType.subscription: 'subscription', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/subscription_trigger_type.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/subscription_trigger_type.dart new file mode 100644 index 0000000000..c89e761a15 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/subscription_trigger_type.dart @@ -0,0 +1,25 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// A task which is triggered by an external subscription (e.g. Webhook). +@JsonEnum(valueField: 'raw') +enum SubscriptionTriggerType { + /// A task which is triggered by an external subscription (e.g. Webhook). + subscription(r'subscription'); + + const SubscriptionTriggerType(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static SubscriptionTriggerType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task.dart new file mode 100644 index 0000000000..b8bb92ab78 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task.dart @@ -0,0 +1,98 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/action_type.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'task.g.dart'; + +@JsonSerializable() +final class Task { + /// Returns a new [Task] instance. + const Task({ + required this.taskID, + required this.sourceID, + required this.destinationID, + required this.trigger, + this.input, + required this.enabled, + required this.action, + required this.createdAt, + this.updatedAt, + }); + + /// The task UUID. + @JsonKey(name: r'taskID') + final String taskID; + + /// The source UUID. + @JsonKey(name: r'sourceID') + final String sourceID; + + /// The destination UUID. + @JsonKey(name: r'destinationID') + final String destinationID; + + /// One of types: + /// - [ScheduleTrigger] + /// - [OnDemandTrigger] + /// - [SubscriptionTrigger] + @JsonKey(name: r'trigger') + final dynamic trigger; + + /// One of types: + /// - [OnDemandDateUtilsInput] + /// - [ScheduleDateUtilsInput] + @JsonKey(name: r'input') + final dynamic input; + + /// Whether the task is enabled or not. + @JsonKey(name: r'enabled') + final bool enabled; + + @JsonKey(name: r'action') + final ActionType action; + + /// Date of creation (RFC3339 format). + @JsonKey(name: r'createdAt') + final String createdAt; + + /// Date of last update (RFC3339 format). + @JsonKey(name: r'updatedAt') + final String? updatedAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Task && + other.taskID == taskID && + other.sourceID == sourceID && + other.destinationID == destinationID && + other.trigger == trigger && + other.input == input && + other.enabled == enabled && + other.action == action && + other.createdAt == createdAt && + other.updatedAt == updatedAt; + + @override + int get hashCode => + taskID.hashCode + + sourceID.hashCode + + destinationID.hashCode + + trigger.hashCode + + input.hashCode + + enabled.hashCode + + action.hashCode + + createdAt.hashCode + + updatedAt.hashCode; + + factory Task.fromJson(Map json) => _$TaskFromJson(json); + + Map toJson() => _$TaskToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task.g.dart new file mode 100644 index 0000000000..d3076a3fee --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task.g.dart @@ -0,0 +1,54 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'task.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Task _$TaskFromJson(Map json) => $checkedCreate( + 'Task', + json, + ($checkedConvert) { + final val = Task( + taskID: $checkedConvert('taskID', (v) => v as String), + sourceID: $checkedConvert('sourceID', (v) => v as String), + destinationID: $checkedConvert('destinationID', (v) => v as String), + trigger: $checkedConvert('trigger', (v) => v), + input: $checkedConvert('input', (v) => v), + enabled: $checkedConvert('enabled', (v) => v as bool), + action: $checkedConvert( + 'action', (v) => $enumDecode(_$ActionTypeEnumMap, v)), + createdAt: $checkedConvert('createdAt', (v) => v as String), + updatedAt: $checkedConvert('updatedAt', (v) => v as String?), + ); + return val; + }, + ); + +Map _$TaskToJson(Task instance) { + final val = { + 'taskID': instance.taskID, + 'sourceID': instance.sourceID, + 'destinationID': instance.destinationID, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('trigger', instance.trigger); + writeNotNull('input', instance.input); + val['enabled'] = instance.enabled; + val['action'] = instance.action.toJson(); + val['createdAt'] = instance.createdAt; + writeNotNull('updatedAt', instance.updatedAt); + return val; +} + +const _$ActionTypeEnumMap = { + ActionType.replace: 'replace', + ActionType.save: 'save', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_create.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_create.dart new file mode 100644 index 0000000000..d6af258948 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_create.dart @@ -0,0 +1,78 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/action_type.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'task_create.g.dart'; + +@JsonSerializable() +final class TaskCreate { + /// Returns a new [TaskCreate] instance. + const TaskCreate({ + required this.sourceID, + required this.destinationID, + required this.trigger, + required this.action, + this.enabled, + this.input, + }); + + /// The source UUID. + @JsonKey(name: r'sourceID') + final String sourceID; + + /// The destination UUID. + @JsonKey(name: r'destinationID') + final String destinationID; + + /// One of types: + /// - [OnDemandTriggerInput] + /// - [ScheduleTriggerInput] + /// - [SubscriptionTrigger] + @JsonKey(name: r'trigger') + final dynamic trigger; + + @JsonKey(name: r'action') + final ActionType action; + + /// Whether the task is enabled or not. + @JsonKey(name: r'enabled') + final bool? enabled; + + /// One of types: + /// - [OnDemandDateUtilsInput] + /// - [ScheduleDateUtilsInput] + @JsonKey(name: r'input') + final dynamic input; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TaskCreate && + other.sourceID == sourceID && + other.destinationID == destinationID && + other.trigger == trigger && + other.action == action && + other.enabled == enabled && + other.input == input; + + @override + int get hashCode => + sourceID.hashCode + + destinationID.hashCode + + trigger.hashCode + + action.hashCode + + enabled.hashCode + + input.hashCode; + + factory TaskCreate.fromJson(Map json) => + _$TaskCreateFromJson(json); + + Map toJson() => _$TaskCreateToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_create.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_create.g.dart new file mode 100644 index 0000000000..7b523cf248 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_create.g.dart @@ -0,0 +1,48 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'task_create.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TaskCreate _$TaskCreateFromJson(Map json) => $checkedCreate( + 'TaskCreate', + json, + ($checkedConvert) { + final val = TaskCreate( + sourceID: $checkedConvert('sourceID', (v) => v as String), + destinationID: $checkedConvert('destinationID', (v) => v as String), + trigger: $checkedConvert('trigger', (v) => v), + action: $checkedConvert( + 'action', (v) => $enumDecode(_$ActionTypeEnumMap, v)), + enabled: $checkedConvert('enabled', (v) => v as bool?), + input: $checkedConvert('input', (v) => v), + ); + return val; + }, + ); + +Map _$TaskCreateToJson(TaskCreate instance) { + final val = { + 'sourceID': instance.sourceID, + 'destinationID': instance.destinationID, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('trigger', instance.trigger); + val['action'] = instance.action.toJson(); + writeNotNull('enabled', instance.enabled); + writeNotNull('input', instance.input); + return val; +} + +const _$ActionTypeEnumMap = { + ActionType.replace: 'replace', + ActionType.save: 'save', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_create_response.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_create_response.dart new file mode 100644 index 0000000000..7d1ec177d2 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_create_response.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'task_create_response.g.dart'; + +@JsonSerializable() +final class TaskCreateResponse { + /// Returns a new [TaskCreateResponse] instance. + const TaskCreateResponse({ + required this.taskID, + required this.createdAt, + }); + + /// The task UUID. + @JsonKey(name: r'taskID') + final String taskID; + + /// Date of creation (RFC3339 format). + @JsonKey(name: r'createdAt') + final String createdAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TaskCreateResponse && + other.taskID == taskID && + other.createdAt == createdAt; + + @override + int get hashCode => taskID.hashCode + createdAt.hashCode; + + factory TaskCreateResponse.fromJson(Map json) => + _$TaskCreateResponseFromJson(json); + + Map toJson() => _$TaskCreateResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_create_response.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_create_response.g.dart new file mode 100644 index 0000000000..cba06b7749 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_create_response.g.dart @@ -0,0 +1,26 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'task_create_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TaskCreateResponse _$TaskCreateResponseFromJson(Map json) => + $checkedCreate( + 'TaskCreateResponse', + json, + ($checkedConvert) { + final val = TaskCreateResponse( + taskID: $checkedConvert('taskID', (v) => v as String), + createdAt: $checkedConvert('createdAt', (v) => v as String), + ); + return val; + }, + ); + +Map _$TaskCreateResponseToJson(TaskCreateResponse instance) => + { + 'taskID': instance.taskID, + 'createdAt': instance.createdAt, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_search.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_search.dart new file mode 100644 index 0000000000..1c29e71ba5 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_search.dart @@ -0,0 +1,34 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'task_search.g.dart'; + +@JsonSerializable() +final class TaskSearch { + /// Returns a new [TaskSearch] instance. + const TaskSearch({ + required this.taskIDs, + }); + + @JsonKey(name: r'taskIDs') + final List taskIDs; + + @override + bool operator ==(Object other) => + identical(this, other) || other is TaskSearch && other.taskIDs == taskIDs; + + @override + int get hashCode => taskIDs.hashCode; + + factory TaskSearch.fromJson(Map json) => + _$TaskSearchFromJson(json); + + Map toJson() => _$TaskSearchToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_search.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_search.g.dart new file mode 100644 index 0000000000..464c56e7a2 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_search.g.dart @@ -0,0 +1,24 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'task_search.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TaskSearch _$TaskSearchFromJson(Map json) => $checkedCreate( + 'TaskSearch', + json, + ($checkedConvert) { + final val = TaskSearch( + taskIDs: $checkedConvert('taskIDs', + (v) => (v as List).map((e) => e as String).toList()), + ); + return val; + }, + ); + +Map _$TaskSearchToJson(TaskSearch instance) => + { + 'taskIDs': instance.taskIDs, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_sort_keys.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_sort_keys.dart new file mode 100644 index 0000000000..43ab81b677 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_sort_keys.dart @@ -0,0 +1,37 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Used to sort the Task list endpoint. +@JsonEnum(valueField: 'raw') +enum TaskSortKeys { + /// Used to sort the Task list endpoint. + enabled(r'enabled'), + + /// Used to sort the Task list endpoint. + triggerType(r'triggerType'), + + /// Used to sort the Task list endpoint. + action(r'action'), + + /// Used to sort the Task list endpoint. + updatedAt(r'updatedAt'), + + /// Used to sort the Task list endpoint. + createdAt(r'createdAt'); + + const TaskSortKeys(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static TaskSortKeys fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_update.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_update.dart new file mode 100644 index 0000000000..164ecc609d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_update.dart @@ -0,0 +1,61 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/trigger_input.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'task_update.g.dart'; + +@JsonSerializable() +final class TaskUpdate { + /// Returns a new [TaskUpdate] instance. + const TaskUpdate({ + this.destinationID, + this.trigger, + this.input, + this.enabled, + }); + + /// The destination UUID. + @JsonKey(name: r'destinationID') + final String? destinationID; + + @JsonKey(name: r'trigger') + final TriggerInput? trigger; + + /// One of types: + /// - [OnDemandDateUtilsInput] + /// - [ScheduleDateUtilsInput] + @JsonKey(name: r'input') + final dynamic input; + + /// Whether the task is enabled or not. + @JsonKey(name: r'enabled') + final bool? enabled; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TaskUpdate && + other.destinationID == destinationID && + other.trigger == trigger && + other.input == input && + other.enabled == enabled; + + @override + int get hashCode => + destinationID.hashCode + + trigger.hashCode + + input.hashCode + + enabled.hashCode; + + factory TaskUpdate.fromJson(Map json) => + _$TaskUpdateFromJson(json); + + Map toJson() => _$TaskUpdateToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_update.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_update.g.dart new file mode 100644 index 0000000000..7922bf3bbd --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_update.g.dart @@ -0,0 +1,41 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'task_update.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TaskUpdate _$TaskUpdateFromJson(Map json) => $checkedCreate( + 'TaskUpdate', + json, + ($checkedConvert) { + final val = TaskUpdate( + destinationID: $checkedConvert('destinationID', (v) => v as String?), + trigger: $checkedConvert( + 'trigger', + (v) => v == null + ? null + : TriggerInput.fromJson(v as Map)), + input: $checkedConvert('input', (v) => v), + enabled: $checkedConvert('enabled', (v) => v as bool?), + ); + return val; + }, + ); + +Map _$TaskUpdateToJson(TaskUpdate instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('destinationID', instance.destinationID); + writeNotNull('trigger', instance.trigger?.toJson()); + writeNotNull('input', instance.input); + writeNotNull('enabled', instance.enabled); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_update_response.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_update_response.dart new file mode 100644 index 0000000000..ca70ad220e --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_update_response.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'task_update_response.g.dart'; + +@JsonSerializable() +final class TaskUpdateResponse { + /// Returns a new [TaskUpdateResponse] instance. + const TaskUpdateResponse({ + required this.taskID, + required this.updatedAt, + }); + + /// The task UUID. + @JsonKey(name: r'taskID') + final String taskID; + + /// Date of last update (RFC3339 format). + @JsonKey(name: r'updatedAt') + final String updatedAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TaskUpdateResponse && + other.taskID == taskID && + other.updatedAt == updatedAt; + + @override + int get hashCode => taskID.hashCode + updatedAt.hashCode; + + factory TaskUpdateResponse.fromJson(Map json) => + _$TaskUpdateResponseFromJson(json); + + Map toJson() => _$TaskUpdateResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_update_response.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_update_response.g.dart new file mode 100644 index 0000000000..d27b9965ec --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/task_update_response.g.dart @@ -0,0 +1,26 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'task_update_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TaskUpdateResponse _$TaskUpdateResponseFromJson(Map json) => + $checkedCreate( + 'TaskUpdateResponse', + json, + ($checkedConvert) { + final val = TaskUpdateResponse( + taskID: $checkedConvert('taskID', (v) => v as String), + updatedAt: $checkedConvert('updatedAt', (v) => v as String), + ); + return val; + }, + ); + +Map _$TaskUpdateResponseToJson(TaskUpdateResponse instance) => + { + 'taskID': instance.taskID, + 'updatedAt': instance.updatedAt, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/trigger_input.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/trigger_input.dart new file mode 100644 index 0000000000..c02e300571 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/trigger_input.dart @@ -0,0 +1,35 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_ingestion/src/model/trigger_type.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'trigger_input.g.dart'; + +@JsonSerializable() +final class TriggerInput { + /// Returns a new [TriggerInput] instance. + const TriggerInput({ + required this.type, + }); + + @JsonKey(name: r'type') + final TriggerType type; + + @override + bool operator ==(Object other) => + identical(this, other) || other is TriggerInput && other.type == type; + + @override + int get hashCode => type.hashCode; + + factory TriggerInput.fromJson(Map json) => + _$TriggerInputFromJson(json); + + Map toJson() => _$TriggerInputToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/trigger_input.g.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/trigger_input.g.dart new file mode 100644 index 0000000000..49f21145de --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/trigger_input.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'trigger_input.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TriggerInput _$TriggerInputFromJson(Map json) => + $checkedCreate( + 'TriggerInput', + json, + ($checkedConvert) { + final val = TriggerInput( + type: $checkedConvert( + 'type', (v) => $enumDecode(_$TriggerTypeEnumMap, v)), + ); + return val; + }, + ); + +Map _$TriggerInputToJson(TriggerInput instance) => + { + 'type': instance.type.toJson(), + }; + +const _$TriggerTypeEnumMap = { + TriggerType.onDemand: 'onDemand', + TriggerType.schedule: 'schedule', + TriggerType.subscription: 'subscription', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/trigger_type.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/trigger_type.dart new file mode 100644 index 0000000000..2d24ddc026 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/model/trigger_type.dart @@ -0,0 +1,31 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// The type of the task reflect how it can be used: - onDemand: a task that runs manually - schedule: a task that runs regularly, following a given cron expression - subscription: a task that runs after a subscription event is received from an integration (e.g. Webhook). +@JsonEnum(valueField: 'raw') +enum TriggerType { + /// The type of the task reflect how it can be used: - onDemand: a task that runs manually - schedule: a task that runs regularly, following a given cron expression - subscription: a task that runs after a subscription event is received from an integration (e.g. Webhook). + onDemand(r'onDemand'), + + /// The type of the task reflect how it can be used: - onDemand: a task that runs manually - schedule: a task that runs regularly, following a given cron expression - subscription: a task that runs after a subscription event is received from an integration (e.g. Webhook). + schedule(r'schedule'), + + /// The type of the task reflect how it can be used: - onDemand: a task that runs manually - schedule: a task that runs regularly, following a given cron expression - subscription: a task that runs after a subscription event is received from an integration (e.g. Webhook). + subscription(r'subscription'); + + const TriggerType(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static TriggerType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/version.dart b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/version.dart new file mode 100644 index 0000000000..03e065a0a8 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/lib/src/version.dart @@ -0,0 +1,2 @@ +/// Current package version +const packageVersion = '0.1.2'; diff --git a/clients/algoliasearch-client-dart/packages/client_ingestion/pubspec.yaml b/clients/algoliasearch-client-dart/packages/client_ingestion/pubspec.yaml new file mode 100644 index 0000000000..19b0aeceb3 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_ingestion/pubspec.yaml @@ -0,0 +1,24 @@ +name: algolia_client_ingestion +version: 0.1.2 +description: A sub-package of the AlgoliaSearch library, offering ingestion-specific functionalities for enhanced search and discovery in Dart/Flutter apps. +homepage: https://www.algolia.com/doc/ +repository: https://github.com/algolia/algoliasearch-client-dart/tree/main/packages/client_ingestion +topics: + - search + - discovery + +environment: + sdk: '>=3.0.0 <4.0.0' + +dependencies: + # Pinning versions until the API stabilizes. + algolia_client_core: 0.1.1+4 + json_annotation: ^4.8.1 + collection: ^1.17.1 + +dev_dependencies: + build_runner: ^2.4.4 + json_serializable: ^6.7.0 + lints: ^2.1.1 + logging: ^1.2.0 + test: ^1.24.3 diff --git a/clients/algoliasearch-client-dart/packages/client_insights/lib/src/api/insights_client.dart b/clients/algoliasearch-client-dart/packages/client_insights/lib/src/api/insights_client.dart index 4035ef7b52..591b6d33d2 100644 --- a/clients/algoliasearch-client-dart/packages/client_insights/lib/src/api/insights_client.dart +++ b/clients/algoliasearch-client-dart/packages/client_insights/lib/src/api/insights_client.dart @@ -51,8 +51,8 @@ final class InsightsClient implements ApiClient { /// This method allow you to send requests to the Algolia REST API. /// /// Parameters: - /// * [path] - Path of the endpoint, anything after \"/1\" must be specified. - /// * [parameters] - Query parameters to apply to the current query. + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. /// * [requestOptions] additional request configuration. Future del({ required String path, @@ -85,8 +85,8 @@ final class InsightsClient implements ApiClient { /// This method allow you to send requests to the Algolia REST API. /// /// Parameters: - /// * [path] - Path of the endpoint, anything after \"/1\" must be specified. - /// * [parameters] - Query parameters to apply to the current query. + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. /// * [requestOptions] additional request configuration. Future get({ required String path, @@ -119,9 +119,9 @@ final class InsightsClient implements ApiClient { /// This method allow you to send requests to the Algolia REST API. /// /// Parameters: - /// * [path] - Path of the endpoint, anything after \"/1\" must be specified. - /// * [parameters] - Query parameters to apply to the current query. - /// * [body] - Parameters to send with the custom request. + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [body] Parameters to send with the custom request. /// * [requestOptions] additional request configuration. Future post({ required String path, @@ -182,9 +182,9 @@ final class InsightsClient implements ApiClient { /// This method allow you to send requests to the Algolia REST API. /// /// Parameters: - /// * [path] - Path of the endpoint, anything after \"/1\" must be specified. - /// * [parameters] - Query parameters to apply to the current query. - /// * [body] - Parameters to send with the custom request. + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [body] Parameters to send with the custom request. /// * [requestOptions] additional request configuration. Future put({ required String path, diff --git a/clients/algoliasearch-client-dart/packages/client_insights/lib/src/deserialize.dart b/clients/algoliasearch-client-dart/packages/client_insights/lib/src/deserialize.dart index 5e29b636ac..ac7abd64f2 100644 --- a/clients/algoliasearch-client-dart/packages/client_insights/lib/src/deserialize.dart +++ b/clients/algoliasearch-client-dart/packages/client_insights/lib/src/deserialize.dart @@ -1,12 +1,15 @@ +import 'package:algolia_client_insights/src/model/click_event.dart'; import 'package:algolia_client_insights/src/model/clicked_filters.dart'; import 'package:algolia_client_insights/src/model/clicked_object_ids.dart'; import 'package:algolia_client_insights/src/model/clicked_object_ids_after_search.dart'; +import 'package:algolia_client_insights/src/model/conversion_event.dart'; import 'package:algolia_client_insights/src/model/converted_filters.dart'; import 'package:algolia_client_insights/src/model/converted_object_ids.dart'; import 'package:algolia_client_insights/src/model/converted_object_ids_after_search.dart'; import 'package:algolia_client_insights/src/model/error_base.dart'; import 'package:algolia_client_insights/src/model/events_response.dart'; import 'package:algolia_client_insights/src/model/insights_events.dart'; +import 'package:algolia_client_insights/src/model/view_event.dart'; import 'package:algolia_client_insights/src/model/viewed_filters.dart'; import 'package:algolia_client_insights/src/model/viewed_object_ids.dart'; @@ -30,6 +33,7 @@ ReturnType deserialize(dynamic value, String targetType, case 'double': return (value is double ? value : double.parse('$value')) as ReturnType; case 'ClickEvent': + return ClickEvent.fromJson(value) as ReturnType; case 'ClickedFilters': return ClickedFilters.fromJson(value as Map) as ReturnType; @@ -40,6 +44,7 @@ ReturnType deserialize(dynamic value, String targetType, return ClickedObjectIDsAfterSearch.fromJson(value as Map) as ReturnType; case 'ConversionEvent': + return ConversionEvent.fromJson(value) as ReturnType; case 'ConvertedFilters': return ConvertedFilters.fromJson(value as Map) as ReturnType; @@ -58,6 +63,7 @@ ReturnType deserialize(dynamic value, String targetType, return InsightsEvents.fromJson(value as Map) as ReturnType; case 'ViewEvent': + return ViewEvent.fromJson(value) as ReturnType; case 'ViewedFilters': return ViewedFilters.fromJson(value as Map) as ReturnType; diff --git a/clients/algoliasearch-client-dart/packages/client_insights/lib/src/model/click_event.dart b/clients/algoliasearch-client-dart/packages/client_insights/lib/src/model/click_event.dart index c88b2ecc6a..9bc26a294c 100644 --- a/clients/algoliasearch-client-dart/packages/client_insights/lib/src/model/click_event.dart +++ b/clients/algoliasearch-client-dart/packages/client_insights/lib/src/model/click_event.dart @@ -11,6 +11,13 @@ enum ClickEvent { dynamic toJson() => raw; + static ClickEvent fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_insights/lib/src/model/conversion_event.dart b/clients/algoliasearch-client-dart/packages/client_insights/lib/src/model/conversion_event.dart index cc838ea922..0f052499ba 100644 --- a/clients/algoliasearch-client-dart/packages/client_insights/lib/src/model/conversion_event.dart +++ b/clients/algoliasearch-client-dart/packages/client_insights/lib/src/model/conversion_event.dart @@ -11,6 +11,13 @@ enum ConversionEvent { dynamic toJson() => raw; + static ConversionEvent fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_insights/lib/src/model/insights_events.dart b/clients/algoliasearch-client-dart/packages/client_insights/lib/src/model/insights_events.dart index ec46dbf35b..243a01859b 100644 --- a/clients/algoliasearch-client-dart/packages/client_insights/lib/src/model/insights_events.dart +++ b/clients/algoliasearch-client-dart/packages/client_insights/lib/src/model/insights_events.dart @@ -13,6 +13,15 @@ final class InsightsEvents { }); /// List of click and conversion events. An event is an object representing a user interaction. Events have attributes that describe the interaction, such as an event name, a type, or a user token. Some attributes require other attributes to be declared, and some attributes can't be declared at the same time. **All** events must be valid, otherwise the API returns an error. + /// One of types: + /// - [ViewedObjectIDs] + /// - [ClickedObjectIDsAfterSearch] + /// - [ClickedFilters] + /// - [ClickedObjectIDs] + /// - [ConvertedObjectIDs] + /// - [ViewedFilters] + /// - [ConvertedFilters] + /// - [ConvertedObjectIDsAfterSearch] @JsonKey(name: r'events') final Iterable events; diff --git a/clients/algoliasearch-client-dart/packages/client_insights/lib/src/model/view_event.dart b/clients/algoliasearch-client-dart/packages/client_insights/lib/src/model/view_event.dart index 269d1cf410..b4fc4ae23e 100644 --- a/clients/algoliasearch-client-dart/packages/client_insights/lib/src/model/view_event.dart +++ b/clients/algoliasearch-client-dart/packages/client_insights/lib/src/model/view_event.dart @@ -11,6 +11,13 @@ enum ViewEvent { dynamic toJson() => raw; + static ViewEvent fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_insights/pubspec.yaml b/clients/algoliasearch-client-dart/packages/client_insights/pubspec.yaml index 0422b7ef00..522dc3f10e 100644 --- a/clients/algoliasearch-client-dart/packages/client_insights/pubspec.yaml +++ b/clients/algoliasearch-client-dart/packages/client_insights/pubspec.yaml @@ -12,7 +12,7 @@ environment: dependencies: # Pinning versions until the API stabilizes. - algolia_client_core: 0.1.1+1 + algolia_client_core: 0.1.1+4 json_annotation: ^4.8.1 collection: ^1.17.1 diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/build.yaml b/clients/algoliasearch-client-dart/packages/client_monitoring/build.yaml new file mode 100644 index 0000000000..6d71b406a7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/build.yaml @@ -0,0 +1,14 @@ +targets: + $default: + builders: + json_serializable: + options: + any_map: false + checked: true + create_factory: true + create_to_json: true + disallow_unrecognized_keys: false + explicit_to_json: true + field_rename: none + ignore_unannotated: false + include_if_null: false diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/algolia_client_monitoring.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/algolia_client_monitoring.dart new file mode 100644 index 0000000000..80e3beabeb --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/algolia_client_monitoring.dart @@ -0,0 +1,31 @@ +// A sub-package of the AlgoliaSearch library, offering monitoring-specific functionalities for enhanced search and discovery in Dart/Flutter apps. +library algolia_client_monitoring; + +export 'package:algolia_client_core/algolia_client_core.dart'; + +export 'src/api/monitoring_client.dart'; + +export 'src/model/error_base.dart'; +export 'src/model/get_inventory403_response.dart'; +export 'src/model/incident.dart'; +export 'src/model/incidents_inner.dart'; +export 'src/model/incidents_response.dart'; +export 'src/model/indexing_time_response.dart'; +export 'src/model/indexing_time_response_metrics.dart'; +export 'src/model/infrastructure_response.dart'; +export 'src/model/infrastructure_response_metrics.dart'; +export 'src/model/inventory_response.dart'; +export 'src/model/latency_response.dart'; +export 'src/model/latency_response_metrics.dart'; +export 'src/model/metric.dart'; +export 'src/model/period.dart'; +export 'src/model/probes_metric.dart'; +export 'src/model/region.dart'; +export 'src/model/server.dart'; +export 'src/model/server_status.dart'; +export 'src/model/status.dart'; +export 'src/model/status_response.dart'; +export 'src/model/time_inner.dart'; +export 'src/model/type.dart'; + +export 'src/extension.dart'; diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/api/monitoring_client.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/api/monitoring_client.dart new file mode 100644 index 0000000000..c6bbca78e8 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/api/monitoring_client.dart @@ -0,0 +1,445 @@ +// 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. + +import 'package:algolia_client_core/algolia_client_core.dart'; +import 'package:algolia_client_monitoring/src/deserialize.dart'; +import 'package:algolia_client_monitoring/src/version.dart'; + +import 'package:algolia_client_monitoring/src/model/incidents_response.dart'; +import 'package:algolia_client_monitoring/src/model/indexing_time_response.dart'; +import 'package:algolia_client_monitoring/src/model/infrastructure_response.dart'; +import 'package:algolia_client_monitoring/src/model/inventory_response.dart'; +import 'package:algolia_client_monitoring/src/model/latency_response.dart'; +import 'package:algolia_client_monitoring/src/model/metric.dart'; +import 'package:algolia_client_monitoring/src/model/period.dart'; +import 'package:algolia_client_monitoring/src/model/status_response.dart'; + +final class MonitoringClient implements ApiClient { + @override + final String apiKey; + + @override + final String appId; + + @override + final ClientOptions options; + + final RetryStrategy _retryStrategy; + + MonitoringClient({ + required this.appId, + required this.apiKey, + this.options = const ClientOptions(), + }) : _retryStrategy = RetryStrategy.create( + segment: AgentSegment(value: "Monitoring", version: packageVersion), + appId: appId, + apiKey: apiKey, + options: options, + defaultHosts: () => + [ + Host(url: '$appId-dsn.algolia.net', callType: CallType.read), + Host(url: '$appId.algolia.net', callType: CallType.write), + ] + + ([ + Host(url: '$appId-1.algolianet.com'), + Host(url: '$appId-2.algolianet.com'), + Host(url: '$appId-3.algolianet.com'), + ]..shuffle()), + ) { + assert(appId.isNotEmpty, '`appId` is missing.'); + assert(apiKey.isNotEmpty, '`apiKey` is missing.'); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [requestOptions] additional request configuration. + Future del({ + required String path, + Map? parameters, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `del`.', + ); + final request = ApiRequest( + method: RequestMethod.delete, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [requestOptions] additional request configuration. + Future get({ + required String path, + Map? parameters, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `get`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// List incidents for selected clusters. + /// List known incidents for selected clusters. + /// + /// Parameters: + /// * [clusters] Subset of clusters, separated by comma. + /// * [requestOptions] additional request configuration. + Future getClusterIncidents({ + required String clusters, + RequestOptions? requestOptions, + }) async { + assert( + clusters.isNotEmpty, + 'Parameter `clusters` is required when calling `getClusterIncidents`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/incidents/{clusters}'.replaceAll( + '{' r'clusters' '}', Uri.encodeComponent(clusters.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'IncidentsResponse', + growable: true, + ); + } + + /// List statuses of selected clusters. + /// Report whether a cluster is operational. + /// + /// Parameters: + /// * [clusters] Subset of clusters, separated by comma. + /// * [requestOptions] additional request configuration. + Future getClusterStatus({ + required String clusters, + RequestOptions? requestOptions, + }) async { + assert( + clusters.isNotEmpty, + 'Parameter `clusters` is required when calling `getClusterStatus`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/status/{clusters}'.replaceAll( + '{' r'clusters' '}', Uri.encodeComponent(clusters.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'StatusResponse', + growable: true, + ); + } + + /// List incidents. + /// List known incidents for all clusters. + /// + /// Parameters: + /// * [requestOptions] additional request configuration. + Future getIncidents({ + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/incidents', + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'IncidentsResponse', + growable: true, + ); + } + + /// Get indexing times. + /// List the average times for indexing operations for selected clusters. + /// + /// Parameters: + /// * [clusters] Subset of clusters, separated by comma. + /// * [requestOptions] additional request configuration. + Future getIndexingTime({ + required String clusters, + RequestOptions? requestOptions, + }) async { + assert( + clusters.isNotEmpty, + 'Parameter `clusters` is required when calling `getIndexingTime`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/indexing/{clusters}'.replaceAll( + '{' r'clusters' '}', Uri.encodeComponent(clusters.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'IndexingTimeResponse', + growable: true, + ); + } + + /// List servers. + /// List the servers belonging to clusters. The response depends on whether you authenticate your API request: - With authentication, the response lists the servers assigned to your Algolia application's cluster. - Without authentication, the response lists the servers for all Algolia clusters. + /// + /// Parameters: + /// * [requestOptions] additional request configuration. + Future getInventory({ + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/inventory/servers', + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'InventoryResponse', + growable: true, + ); + } + + /// Get search latency times. + /// List the average latency for search requests for selected clusters. + /// + /// Parameters: + /// * [clusters] Subset of clusters, separated by comma. + /// * [requestOptions] additional request configuration. + Future getLatency({ + required String clusters, + RequestOptions? requestOptions, + }) async { + assert( + clusters.isNotEmpty, + 'Parameter `clusters` is required when calling `getLatency`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/latency/{clusters}'.replaceAll( + '{' r'clusters' '}', Uri.encodeComponent(clusters.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'LatencyResponse', + growable: true, + ); + } + + /// Get metrics for a given period. + /// Report the aggregate value of a metric for a selected period of time. + /// + /// Parameters: + /// * [metric] Metric to report. For more information about the individual metrics, see the response. To include all metrics, use `*` as the parameter. + /// * [period] Period over which to aggregate the metrics: - `minute`. Aggregate the last minute. 1 data point per 10 seconds. - `hour`. Aggregate the last hour. 1 data point per minute. - `day`. Aggregate the last day. 1 data point per 10 minutes. - `week`. Aggregate the last week. 1 data point per hour. - `month`. Aggregate the last month. 1 data point per day. + /// * [requestOptions] additional request configuration. + Future getMetrics({ + required Metric metric, + required Period period, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/infrastructure/{metric}/period/{period}' + .replaceAll('{' r'metric' '}', Uri.encodeComponent(metric.toString())) + .replaceAll( + '{' r'period' '}', Uri.encodeComponent(period.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'InfrastructureResponse', + growable: true, + ); + } + + /// Test the reachability of clusters. + /// Test whether clusters are reachable or not. + /// + /// Parameters: + /// * [clusters] Subset of clusters, separated by comma. + /// * [requestOptions] additional request configuration. + Future>> getReachability({ + required String clusters, + RequestOptions? requestOptions, + }) async { + assert( + clusters.isNotEmpty, + 'Parameter `clusters` is required when calling `getReachability`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/reachability/{clusters}/probes'.replaceAll( + '{' r'clusters' '}', Uri.encodeComponent(clusters.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize>, Map>( + response, + 'Map>', + growable: true, + ); + } + + /// List cluster statuses. + /// Report whether clusters are operational. The response depends on whether you authenticate your API request. - With authentication, the response includes the status of the cluster assigned to your Algolia application. - Without authentication, the response lists the statuses of all public Algolia clusters. + /// + /// Parameters: + /// * [requestOptions] additional request configuration. + Future getStatus({ + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/status', + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'StatusResponse', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [body] Parameters to send with the custom request. + /// * [requestOptions] additional request configuration. + Future post({ + required String path, + Map? parameters, + Object? body, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `post`.', + ); + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + body: body, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [body] Parameters to send with the custom request. + /// * [requestOptions] additional request configuration. + Future put({ + required String path, + Map? parameters, + Object? body, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `put`.', + ); + final request = ApiRequest( + method: RequestMethod.put, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + body: body, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + @override + void dispose() => _retryStrategy.dispose(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/deserialize.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/deserialize.dart new file mode 100644 index 0000000000..fa556f1b0b --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/deserialize.dart @@ -0,0 +1,132 @@ +import 'package:algolia_client_monitoring/src/model/error_base.dart'; +import 'package:algolia_client_monitoring/src/model/get_inventory403_response.dart'; +import 'package:algolia_client_monitoring/src/model/incident.dart'; +import 'package:algolia_client_monitoring/src/model/incidents_inner.dart'; +import 'package:algolia_client_monitoring/src/model/incidents_response.dart'; +import 'package:algolia_client_monitoring/src/model/indexing_time_response.dart'; +import 'package:algolia_client_monitoring/src/model/indexing_time_response_metrics.dart'; +import 'package:algolia_client_monitoring/src/model/infrastructure_response.dart'; +import 'package:algolia_client_monitoring/src/model/infrastructure_response_metrics.dart'; +import 'package:algolia_client_monitoring/src/model/inventory_response.dart'; +import 'package:algolia_client_monitoring/src/model/latency_response.dart'; +import 'package:algolia_client_monitoring/src/model/latency_response_metrics.dart'; +import 'package:algolia_client_monitoring/src/model/metric.dart'; +import 'package:algolia_client_monitoring/src/model/period.dart'; +import 'package:algolia_client_monitoring/src/model/probes_metric.dart'; +import 'package:algolia_client_monitoring/src/model/region.dart'; +import 'package:algolia_client_monitoring/src/model/server.dart'; +import 'package:algolia_client_monitoring/src/model/server_status.dart'; +import 'package:algolia_client_monitoring/src/model/status.dart'; +import 'package:algolia_client_monitoring/src/model/status_response.dart'; +import 'package:algolia_client_monitoring/src/model/time_inner.dart'; +import 'package:algolia_client_monitoring/src/model/type.dart'; + +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + +ReturnType deserialize(dynamic value, String targetType, + {bool growable = true}) { + switch (targetType) { + case 'String': + return '$value' as ReturnType; + case 'int': + return (value is int ? value : int.parse('$value')) as ReturnType; + case 'bool': + if (value is bool) { + return value as ReturnType; + } + final valueString = '$value'.toLowerCase(); + return (valueString == 'true' || valueString == '1') as ReturnType; + case 'double': + return (value is double ? value : double.parse('$value')) as ReturnType; + case 'ErrorBase': + return ErrorBase.fromJson(value as Map) as ReturnType; + case 'GetInventory403Response': + return GetInventory403Response.fromJson(value as Map) + as ReturnType; + case 'Incident': + return Incident.fromJson(value as Map) as ReturnType; + case 'IncidentsInner': + return IncidentsInner.fromJson(value as Map) + as ReturnType; + case 'IncidentsResponse': + return IncidentsResponse.fromJson(value as Map) + as ReturnType; + case 'IndexingTimeResponse': + return IndexingTimeResponse.fromJson(value as Map) + as ReturnType; + case 'IndexingTimeResponseMetrics': + return IndexingTimeResponseMetrics.fromJson(value as Map) + as ReturnType; + case 'InfrastructureResponse': + return InfrastructureResponse.fromJson(value as Map) + as ReturnType; + case 'InfrastructureResponseMetrics': + return InfrastructureResponseMetrics.fromJson( + value as Map) as ReturnType; + case 'InventoryResponse': + return InventoryResponse.fromJson(value as Map) + as ReturnType; + case 'LatencyResponse': + return LatencyResponse.fromJson(value as Map) + as ReturnType; + case 'LatencyResponseMetrics': + return LatencyResponseMetrics.fromJson(value as Map) + as ReturnType; + case 'Metric': + return Metric.fromJson(value) as ReturnType; + case 'Period': + return Period.fromJson(value) as ReturnType; + case 'ProbesMetric': + return ProbesMetric.fromJson(value as Map) as ReturnType; + case 'Region': + return Region.fromJson(value) as ReturnType; + case 'Server': + return Server.fromJson(value as Map) as ReturnType; + case 'ServerStatus': + return ServerStatus.fromJson(value) as ReturnType; + case 'Status': + return Status.fromJson(value) as ReturnType; + case 'StatusResponse': + return StatusResponse.fromJson(value as Map) + as ReturnType; + case 'TimeInner': + return TimeInner.fromJson(value as Map) as ReturnType; + case 'Type': + return Type.fromJson(value) as ReturnType; + default: + RegExpMatch? match; + + if (value is List && (match = _regList.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toList(growable: growable) as ReturnType; + } + if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toSet() as ReturnType; + } + if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return Map.fromIterables( + value.keys, + value.values.map((dynamic v) => deserialize( + v, targetType, + growable: growable)), + ) as ReturnType; + } + if (targetType == 'Object') { + return value; + } + break; + } + throw Exception('Cannot deserialize'); +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/error_base.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/error_base.dart new file mode 100644 index 0000000000..df5d4ade57 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/error_base.dart @@ -0,0 +1,47 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:collection/collection.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'error_base.g.dart'; + +@JsonSerializable(createFieldMap: true) +final class ErrorBase extends DelegatingMap { + /// Returns a new [ErrorBase] instance. + const ErrorBase({ + this.message, + Map additionalProperties = const {}, + }) : super(additionalProperties); + + @JsonKey(name: r'message') + final String? message; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ErrorBase && + other.message == message && + const MapEquality().equals(this, this); + + @override + int get hashCode => + message.hashCode + const MapEquality().hash(this); + + factory ErrorBase.fromJson(Map json) { + final instance = _$ErrorBaseFromJson(json); + final additionalProperties = Map.from(json) + ..removeWhere((key, value) => _$ErrorBaseFieldMap.containsKey(key)); + return ErrorBase( + message: instance.message, + additionalProperties: additionalProperties, + ); + } + + Map toJson() => _$ErrorBaseToJson(this)..addAll(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/error_base.g.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/error_base.g.dart new file mode 100644 index 0000000000..f796166fb2 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/error_base.g.dart @@ -0,0 +1,35 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'error_base.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ErrorBase _$ErrorBaseFromJson(Map json) => $checkedCreate( + 'ErrorBase', + json, + ($checkedConvert) { + final val = ErrorBase( + message: $checkedConvert('message', (v) => v as String?), + ); + return val; + }, + ); + +const _$ErrorBaseFieldMap = { + 'message': 'message', +}; + +Map _$ErrorBaseToJson(ErrorBase instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('message', instance.message); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/get_inventory403_response.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/get_inventory403_response.dart new file mode 100644 index 0000000000..798a743702 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/get_inventory403_response.dart @@ -0,0 +1,35 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_inventory403_response.g.dart'; + +@JsonSerializable() +final class GetInventory403Response { + /// Returns a new [GetInventory403Response] instance. + const GetInventory403Response({ + this.reason, + }); + + @JsonKey(name: r'reason') + final String? reason; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetInventory403Response && other.reason == reason; + + @override + int get hashCode => reason.hashCode; + + factory GetInventory403Response.fromJson(Map json) => + _$GetInventory403ResponseFromJson(json); + + Map toJson() => _$GetInventory403ResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/get_inventory403_response.g.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/get_inventory403_response.g.dart new file mode 100644 index 0000000000..ace0719b2c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/get_inventory403_response.g.dart @@ -0,0 +1,34 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_inventory403_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetInventory403Response _$GetInventory403ResponseFromJson( + Map json) => + $checkedCreate( + 'GetInventory403Response', + json, + ($checkedConvert) { + final val = GetInventory403Response( + reason: $checkedConvert('reason', (v) => v as String?), + ); + return val; + }, + ); + +Map _$GetInventory403ResponseToJson( + GetInventory403Response instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('reason', instance.reason); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incident.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incident.dart new file mode 100644 index 0000000000..473b6ebb52 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incident.dart @@ -0,0 +1,41 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_monitoring/src/model/status.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'incident.g.dart'; + +@JsonSerializable() +final class Incident { + /// Returns a new [Incident] instance. + const Incident({ + this.title, + this.status, + }); + + /// Description of the incident. + @JsonKey(name: r'title') + final String? title; + + @JsonKey(name: r'status') + final Status? status; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Incident && other.title == title && other.status == status; + + @override + int get hashCode => title.hashCode + status.hashCode; + + factory Incident.fromJson(Map json) => + _$IncidentFromJson(json); + + Map toJson() => _$IncidentToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incident.g.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incident.g.dart new file mode 100644 index 0000000000..112225f74c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incident.g.dart @@ -0,0 +1,41 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'incident.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Incident _$IncidentFromJson(Map json) => $checkedCreate( + 'Incident', + json, + ($checkedConvert) { + final val = Incident( + title: $checkedConvert('title', (v) => v as String?), + status: $checkedConvert( + 'status', (v) => $enumDecodeNullable(_$StatusEnumMap, v)), + ); + return val; + }, + ); + +Map _$IncidentToJson(Incident instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('title', instance.title); + writeNotNull('status', instance.status?.toJson()); + return val; +} + +const _$StatusEnumMap = { + Status.operational: 'operational', + Status.degradedPerformance: 'degraded_performance', + Status.partialOutage: 'partial_outage', + Status.majorOutage: 'major_outage', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incidents_inner.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incidents_inner.dart new file mode 100644 index 0000000000..5e197ca55c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incidents_inner.dart @@ -0,0 +1,41 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_monitoring/src/model/incident.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'incidents_inner.g.dart'; + +@JsonSerializable() +final class IncidentsInner { + /// Returns a new [IncidentsInner] instance. + const IncidentsInner({ + this.t, + this.v, + }); + + /// Timestamp in [Unix epoch time](https://wikipedia.org/wiki/Unix_time) in milliseconds. + @JsonKey(name: r't') + final int? t; + + @JsonKey(name: r'v') + final Incident? v; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is IncidentsInner && other.t == t && other.v == v; + + @override + int get hashCode => t.hashCode + v.hashCode; + + factory IncidentsInner.fromJson(Map json) => + _$IncidentsInnerFromJson(json); + + Map toJson() => _$IncidentsInnerToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incidents_inner.g.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incidents_inner.g.dart new file mode 100644 index 0000000000..3360284fb4 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incidents_inner.g.dart @@ -0,0 +1,38 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'incidents_inner.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +IncidentsInner _$IncidentsInnerFromJson(Map json) => + $checkedCreate( + 'IncidentsInner', + json, + ($checkedConvert) { + final val = IncidentsInner( + t: $checkedConvert('t', (v) => v as int?), + v: $checkedConvert( + 'v', + (v) => v == null + ? null + : Incident.fromJson(v as Map)), + ); + return val; + }, + ); + +Map _$IncidentsInnerToJson(IncidentsInner instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('t', instance.t); + writeNotNull('v', instance.v?.toJson()); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incidents_response.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incidents_response.dart new file mode 100644 index 0000000000..4d5ba0bbc0 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incidents_response.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_monitoring/src/model/incidents_inner.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'incidents_response.g.dart'; + +@JsonSerializable() +final class IncidentsResponse { + /// Returns a new [IncidentsResponse] instance. + const IncidentsResponse({ + this.incidents, + }); + + @JsonKey(name: r'incidents') + final Map>? incidents; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is IncidentsResponse && other.incidents == incidents; + + @override + int get hashCode => incidents.hashCode; + + factory IncidentsResponse.fromJson(Map json) => + _$IncidentsResponseFromJson(json); + + Map toJson() => _$IncidentsResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incidents_response.g.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incidents_response.g.dart new file mode 100644 index 0000000000..2da7749620 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/incidents_response.g.dart @@ -0,0 +1,44 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'incidents_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +IncidentsResponse _$IncidentsResponseFromJson(Map json) => + $checkedCreate( + 'IncidentsResponse', + json, + ($checkedConvert) { + final val = IncidentsResponse( + incidents: $checkedConvert( + 'incidents', + (v) => (v as Map?)?.map( + (k, e) => MapEntry( + k, + (e as List) + .map((e) => IncidentsInner.fromJson( + e as Map)) + .toList()), + )), + ); + return val; + }, + ); + +Map _$IncidentsResponseToJson(IncidentsResponse instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull( + 'incidents', + instance.incidents + ?.map((k, e) => MapEntry(k, e.map((e) => e.toJson()).toList()))); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/indexing_time_response.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/indexing_time_response.dart new file mode 100644 index 0000000000..e6c51a4184 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/indexing_time_response.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_monitoring/src/model/indexing_time_response_metrics.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'indexing_time_response.g.dart'; + +@JsonSerializable() +final class IndexingTimeResponse { + /// Returns a new [IndexingTimeResponse] instance. + const IndexingTimeResponse({ + this.metrics, + }); + + @JsonKey(name: r'metrics') + final IndexingTimeResponseMetrics? metrics; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is IndexingTimeResponse && other.metrics == metrics; + + @override + int get hashCode => metrics.hashCode; + + factory IndexingTimeResponse.fromJson(Map json) => + _$IndexingTimeResponseFromJson(json); + + Map toJson() => _$IndexingTimeResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/indexing_time_response.g.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/indexing_time_response.g.dart new file mode 100644 index 0000000000..2a11669021 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/indexing_time_response.g.dart @@ -0,0 +1,39 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'indexing_time_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +IndexingTimeResponse _$IndexingTimeResponseFromJson( + Map json) => + $checkedCreate( + 'IndexingTimeResponse', + json, + ($checkedConvert) { + final val = IndexingTimeResponse( + metrics: $checkedConvert( + 'metrics', + (v) => v == null + ? null + : IndexingTimeResponseMetrics.fromJson( + v as Map)), + ); + return val; + }, + ); + +Map _$IndexingTimeResponseToJson( + IndexingTimeResponse instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('metrics', instance.metrics?.toJson()); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/indexing_time_response_metrics.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/indexing_time_response_metrics.dart new file mode 100644 index 0000000000..0c740dbdd9 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/indexing_time_response_metrics.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_monitoring/src/model/time_inner.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'indexing_time_response_metrics.g.dart'; + +@JsonSerializable() +final class IndexingTimeResponseMetrics { + /// Returns a new [IndexingTimeResponseMetrics] instance. + const IndexingTimeResponseMetrics({ + this.indexing, + }); + + @JsonKey(name: r'indexing') + final Map>? indexing; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is IndexingTimeResponseMetrics && other.indexing == indexing; + + @override + int get hashCode => indexing.hashCode; + + factory IndexingTimeResponseMetrics.fromJson(Map json) => + _$IndexingTimeResponseMetricsFromJson(json); + + Map toJson() => _$IndexingTimeResponseMetricsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/indexing_time_response_metrics.g.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/indexing_time_response_metrics.g.dart new file mode 100644 index 0000000000..04cc9c99ef --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/indexing_time_response_metrics.g.dart @@ -0,0 +1,46 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'indexing_time_response_metrics.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +IndexingTimeResponseMetrics _$IndexingTimeResponseMetricsFromJson( + Map json) => + $checkedCreate( + 'IndexingTimeResponseMetrics', + json, + ($checkedConvert) { + final val = IndexingTimeResponseMetrics( + indexing: $checkedConvert( + 'indexing', + (v) => (v as Map?)?.map( + (k, e) => MapEntry( + k, + (e as List) + .map((e) => + TimeInner.fromJson(e as Map)) + .toList()), + )), + ); + return val; + }, + ); + +Map _$IndexingTimeResponseMetricsToJson( + IndexingTimeResponseMetrics instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull( + 'indexing', + instance.indexing + ?.map((k, e) => MapEntry(k, e.map((e) => e.toJson()).toList()))); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/infrastructure_response.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/infrastructure_response.dart new file mode 100644 index 0000000000..3cf3ad6fc0 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/infrastructure_response.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_monitoring/src/model/infrastructure_response_metrics.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'infrastructure_response.g.dart'; + +@JsonSerializable() +final class InfrastructureResponse { + /// Returns a new [InfrastructureResponse] instance. + const InfrastructureResponse({ + this.metrics, + }); + + @JsonKey(name: r'metrics') + final InfrastructureResponseMetrics? metrics; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is InfrastructureResponse && other.metrics == metrics; + + @override + int get hashCode => metrics.hashCode; + + factory InfrastructureResponse.fromJson(Map json) => + _$InfrastructureResponseFromJson(json); + + Map toJson() => _$InfrastructureResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/infrastructure_response.g.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/infrastructure_response.g.dart new file mode 100644 index 0000000000..5f58779a07 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/infrastructure_response.g.dart @@ -0,0 +1,39 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'infrastructure_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +InfrastructureResponse _$InfrastructureResponseFromJson( + Map json) => + $checkedCreate( + 'InfrastructureResponse', + json, + ($checkedConvert) { + final val = InfrastructureResponse( + metrics: $checkedConvert( + 'metrics', + (v) => v == null + ? null + : InfrastructureResponseMetrics.fromJson( + v as Map)), + ); + return val; + }, + ); + +Map _$InfrastructureResponseToJson( + InfrastructureResponse instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('metrics', instance.metrics?.toJson()); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/infrastructure_response_metrics.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/infrastructure_response_metrics.dart new file mode 100644 index 0000000000..a22386cd89 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/infrastructure_response_metrics.dart @@ -0,0 +1,67 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_monitoring/src/model/probes_metric.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'infrastructure_response_metrics.g.dart'; + +@JsonSerializable() +final class InfrastructureResponseMetrics { + /// Returns a new [InfrastructureResponseMetrics] instance. + const InfrastructureResponseMetrics({ + this.cpuUsage, + this.ramIndexingUsage, + this.ramSearchUsage, + this.ssdUsage, + this.avgBuildTime, + }); + + /// CPU idleness in %. + @JsonKey(name: r'cpu_usage') + final Map>? cpuUsage; + + /// RAM used for indexing in MB. + @JsonKey(name: r'ram_indexing_usage') + final Map>? ramIndexingUsage; + + /// RAM used for search in MB. + @JsonKey(name: r'ram_search_usage') + final Map>? ramSearchUsage; + + /// Solid-state disk (SSD) usage expressed as % of RAM. 0% means no SSD usage. A value of 50% indicates 32 GB SSD usage for a machine with 64 RAM. + @JsonKey(name: r'ssd_usage') + final Map>? ssdUsage; + + /// Average build time of the indices in seconds. + @JsonKey(name: r'avg_build_time') + final Map>? avgBuildTime; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is InfrastructureResponseMetrics && + other.cpuUsage == cpuUsage && + other.ramIndexingUsage == ramIndexingUsage && + other.ramSearchUsage == ramSearchUsage && + other.ssdUsage == ssdUsage && + other.avgBuildTime == avgBuildTime; + + @override + int get hashCode => + cpuUsage.hashCode + + ramIndexingUsage.hashCode + + ramSearchUsage.hashCode + + ssdUsage.hashCode + + avgBuildTime.hashCode; + + factory InfrastructureResponseMetrics.fromJson(Map json) => + _$InfrastructureResponseMetricsFromJson(json); + + Map toJson() => _$InfrastructureResponseMetricsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/infrastructure_response_metrics.g.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/infrastructure_response_metrics.g.dart new file mode 100644 index 0000000000..f674e6e7f0 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/infrastructure_response_metrics.g.dart @@ -0,0 +1,109 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'infrastructure_response_metrics.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +InfrastructureResponseMetrics _$InfrastructureResponseMetricsFromJson( + Map json) => + $checkedCreate( + 'InfrastructureResponseMetrics', + json, + ($checkedConvert) { + final val = InfrastructureResponseMetrics( + cpuUsage: $checkedConvert( + 'cpu_usage', + (v) => (v as Map?)?.map( + (k, e) => MapEntry( + k, + (e as List) + .map((e) => ProbesMetric.fromJson( + e as Map)) + .toList()), + )), + ramIndexingUsage: $checkedConvert( + 'ram_indexing_usage', + (v) => (v as Map?)?.map( + (k, e) => MapEntry( + k, + (e as List) + .map((e) => ProbesMetric.fromJson( + e as Map)) + .toList()), + )), + ramSearchUsage: $checkedConvert( + 'ram_search_usage', + (v) => (v as Map?)?.map( + (k, e) => MapEntry( + k, + (e as List) + .map((e) => ProbesMetric.fromJson( + e as Map)) + .toList()), + )), + ssdUsage: $checkedConvert( + 'ssd_usage', + (v) => (v as Map?)?.map( + (k, e) => MapEntry( + k, + (e as List) + .map((e) => ProbesMetric.fromJson( + e as Map)) + .toList()), + )), + avgBuildTime: $checkedConvert( + 'avg_build_time', + (v) => (v as Map?)?.map( + (k, e) => MapEntry( + k, + (e as List) + .map((e) => ProbesMetric.fromJson( + e as Map)) + .toList()), + )), + ); + return val; + }, + fieldKeyMap: const { + 'cpuUsage': 'cpu_usage', + 'ramIndexingUsage': 'ram_indexing_usage', + 'ramSearchUsage': 'ram_search_usage', + 'ssdUsage': 'ssd_usage', + 'avgBuildTime': 'avg_build_time' + }, + ); + +Map _$InfrastructureResponseMetricsToJson( + InfrastructureResponseMetrics instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull( + 'cpu_usage', + instance.cpuUsage + ?.map((k, e) => MapEntry(k, e.map((e) => e.toJson()).toList()))); + writeNotNull( + 'ram_indexing_usage', + instance.ramIndexingUsage + ?.map((k, e) => MapEntry(k, e.map((e) => e.toJson()).toList()))); + writeNotNull( + 'ram_search_usage', + instance.ramSearchUsage + ?.map((k, e) => MapEntry(k, e.map((e) => e.toJson()).toList()))); + writeNotNull( + 'ssd_usage', + instance.ssdUsage + ?.map((k, e) => MapEntry(k, e.map((e) => e.toJson()).toList()))); + writeNotNull( + 'avg_build_time', + instance.avgBuildTime + ?.map((k, e) => MapEntry(k, e.map((e) => e.toJson()).toList()))); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/inventory_response.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/inventory_response.dart new file mode 100644 index 0000000000..da7cc96d39 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/inventory_response.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_monitoring/src/model/server.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'inventory_response.g.dart'; + +@JsonSerializable() +final class InventoryResponse { + /// Returns a new [InventoryResponse] instance. + const InventoryResponse({ + this.inventory, + }); + + @JsonKey(name: r'inventory') + final List? inventory; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is InventoryResponse && other.inventory == inventory; + + @override + int get hashCode => inventory.hashCode; + + factory InventoryResponse.fromJson(Map json) => + _$InventoryResponseFromJson(json); + + Map toJson() => _$InventoryResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/inventory_response.g.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/inventory_response.g.dart new file mode 100644 index 0000000000..ee37ce4a20 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/inventory_response.g.dart @@ -0,0 +1,37 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'inventory_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +InventoryResponse _$InventoryResponseFromJson(Map json) => + $checkedCreate( + 'InventoryResponse', + json, + ($checkedConvert) { + final val = InventoryResponse( + inventory: $checkedConvert( + 'inventory', + (v) => (v as List?) + ?.map((e) => Server.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$InventoryResponseToJson(InventoryResponse instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull( + 'inventory', instance.inventory?.map((e) => e.toJson()).toList()); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/latency_response.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/latency_response.dart new file mode 100644 index 0000000000..669900d407 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/latency_response.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_monitoring/src/model/latency_response_metrics.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'latency_response.g.dart'; + +@JsonSerializable() +final class LatencyResponse { + /// Returns a new [LatencyResponse] instance. + const LatencyResponse({ + this.metrics, + }); + + @JsonKey(name: r'metrics') + final LatencyResponseMetrics? metrics; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LatencyResponse && other.metrics == metrics; + + @override + int get hashCode => metrics.hashCode; + + factory LatencyResponse.fromJson(Map json) => + _$LatencyResponseFromJson(json); + + Map toJson() => _$LatencyResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/latency_response.g.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/latency_response.g.dart new file mode 100644 index 0000000000..bc2ce4c39a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/latency_response.g.dart @@ -0,0 +1,36 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'latency_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +LatencyResponse _$LatencyResponseFromJson(Map json) => + $checkedCreate( + 'LatencyResponse', + json, + ($checkedConvert) { + final val = LatencyResponse( + metrics: $checkedConvert( + 'metrics', + (v) => v == null + ? null + : LatencyResponseMetrics.fromJson(v as Map)), + ); + return val; + }, + ); + +Map _$LatencyResponseToJson(LatencyResponse instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('metrics', instance.metrics?.toJson()); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/latency_response_metrics.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/latency_response_metrics.dart new file mode 100644 index 0000000000..239dbda2a7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/latency_response_metrics.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_monitoring/src/model/time_inner.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'latency_response_metrics.g.dart'; + +@JsonSerializable() +final class LatencyResponseMetrics { + /// Returns a new [LatencyResponseMetrics] instance. + const LatencyResponseMetrics({ + this.latency, + }); + + @JsonKey(name: r'latency') + final Map>? latency; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is LatencyResponseMetrics && other.latency == latency; + + @override + int get hashCode => latency.hashCode; + + factory LatencyResponseMetrics.fromJson(Map json) => + _$LatencyResponseMetricsFromJson(json); + + Map toJson() => _$LatencyResponseMetricsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/latency_response_metrics.g.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/latency_response_metrics.g.dart new file mode 100644 index 0000000000..fc882ce0a6 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/latency_response_metrics.g.dart @@ -0,0 +1,46 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'latency_response_metrics.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +LatencyResponseMetrics _$LatencyResponseMetricsFromJson( + Map json) => + $checkedCreate( + 'LatencyResponseMetrics', + json, + ($checkedConvert) { + final val = LatencyResponseMetrics( + latency: $checkedConvert( + 'latency', + (v) => (v as Map?)?.map( + (k, e) => MapEntry( + k, + (e as List) + .map((e) => + TimeInner.fromJson(e as Map)) + .toList()), + )), + ); + return val; + }, + ); + +Map _$LatencyResponseMetricsToJson( + LatencyResponseMetrics instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull( + 'latency', + instance.latency + ?.map((k, e) => MapEntry(k, e.map((e) => e.toJson()).toList()))); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/metric.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/metric.dart new file mode 100644 index 0000000000..71c54679bc --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/metric.dart @@ -0,0 +1,28 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum Metric { + avgBuildTime(r'avg_build_time'), + ssdUsage(r'ssd_usage'), + ramSearchUsage(r'ram_search_usage'), + ramIndexingUsage(r'ram_indexing_usage'), + cpuUsage(r'cpu_usage'), + star(r'*'); + + const Metric(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static Metric fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/period.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/period.dart new file mode 100644 index 0000000000..af22937a15 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/period.dart @@ -0,0 +1,27 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum Period { + minute(r'minute'), + hour(r'hour'), + day(r'day'), + week(r'week'), + month(r'month'); + + const Period(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static Period fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/probes_metric.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/probes_metric.dart new file mode 100644 index 0000000000..5beb361680 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/probes_metric.dart @@ -0,0 +1,41 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'probes_metric.g.dart'; + +@JsonSerializable() +final class ProbesMetric { + /// Returns a new [ProbesMetric] instance. + const ProbesMetric({ + this.t, + this.v, + }); + + /// Timestamp in [Unix epoch time](https://wikipedia.org/wiki/Unix_time) in milliseconds. + @JsonKey(name: r't') + final int? t; + + /// Value of the metric. + @JsonKey(name: r'v') + final int? v; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ProbesMetric && other.t == t && other.v == v; + + @override + int get hashCode => t.hashCode + v.hashCode; + + factory ProbesMetric.fromJson(Map json) => + _$ProbesMetricFromJson(json); + + Map toJson() => _$ProbesMetricToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/probes_metric.g.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/probes_metric.g.dart new file mode 100644 index 0000000000..130124a8e1 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/probes_metric.g.dart @@ -0,0 +1,34 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'probes_metric.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ProbesMetric _$ProbesMetricFromJson(Map json) => + $checkedCreate( + 'ProbesMetric', + json, + ($checkedConvert) { + final val = ProbesMetric( + t: $checkedConvert('t', (v) => v as int?), + v: $checkedConvert('v', (v) => v as int?), + ); + return val; + }, + ); + +Map _$ProbesMetricToJson(ProbesMetric instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('t', instance.t); + writeNotNull('v', instance.v); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/region.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/region.dart new file mode 100644 index 0000000000..e58d2a28ca --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/region.dart @@ -0,0 +1,67 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// The region where the cluster is located. +@JsonEnum(valueField: 'raw') +enum Region { + /// The region where the cluster is located. + au(r'au'), + + /// The region where the cluster is located. + br(r'br'), + + /// The region where the cluster is located. + ca(r'ca'), + + /// The region where the cluster is located. + de(r'de'), + + /// The region where the cluster is located. + eu(r'eu'), + + /// The region where the cluster is located. + hk(r'hk'), + + /// The region where the cluster is located. + in_(r'in'), + + /// The region where the cluster is located. + jp(r'jp'), + + /// The region where the cluster is located. + sg(r'sg'), + + /// The region where the cluster is located. + uae(r'uae'), + + /// The region where the cluster is located. + uk(r'uk'), + + /// The region where the cluster is located. + usc(r'usc'), + + /// The region where the cluster is located. + use(r'use'), + + /// The region where the cluster is located. + usw(r'usw'), + + /// The region where the cluster is located. + za(r'za'); + + const Region(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static Region fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/server.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/server.dart new file mode 100644 index 0000000000..8fa9de7f90 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/server.dart @@ -0,0 +1,78 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_monitoring/src/model/region.dart'; +import 'package:algolia_client_monitoring/src/model/server_status.dart'; +import 'package:algolia_client_monitoring/src/model/type.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'server.g.dart'; + +@JsonSerializable() +final class Server { + /// Returns a new [Server] instance. + const Server({ + this.name, + this.region, + this.isSlave, + this.isReplica, + this.cluster, + this.status, + this.type, + }); + + /// Server name. + @JsonKey(name: r'name') + final String? name; + + @JsonKey(name: r'region') + final Region? region; + + /// Included to support legacy applications. Do not rely on this attribute being present in the response. Use `is_replica` instead. + @Deprecated('isSlave has been deprecated') + @JsonKey(name: r'is_slave') + final bool? isSlave; + + /// Indicates whether this server is a replica of another server. + @JsonKey(name: r'is_replica') + final bool? isReplica; + + /// Name of the cluster to which this server belongs. + @JsonKey(name: r'cluster') + final String? cluster; + + @JsonKey(name: r'status') + final ServerStatus? status; + + @JsonKey(name: r'type') + final Type? type; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Server && + other.name == name && + other.region == region && + other.isReplica == isReplica && + other.cluster == cluster && + other.status == status && + other.type == type; + + @override + int get hashCode => + name.hashCode + + region.hashCode + + isReplica.hashCode + + cluster.hashCode + + status.hashCode + + type.hashCode; + + factory Server.fromJson(Map json) => _$ServerFromJson(json); + + Map toJson() => _$ServerToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/server.g.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/server.g.dart new file mode 100644 index 0000000000..e8beed0d13 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/server.g.dart @@ -0,0 +1,73 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'server.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Server _$ServerFromJson(Map json) => $checkedCreate( + 'Server', + json, + ($checkedConvert) { + final val = Server( + name: $checkedConvert('name', (v) => v as String?), + region: $checkedConvert( + 'region', (v) => $enumDecodeNullable(_$RegionEnumMap, v)), + isSlave: $checkedConvert('is_slave', (v) => v as bool?), + isReplica: $checkedConvert('is_replica', (v) => v as bool?), + cluster: $checkedConvert('cluster', (v) => v as String?), + status: $checkedConvert( + 'status', (v) => $enumDecodeNullable(_$ServerStatusEnumMap, v)), + type: $checkedConvert( + 'type', (v) => $enumDecodeNullable(_$TypeEnumMap, v)), + ); + return val; + }, + fieldKeyMap: const {'isSlave': 'is_slave', 'isReplica': 'is_replica'}, + ); + +Map _$ServerToJson(Server instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('name', instance.name); + writeNotNull('region', instance.region?.toJson()); + writeNotNull('is_slave', instance.isSlave); + writeNotNull('is_replica', instance.isReplica); + writeNotNull('cluster', instance.cluster); + writeNotNull('status', instance.status?.toJson()); + writeNotNull('type', instance.type?.toJson()); + return val; +} + +const _$RegionEnumMap = { + Region.au: 'au', + Region.br: 'br', + Region.ca: 'ca', + Region.de: 'de', + Region.eu: 'eu', + Region.hk: 'hk', + Region.in_: 'in', + Region.jp: 'jp', + Region.sg: 'sg', + Region.uae: 'uae', + Region.uk: 'uk', + Region.usc: 'usc', + Region.use: 'use', + Region.usw: 'usw', + Region.za: 'za', +}; + +const _$ServerStatusEnumMap = { + ServerStatus.production: 'PRODUCTION', +}; + +const _$TypeEnumMap = { + Type.cluster: 'cluster', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/server_status.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/server_status.dart new file mode 100644 index 0000000000..0f8f75db79 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/server_status.dart @@ -0,0 +1,23 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum ServerStatus { + production(r'PRODUCTION'); + + const ServerStatus(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static ServerStatus fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/status.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/status.dart new file mode 100644 index 0000000000..40f2ebf3b5 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/status.dart @@ -0,0 +1,34 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Status of the cluster. +@JsonEnum(valueField: 'raw') +enum Status { + /// Status of the cluster. + operational(r'operational'), + + /// Status of the cluster. + degradedPerformance(r'degraded_performance'), + + /// Status of the cluster. + partialOutage(r'partial_outage'), + + /// Status of the cluster. + majorOutage(r'major_outage'); + + const Status(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static Status fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/status_response.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/status_response.dart new file mode 100644 index 0000000000..d0d19ef89d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/status_response.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_monitoring/src/model/status.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'status_response.g.dart'; + +@JsonSerializable() +final class StatusResponse { + /// Returns a new [StatusResponse] instance. + const StatusResponse({ + this.status, + }); + + @JsonKey(name: r'status') + final Map? status; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is StatusResponse && other.status == status; + + @override + int get hashCode => status.hashCode; + + factory StatusResponse.fromJson(Map json) => + _$StatusResponseFromJson(json); + + Map toJson() => _$StatusResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/status_response.g.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/status_response.g.dart new file mode 100644 index 0000000000..455f107f79 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/status_response.g.dart @@ -0,0 +1,44 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'status_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +StatusResponse _$StatusResponseFromJson(Map json) => + $checkedCreate( + 'StatusResponse', + json, + ($checkedConvert) { + final val = StatusResponse( + status: $checkedConvert( + 'status', + (v) => (v as Map?)?.map( + (k, e) => MapEntry(k, $enumDecode(_$StatusEnumMap, e)), + )), + ); + return val; + }, + ); + +Map _$StatusResponseToJson(StatusResponse instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull( + 'status', instance.status?.map((k, e) => MapEntry(k, e.toJson()))); + return val; +} + +const _$StatusEnumMap = { + Status.operational: 'operational', + Status.degradedPerformance: 'degraded_performance', + Status.partialOutage: 'partial_outage', + Status.majorOutage: 'major_outage', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/time_inner.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/time_inner.dart new file mode 100644 index 0000000000..f67ad8d85d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/time_inner.dart @@ -0,0 +1,41 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'time_inner.g.dart'; + +@JsonSerializable() +final class TimeInner { + /// Returns a new [TimeInner] instance. + const TimeInner({ + this.t, + this.v, + }); + + /// Timestamp in [Unix epoch time](https://wikipedia.org/wiki/Unix_time) in milliseconds. + @JsonKey(name: r't') + final int? t; + + /// Time in ms. + @JsonKey(name: r'v') + final int? v; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TimeInner && other.t == t && other.v == v; + + @override + int get hashCode => t.hashCode + v.hashCode; + + factory TimeInner.fromJson(Map json) => + _$TimeInnerFromJson(json); + + Map toJson() => _$TimeInnerToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/time_inner.g.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/time_inner.g.dart new file mode 100644 index 0000000000..8aa42dd228 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/time_inner.g.dart @@ -0,0 +1,33 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'time_inner.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TimeInner _$TimeInnerFromJson(Map json) => $checkedCreate( + 'TimeInner', + json, + ($checkedConvert) { + final val = TimeInner( + t: $checkedConvert('t', (v) => v as int?), + v: $checkedConvert('v', (v) => v as int?), + ); + return val; + }, + ); + +Map _$TimeInnerToJson(TimeInner instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('t', instance.t); + writeNotNull('v', instance.v); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/type.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/type.dart new file mode 100644 index 0000000000..da03d2dd42 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/model/type.dart @@ -0,0 +1,23 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum Type { + cluster(r'cluster'); + + const Type(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static Type fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/version.dart b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/version.dart new file mode 100644 index 0000000000..03e065a0a8 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/lib/src/version.dart @@ -0,0 +1,2 @@ +/// Current package version +const packageVersion = '0.1.2'; diff --git a/clients/algoliasearch-client-dart/packages/client_monitoring/pubspec.yaml b/clients/algoliasearch-client-dart/packages/client_monitoring/pubspec.yaml new file mode 100644 index 0000000000..6bea458a91 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_monitoring/pubspec.yaml @@ -0,0 +1,24 @@ +name: algolia_client_monitoring +version: 0.1.2 +description: A sub-package of the AlgoliaSearch library, offering monitoring-specific functionalities for enhanced search and discovery in Dart/Flutter apps. +homepage: https://www.algolia.com/doc/ +repository: https://github.com/algolia/algoliasearch-client-dart/tree/main/packages/client_monitoring +topics: + - search + - discovery + +environment: + sdk: '>=3.0.0 <4.0.0' + +dependencies: + # Pinning versions until the API stabilizes. + algolia_client_core: 0.1.1+4 + json_annotation: ^4.8.1 + collection: ^1.17.1 + +dev_dependencies: + build_runner: ^2.4.4 + json_serializable: ^6.7.0 + lints: ^2.1.1 + logging: ^1.2.0 + test: ^1.24.3 diff --git a/clients/algoliasearch-client-dart/packages/client_personalization/build.yaml b/clients/algoliasearch-client-dart/packages/client_personalization/build.yaml new file mode 100644 index 0000000000..6d71b406a7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_personalization/build.yaml @@ -0,0 +1,14 @@ +targets: + $default: + builders: + json_serializable: + options: + any_map: false + checked: true + create_factory: true + create_to_json: true + disallow_unrecognized_keys: false + explicit_to_json: true + field_rename: none + ignore_unannotated: false + include_if_null: false diff --git a/clients/algoliasearch-client-dart/packages/client_personalization/lib/algolia_client_personalization.dart b/clients/algoliasearch-client-dart/packages/client_personalization/lib/algolia_client_personalization.dart new file mode 100644 index 0000000000..c17b3fc426 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_personalization/lib/algolia_client_personalization.dart @@ -0,0 +1,16 @@ +// A sub-package of the AlgoliaSearch library, offering personalization-specific functionalities for enhanced search and discovery in Dart/Flutter apps. +library algolia_client_personalization; + +export 'package:algolia_client_core/algolia_client_core.dart'; + +export 'src/api/personalization_client.dart'; + +export 'src/model/delete_user_profile_response.dart'; +export 'src/model/error_base.dart'; +export 'src/model/event_scoring.dart'; +export 'src/model/facet_scoring.dart'; +export 'src/model/get_user_token_response.dart'; +export 'src/model/personalization_strategy_params.dart'; +export 'src/model/set_personalization_strategy_response.dart'; + +export 'src/extension.dart'; diff --git a/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/api/personalization_client.dart b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/api/personalization_client.dart new file mode 100644 index 0000000000..ff989c60f2 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/api/personalization_client.dart @@ -0,0 +1,306 @@ +// 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. + +import 'package:algolia_client_core/algolia_client_core.dart'; +import 'package:algolia_client_personalization/src/deserialize.dart'; +import 'package:algolia_client_personalization/src/version.dart'; + +import 'package:algolia_client_personalization/src/model/delete_user_profile_response.dart'; +import 'package:algolia_client_personalization/src/model/get_user_token_response.dart'; +import 'package:algolia_client_personalization/src/model/personalization_strategy_params.dart'; +import 'package:algolia_client_personalization/src/model/set_personalization_strategy_response.dart'; + +final class PersonalizationClient implements ApiClient { + @override + final String apiKey; + + @override + final String appId; + + @override + final ClientOptions options; + + final String region; + + final RetryStrategy _retryStrategy; + + PersonalizationClient({ + required this.appId, + required this.apiKey, + this.options = const ClientOptions(), + required this.region, + }) : _retryStrategy = RetryStrategy.create( + segment: + AgentSegment(value: "Personalization", version: packageVersion), + appId: appId, + apiKey: apiKey, + options: options, + defaultHosts: () { + final allowedRegions = ['eu', 'us']; + assert( + allowedRegions.contains(region), + '`region` is required and must be one of the following: ${allowedRegions.join(', ')}', + ); + final url = 'personalization.{region}.algolia.com' + .replaceAll('{region}', region); + return [Host(url: url)]; + }) { + assert(appId.isNotEmpty, '`appId` is missing.'); + assert(apiKey.isNotEmpty, '`apiKey` is missing.'); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [requestOptions] additional request configuration. + Future del({ + required String path, + Map? parameters, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `del`.', + ); + final request = ApiRequest( + method: RequestMethod.delete, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Delete a user profile. + /// Delete the user profile and all its associated data. Returns, as part of the response, a date until which the data can safely be considered as deleted for the given user. This means if you send events for the given user before this date, they will be ignored. Any data received after the deletedUntil date will start building a new user profile. It might take a couple hours for the deletion request to be fully processed. + /// + /// Parameters: + /// * [userToken] userToken representing the user for which to fetch the Personalization profile. + /// * [requestOptions] additional request configuration. + Future deleteUserProfile({ + required String userToken, + RequestOptions? requestOptions, + }) async { + assert( + userToken.isNotEmpty, + 'Parameter `userToken` is required when calling `deleteUserProfile`.', + ); + final request = ApiRequest( + method: RequestMethod.delete, + path: r'/1/profiles/{userToken}'.replaceAll( + '{' r'userToken' '}', Uri.encodeComponent(userToken.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'DeleteUserProfileResponse', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [requestOptions] additional request configuration. + Future get({ + required String path, + Map? parameters, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `get`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Get the current strategy. + /// The strategy contains information on the events and facets that impact user profiles and personalized search results. + /// + /// Parameters: + /// * [requestOptions] additional request configuration. + Future getPersonalizationStrategy({ + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/strategies/personalization', + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'PersonalizationStrategyParams', + growable: true, + ); + } + + /// Get a user profile. + /// Get the user profile built from Personalization strategy. The profile is structured by facet name used in the strategy. Each facet value is mapped to its score. Each score represents the user affinity for a specific facet value given the userToken past events and the Personalization strategy defined. Scores are bounded to 20. The last processed event timestamp is provided using the ISO 8601 format for debugging purposes. + /// + /// Parameters: + /// * [userToken] userToken representing the user for which to fetch the Personalization profile. + /// * [requestOptions] additional request configuration. + Future getUserTokenProfile({ + required String userToken, + RequestOptions? requestOptions, + }) async { + assert( + userToken.isNotEmpty, + 'Parameter `userToken` is required when calling `getUserTokenProfile`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/profiles/personalization/{userToken}'.replaceAll( + '{' r'userToken' '}', Uri.encodeComponent(userToken.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetUserTokenResponse', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [body] Parameters to send with the custom request. + /// * [requestOptions] additional request configuration. + Future post({ + required String path, + Map? parameters, + Object? body, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `post`.', + ); + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + body: body, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [body] Parameters to send with the custom request. + /// * [requestOptions] additional request configuration. + Future put({ + required String path, + Map? parameters, + Object? body, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `put`.', + ); + final request = ApiRequest( + method: RequestMethod.put, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + body: body, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Set a new strategy. + /// A strategy defines the events and facets that impact user profiles and personalized search results. + /// + /// Parameters: + /// * [personalizationStrategyParams] + /// * [requestOptions] additional request configuration. + Future setPersonalizationStrategy({ + required PersonalizationStrategyParams personalizationStrategyParams, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1/strategies/personalization', + body: personalizationStrategyParams.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'SetPersonalizationStrategyResponse', + growable: true, + ); + } + + @override + void dispose() => _retryStrategy.dispose(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/deserialize.dart b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/deserialize.dart new file mode 100644 index 0000000000..e6310d0c43 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/deserialize.dart @@ -0,0 +1,80 @@ +import 'package:algolia_client_personalization/src/model/delete_user_profile_response.dart'; +import 'package:algolia_client_personalization/src/model/error_base.dart'; +import 'package:algolia_client_personalization/src/model/event_scoring.dart'; +import 'package:algolia_client_personalization/src/model/facet_scoring.dart'; +import 'package:algolia_client_personalization/src/model/get_user_token_response.dart'; +import 'package:algolia_client_personalization/src/model/personalization_strategy_params.dart'; +import 'package:algolia_client_personalization/src/model/set_personalization_strategy_response.dart'; + +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + +ReturnType deserialize(dynamic value, String targetType, + {bool growable = true}) { + switch (targetType) { + case 'String': + return '$value' as ReturnType; + case 'int': + return (value is int ? value : int.parse('$value')) as ReturnType; + case 'bool': + if (value is bool) { + return value as ReturnType; + } + final valueString = '$value'.toLowerCase(); + return (valueString == 'true' || valueString == '1') as ReturnType; + case 'double': + return (value is double ? value : double.parse('$value')) as ReturnType; + case 'DeleteUserProfileResponse': + return DeleteUserProfileResponse.fromJson(value as Map) + as ReturnType; + case 'ErrorBase': + return ErrorBase.fromJson(value as Map) as ReturnType; + case 'EventScoring': + return EventScoring.fromJson(value as Map) as ReturnType; + case 'FacetScoring': + return FacetScoring.fromJson(value as Map) as ReturnType; + case 'GetUserTokenResponse': + return GetUserTokenResponse.fromJson(value as Map) + as ReturnType; + case 'PersonalizationStrategyParams': + return PersonalizationStrategyParams.fromJson( + value as Map) as ReturnType; + case 'SetPersonalizationStrategyResponse': + return SetPersonalizationStrategyResponse.fromJson( + value as Map) as ReturnType; + default: + RegExpMatch? match; + + if (value is List && (match = _regList.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toList(growable: growable) as ReturnType; + } + if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toSet() as ReturnType; + } + if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return Map.fromIterables( + value.keys, + value.values.map((dynamic v) => deserialize( + v, targetType, + growable: growable)), + ) as ReturnType; + } + if (targetType == 'Object') { + return value; + } + break; + } + throw Exception('Cannot deserialize'); +} diff --git a/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/delete_user_profile_response.dart b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/delete_user_profile_response.dart new file mode 100644 index 0000000000..6f49c73e7b --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/delete_user_profile_response.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'delete_user_profile_response.g.dart'; + +@JsonSerializable() +final class DeleteUserProfileResponse { + /// Returns a new [DeleteUserProfileResponse] instance. + const DeleteUserProfileResponse({ + required this.userToken, + required this.deletedUntil, + }); + + /// userToken representing the user for which to fetch the Personalization profile. + @JsonKey(name: r'userToken') + final String userToken; + + /// A date until which the data can safely be considered as deleted for the given user. Any data received after the `deletedUntil` date will start building a new user profile. + @JsonKey(name: r'deletedUntil') + final String deletedUntil; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is DeleteUserProfileResponse && + other.userToken == userToken && + other.deletedUntil == deletedUntil; + + @override + int get hashCode => userToken.hashCode + deletedUntil.hashCode; + + factory DeleteUserProfileResponse.fromJson(Map json) => + _$DeleteUserProfileResponseFromJson(json); + + Map toJson() => _$DeleteUserProfileResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/delete_user_profile_response.g.dart b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/delete_user_profile_response.g.dart new file mode 100644 index 0000000000..074ce9239c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/delete_user_profile_response.g.dart @@ -0,0 +1,28 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'delete_user_profile_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +DeleteUserProfileResponse _$DeleteUserProfileResponseFromJson( + Map json) => + $checkedCreate( + 'DeleteUserProfileResponse', + json, + ($checkedConvert) { + final val = DeleteUserProfileResponse( + userToken: $checkedConvert('userToken', (v) => v as String), + deletedUntil: $checkedConvert('deletedUntil', (v) => v as String), + ); + return val; + }, + ); + +Map _$DeleteUserProfileResponseToJson( + DeleteUserProfileResponse instance) => + { + 'userToken': instance.userToken, + 'deletedUntil': instance.deletedUntil, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/error_base.dart b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/error_base.dart new file mode 100644 index 0000000000..df5d4ade57 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/error_base.dart @@ -0,0 +1,47 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:collection/collection.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'error_base.g.dart'; + +@JsonSerializable(createFieldMap: true) +final class ErrorBase extends DelegatingMap { + /// Returns a new [ErrorBase] instance. + const ErrorBase({ + this.message, + Map additionalProperties = const {}, + }) : super(additionalProperties); + + @JsonKey(name: r'message') + final String? message; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ErrorBase && + other.message == message && + const MapEquality().equals(this, this); + + @override + int get hashCode => + message.hashCode + const MapEquality().hash(this); + + factory ErrorBase.fromJson(Map json) { + final instance = _$ErrorBaseFromJson(json); + final additionalProperties = Map.from(json) + ..removeWhere((key, value) => _$ErrorBaseFieldMap.containsKey(key)); + return ErrorBase( + message: instance.message, + additionalProperties: additionalProperties, + ); + } + + Map toJson() => _$ErrorBaseToJson(this)..addAll(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/error_base.g.dart b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/error_base.g.dart new file mode 100644 index 0000000000..f796166fb2 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/error_base.g.dart @@ -0,0 +1,35 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'error_base.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ErrorBase _$ErrorBaseFromJson(Map json) => $checkedCreate( + 'ErrorBase', + json, + ($checkedConvert) { + final val = ErrorBase( + message: $checkedConvert('message', (v) => v as String?), + ); + return val; + }, + ); + +const _$ErrorBaseFieldMap = { + 'message': 'message', +}; + +Map _$ErrorBaseToJson(ErrorBase instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('message', instance.message); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/event_scoring.dart b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/event_scoring.dart new file mode 100644 index 0000000000..18aab3aaca --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/event_scoring.dart @@ -0,0 +1,49 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'event_scoring.g.dart'; + +@JsonSerializable() +final class EventScoring { + /// Returns a new [EventScoring] instance. + const EventScoring({ + required this.score, + required this.eventName, + required this.eventType, + }); + + /// The score for the event. + @JsonKey(name: r'score') + final int score; + + /// The name of the event. + @JsonKey(name: r'eventName') + final String eventName; + + /// The type of the event. + @JsonKey(name: r'eventType') + final String eventType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is EventScoring && + other.score == score && + other.eventName == eventName && + other.eventType == eventType; + + @override + int get hashCode => score.hashCode + eventName.hashCode + eventType.hashCode; + + factory EventScoring.fromJson(Map json) => + _$EventScoringFromJson(json); + + Map toJson() => _$EventScoringToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/event_scoring.g.dart b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/event_scoring.g.dart new file mode 100644 index 0000000000..30e53b9243 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/event_scoring.g.dart @@ -0,0 +1,28 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'event_scoring.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +EventScoring _$EventScoringFromJson(Map json) => + $checkedCreate( + 'EventScoring', + json, + ($checkedConvert) { + final val = EventScoring( + score: $checkedConvert('score', (v) => v as int), + eventName: $checkedConvert('eventName', (v) => v as String), + eventType: $checkedConvert('eventType', (v) => v as String), + ); + return val; + }, + ); + +Map _$EventScoringToJson(EventScoring instance) => + { + 'score': instance.score, + 'eventName': instance.eventName, + 'eventType': instance.eventType, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/facet_scoring.dart b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/facet_scoring.dart new file mode 100644 index 0000000000..d737149828 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/facet_scoring.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'facet_scoring.g.dart'; + +@JsonSerializable() +final class FacetScoring { + /// Returns a new [FacetScoring] instance. + const FacetScoring({ + required this.score, + required this.facetName, + }); + + /// The score for the event. + @JsonKey(name: r'score') + final int score; + + /// The name of the facet. + @JsonKey(name: r'facetName') + final String facetName; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FacetScoring && + other.score == score && + other.facetName == facetName; + + @override + int get hashCode => score.hashCode + facetName.hashCode; + + factory FacetScoring.fromJson(Map json) => + _$FacetScoringFromJson(json); + + Map toJson() => _$FacetScoringToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/facet_scoring.g.dart b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/facet_scoring.g.dart new file mode 100644 index 0000000000..9494e6c7c5 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/facet_scoring.g.dart @@ -0,0 +1,26 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'facet_scoring.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +FacetScoring _$FacetScoringFromJson(Map json) => + $checkedCreate( + 'FacetScoring', + json, + ($checkedConvert) { + final val = FacetScoring( + score: $checkedConvert('score', (v) => v as int), + facetName: $checkedConvert('facetName', (v) => v as String), + ); + return val; + }, + ); + +Map _$FacetScoringToJson(FacetScoring instance) => + { + 'score': instance.score, + 'facetName': instance.facetName, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/get_user_token_response.dart b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/get_user_token_response.dart new file mode 100644 index 0000000000..07c63f01ae --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/get_user_token_response.dart @@ -0,0 +1,50 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_user_token_response.g.dart'; + +@JsonSerializable() +final class GetUserTokenResponse { + /// Returns a new [GetUserTokenResponse] instance. + const GetUserTokenResponse({ + required this.userToken, + required this.lastEventAt, + required this.scores, + }); + + /// userToken representing the user for which to fetch the Personalization profile. + @JsonKey(name: r'userToken') + final String userToken; + + /// Date of last event update. (ISO-8601 format). + @JsonKey(name: r'lastEventAt') + final String lastEventAt; + + /// The userToken scores. + @JsonKey(name: r'scores') + final Object scores; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetUserTokenResponse && + other.userToken == userToken && + other.lastEventAt == lastEventAt && + other.scores == scores; + + @override + int get hashCode => + userToken.hashCode + lastEventAt.hashCode + scores.hashCode; + + factory GetUserTokenResponse.fromJson(Map json) => + _$GetUserTokenResponseFromJson(json); + + Map toJson() => _$GetUserTokenResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/get_user_token_response.g.dart b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/get_user_token_response.g.dart new file mode 100644 index 0000000000..d0176a29ba --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/get_user_token_response.g.dart @@ -0,0 +1,30 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_user_token_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetUserTokenResponse _$GetUserTokenResponseFromJson( + Map json) => + $checkedCreate( + 'GetUserTokenResponse', + json, + ($checkedConvert) { + final val = GetUserTokenResponse( + userToken: $checkedConvert('userToken', (v) => v as String), + lastEventAt: $checkedConvert('lastEventAt', (v) => v as String), + scores: $checkedConvert('scores', (v) => v as Object), + ); + return val; + }, + ); + +Map _$GetUserTokenResponseToJson( + GetUserTokenResponse instance) => + { + 'userToken': instance.userToken, + 'lastEventAt': instance.lastEventAt, + 'scores': instance.scores, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/personalization_strategy_params.dart b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/personalization_strategy_params.dart new file mode 100644 index 0000000000..899ad68765 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/personalization_strategy_params.dart @@ -0,0 +1,54 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_personalization/src/model/facet_scoring.dart'; +import 'package:algolia_client_personalization/src/model/event_scoring.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'personalization_strategy_params.g.dart'; + +@JsonSerializable() +final class PersonalizationStrategyParams { + /// Returns a new [PersonalizationStrategyParams] instance. + const PersonalizationStrategyParams({ + required this.eventScoring, + required this.facetScoring, + required this.personalizationImpact, + }); + + /// Scores associated with the events. + @JsonKey(name: r'eventScoring') + final List eventScoring; + + /// Scores associated with the facets. + @JsonKey(name: r'facetScoring') + final List facetScoring; + + /// The impact that personalization has on search results: a number between 0 (personalization disabled) and 100 (personalization fully enabled). + @JsonKey(name: r'personalizationImpact') + final int personalizationImpact; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PersonalizationStrategyParams && + other.eventScoring == eventScoring && + other.facetScoring == facetScoring && + other.personalizationImpact == personalizationImpact; + + @override + int get hashCode => + eventScoring.hashCode + + facetScoring.hashCode + + personalizationImpact.hashCode; + + factory PersonalizationStrategyParams.fromJson(Map json) => + _$PersonalizationStrategyParamsFromJson(json); + + Map toJson() => _$PersonalizationStrategyParamsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/personalization_strategy_params.g.dart b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/personalization_strategy_params.g.dart new file mode 100644 index 0000000000..fe685930b0 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/personalization_strategy_params.g.dart @@ -0,0 +1,39 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'personalization_strategy_params.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PersonalizationStrategyParams _$PersonalizationStrategyParamsFromJson( + Map json) => + $checkedCreate( + 'PersonalizationStrategyParams', + json, + ($checkedConvert) { + final val = PersonalizationStrategyParams( + eventScoring: $checkedConvert( + 'eventScoring', + (v) => (v as List) + .map((e) => EventScoring.fromJson(e as Map)) + .toList()), + facetScoring: $checkedConvert( + 'facetScoring', + (v) => (v as List) + .map((e) => FacetScoring.fromJson(e as Map)) + .toList()), + personalizationImpact: + $checkedConvert('personalizationImpact', (v) => v as int), + ); + return val; + }, + ); + +Map _$PersonalizationStrategyParamsToJson( + PersonalizationStrategyParams instance) => + { + 'eventScoring': instance.eventScoring.map((e) => e.toJson()).toList(), + 'facetScoring': instance.facetScoring.map((e) => e.toJson()).toList(), + 'personalizationImpact': instance.personalizationImpact, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/set_personalization_strategy_response.dart b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/set_personalization_strategy_response.dart new file mode 100644 index 0000000000..ea99c43a2a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/set_personalization_strategy_response.dart @@ -0,0 +1,38 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'set_personalization_strategy_response.g.dart'; + +@JsonSerializable() +final class SetPersonalizationStrategyResponse { + /// Returns a new [SetPersonalizationStrategyResponse] instance. + const SetPersonalizationStrategyResponse({ + required this.message, + }); + + /// A message confirming the strategy update. + @JsonKey(name: r'message') + final String message; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SetPersonalizationStrategyResponse && other.message == message; + + @override + int get hashCode => message.hashCode; + + factory SetPersonalizationStrategyResponse.fromJson( + Map json) => + _$SetPersonalizationStrategyResponseFromJson(json); + + Map toJson() => + _$SetPersonalizationStrategyResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/set_personalization_strategy_response.g.dart b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/set_personalization_strategy_response.g.dart new file mode 100644 index 0000000000..31c08cb54a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/model/set_personalization_strategy_response.g.dart @@ -0,0 +1,26 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'set_personalization_strategy_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SetPersonalizationStrategyResponse _$SetPersonalizationStrategyResponseFromJson( + Map json) => + $checkedCreate( + 'SetPersonalizationStrategyResponse', + json, + ($checkedConvert) { + final val = SetPersonalizationStrategyResponse( + message: $checkedConvert('message', (v) => v as String), + ); + return val; + }, + ); + +Map _$SetPersonalizationStrategyResponseToJson( + SetPersonalizationStrategyResponse instance) => + { + 'message': instance.message, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/version.dart b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/version.dart new file mode 100644 index 0000000000..03e065a0a8 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_personalization/lib/src/version.dart @@ -0,0 +1,2 @@ +/// Current package version +const packageVersion = '0.1.2'; diff --git a/clients/algoliasearch-client-dart/packages/client_personalization/pubspec.yaml b/clients/algoliasearch-client-dart/packages/client_personalization/pubspec.yaml new file mode 100644 index 0000000000..26c0b6246c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_personalization/pubspec.yaml @@ -0,0 +1,24 @@ +name: algolia_client_personalization +version: 0.1.2 +description: A sub-package of the AlgoliaSearch library, offering personalization-specific functionalities for enhanced search and discovery in Dart/Flutter apps. +homepage: https://www.algolia.com/doc/ +repository: https://github.com/algolia/algoliasearch-client-dart/tree/main/packages/client_personalization +topics: + - search + - discovery + +environment: + sdk: '>=3.0.0 <4.0.0' + +dependencies: + # Pinning versions until the API stabilizes. + algolia_client_core: 0.1.1+4 + json_annotation: ^4.8.1 + collection: ^1.17.1 + +dev_dependencies: + build_runner: ^2.4.4 + json_serializable: ^6.7.0 + lints: ^2.1.1 + logging: ^1.2.0 + test: ^1.24.3 diff --git a/clients/algoliasearch-client-dart/packages/client_predict/build.yaml b/clients/algoliasearch-client-dart/packages/client_predict/build.yaml new file mode 100644 index 0000000000..6d71b406a7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/build.yaml @@ -0,0 +1,14 @@ +targets: + $default: + builders: + json_serializable: + options: + any_map: false + checked: true + create_factory: true + create_to_json: true + disallow_unrecognized_keys: false + explicit_to_json: true + field_rename: none + ignore_unannotated: false + include_if_null: false diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/algolia_client_predict.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/algolia_client_predict.dart new file mode 100644 index 0000000000..3be03e9db8 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/algolia_client_predict.dart @@ -0,0 +1,69 @@ +// A sub-package of the AlgoliaSearch library, offering predict-specific functionalities for enhanced search and discovery in Dart/Flutter apps. +library algolia_client_predict; + +export 'package:algolia_client_core/algolia_client_core.dart'; + +export 'src/api/predict_client.dart'; + +export 'src/model/activate_model_instance_response.dart'; +export 'src/model/activate_model_params.dart'; +export 'src/model/affinity.dart'; +export 'src/model/all_params.dart'; +export 'src/model/all_update_segment_params.dart'; +export 'src/model/compatible_sources.dart'; +export 'src/model/create_segment_params.dart'; +export 'src/model/create_segment_response.dart'; +export 'src/model/delete_model_instance_response.dart'; +export 'src/model/delete_segment_response.dart'; +export 'src/model/delete_user_profile_response.dart'; +export 'src/model/error.dart'; +export 'src/model/error_base.dart'; +export 'src/model/fetch_all_user_profiles_response.dart'; +export 'src/model/funnel_stage.dart'; +export 'src/model/get_available_model_types_response_inner.dart'; +export 'src/model/get_available_model_types_response_inner_data_requirements.dart'; +export 'src/model/get_model_instance_config_status.dart'; +export 'src/model/get_model_metrics_response.dart'; +export 'src/model/get_segment_users_response.dart'; +export 'src/model/limit_param.dart'; +export 'src/model/model_attributes.dart'; +export 'src/model/model_instance.dart'; +export 'src/model/model_metrics.dart'; +export 'src/model/model_status.dart'; +export 'src/model/models_to_retrieve.dart'; +export 'src/model/models_to_retrieve_param.dart'; +export 'src/model/next_page_token_param.dart'; +export 'src/model/predictions.dart'; +export 'src/model/predictions_affinities_success.dart'; +export 'src/model/predictions_funnel_stage_success.dart'; +export 'src/model/predictions_order_value_success.dart'; +export 'src/model/previous_page_token_param.dart'; +export 'src/model/properties.dart'; +export 'src/model/segment.dart'; +export 'src/model/segment_affinity_filter.dart'; +export 'src/model/segment_child_conditions.dart'; +export 'src/model/segment_condition_operator.dart'; +export 'src/model/segment_conditions_param.dart'; +export 'src/model/segment_filter_operator_boolean.dart'; +export 'src/model/segment_filter_operator_numerical.dart'; +export 'src/model/segment_filter_probability.dart'; +export 'src/model/segment_funnel_stage_filter.dart'; +export 'src/model/segment_name_param.dart'; +export 'src/model/segment_operand_affinity.dart'; +export 'src/model/segment_operand_funnel_stage.dart'; +export 'src/model/segment_operand_order_value.dart'; +export 'src/model/segment_operand_property.dart'; +export 'src/model/segment_order_value_filter.dart'; +export 'src/model/segment_parent_conditions.dart'; +export 'src/model/segment_property_filter.dart'; +export 'src/model/segment_status.dart'; +export 'src/model/segment_type.dart'; +export 'src/model/segments.dart'; +export 'src/model/types_to_retrieve.dart'; +export 'src/model/types_to_retrieve_param.dart'; +export 'src/model/update_model_instance_response.dart'; +export 'src/model/update_model_params.dart'; +export 'src/model/update_segment_response.dart'; +export 'src/model/user_profile.dart'; + +export 'src/extension.dart'; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/api/predict_client.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/api/predict_client.dart new file mode 100644 index 0000000000..43ef2867b0 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/api/predict_client.dart @@ -0,0 +1,677 @@ +// 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. + +import 'package:algolia_client_core/algolia_client_core.dart'; +import 'package:algolia_client_predict/src/deserialize.dart'; +import 'package:algolia_client_predict/src/version.dart'; + +import 'package:algolia_client_predict/src/model/activate_model_instance_response.dart'; +import 'package:algolia_client_predict/src/model/activate_model_params.dart'; +import 'package:algolia_client_predict/src/model/create_segment_params.dart'; +import 'package:algolia_client_predict/src/model/create_segment_response.dart'; +import 'package:algolia_client_predict/src/model/delete_model_instance_response.dart'; +import 'package:algolia_client_predict/src/model/delete_segment_response.dart'; +import 'package:algolia_client_predict/src/model/delete_user_profile_response.dart'; +import 'package:algolia_client_predict/src/model/fetch_all_user_profiles_response.dart'; +import 'package:algolia_client_predict/src/model/get_available_model_types_response_inner.dart'; +import 'package:algolia_client_predict/src/model/get_model_metrics_response.dart'; +import 'package:algolia_client_predict/src/model/get_segment_users_response.dart'; +import 'package:algolia_client_predict/src/model/model_instance.dart'; +import 'package:algolia_client_predict/src/model/segment.dart'; +import 'package:algolia_client_predict/src/model/segment_type.dart'; +import 'package:algolia_client_predict/src/model/update_model_instance_response.dart'; +import 'package:algolia_client_predict/src/model/update_model_params.dart'; +import 'package:algolia_client_predict/src/model/update_segment_response.dart'; +import 'package:algolia_client_predict/src/model/user_profile.dart'; + +final class PredictClient implements ApiClient { + @override + final String apiKey; + + @override + final String appId; + + @override + final ClientOptions options; + + final String region; + + final RetryStrategy _retryStrategy; + + PredictClient({ + required this.appId, + required this.apiKey, + this.options = const ClientOptions(), + required this.region, + }) : _retryStrategy = RetryStrategy.create( + segment: AgentSegment(value: "Predict", version: packageVersion), + appId: appId, + apiKey: apiKey, + options: options, + defaultHosts: () { + final allowedRegions = ['eu', 'us']; + assert( + allowedRegions.contains(region), + '`region` is required and must be one of the following: ${allowedRegions.join(', ')}', + ); + final url = + 'predict.{region}.algolia.com'.replaceAll('{region}', region); + return [Host(url: url)]; + }) { + assert(appId.isNotEmpty, '`appId` is missing.'); + assert(apiKey.isNotEmpty, '`apiKey` is missing.'); + } + + /// Activate a model instance. + /// Activate an existing model template. This action triggers the training and inference pipelines for the selected model. The model is added with `modelStatus=pending`. If a model with the exact same source & index already exists, the API endpoint returns an error. + /// + /// Parameters: + /// * [activateModelParams] + /// * [requestOptions] additional request configuration. + Future activateModelInstance({ + required ActivateModelParams activateModelParams, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1/predict/models', + body: activateModelParams.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'ActivateModelInstanceResponse', + growable: true, + ); + } + + /// Create a segment. + /// Create a new segment. All segments added by this endpoint will have a computed type. The endpoint receives a filters parameter, with a syntax similar to filters for Rules. + /// + /// Parameters: + /// * [createSegmentParams] + /// * [requestOptions] additional request configuration. + Future createSegment({ + required CreateSegmentParams createSegmentParams, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1/segments', + body: createSegmentParams.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'CreateSegmentResponse', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [requestOptions] additional request configuration. + Future del({ + required String path, + Map? parameters, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `del`.', + ); + final request = ApiRequest( + method: RequestMethod.delete, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Delete a model instance. + /// Delete the model’s configuration, pipelines and generated predictions. + /// + /// Parameters: + /// * [modelID] The ID of the model to retrieve. + /// * [requestOptions] additional request configuration. + Future deleteModelInstance({ + required String modelID, + RequestOptions? requestOptions, + }) async { + assert( + modelID.isNotEmpty, + 'Parameter `modelID` is required when calling `deleteModelInstance`.', + ); + final request = ApiRequest( + method: RequestMethod.delete, + path: r'/1/predict/models/{modelID}'.replaceAll( + '{' r'modelID' '}', Uri.encodeComponent(modelID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'DeleteModelInstanceResponse', + growable: true, + ); + } + + /// Delete a segment's configuration. + /// Delete the segment’s configuration. User intents (predictions) from the segment are not deleted. All segment types (computed or custom) can be deleted. When the query is successful, the HTTP response is 200 OK and returns the date until which you can safely consider the data as being deleted. + /// + /// Parameters: + /// * [segmentID] The ID of the Segment to fetch. + /// * [requestOptions] additional request configuration. + Future deleteSegment({ + required String segmentID, + RequestOptions? requestOptions, + }) async { + assert( + segmentID.isNotEmpty, + 'Parameter `segmentID` is required when calling `deleteSegment`.', + ); + final request = ApiRequest( + method: RequestMethod.delete, + path: r'/1/segments/{segmentID}'.replaceAll( + '{' r'segmentID' '}', Uri.encodeComponent(segmentID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'DeleteSegmentResponse', + growable: true, + ); + } + + /// Delete user profile. + /// Delete all data and predictions associated with an authenticated user (userID) or an anonymous user (cookieID, sessionID). + /// + /// Parameters: + /// * [userID] User ID for authenticated users or cookie ID for non-authenticated repeated users (visitors). + /// * [requestOptions] additional request configuration. + Future deleteUserProfile({ + required String userID, + RequestOptions? requestOptions, + }) async { + assert( + userID.isNotEmpty, + 'Parameter `userID` is required when calling `deleteUserProfile`.', + ); + final request = ApiRequest( + method: RequestMethod.delete, + path: r'/1/users/{userID}'.replaceAll( + '{' r'userID' '}', Uri.encodeComponent(userID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'DeleteUserProfileResponse', + growable: true, + ); + } + + /// Get all segments. + /// Get the list of segments with their configuration. + /// + /// Parameters: + /// * [type] The type of segments to fetch. + /// * [requestOptions] additional request configuration. + Future> fetchAllSegments({ + SegmentType? type, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/segments', + queryParams: { + if (type != null) 'type': type, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize, Segment>( + response, + 'List', + growable: true, + ); + } + + /// Get all user profiles. + /// Get all users with predictions in the provided application. + /// + /// Parameters: + /// * [fetchAllUserProfilesParams] - one of types: [ModelsToRetrieveParam], [LimitParam], [PreviousPageTokenParam], [NextPageTokenParam], [TypesToRetrieveParam], + /// * [requestOptions] additional request configuration. + Future fetchAllUserProfiles({ + required dynamic fetchAllUserProfilesParams, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1/users', + body: fetchAllUserProfilesParams?.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'FetchAllUserProfilesResponse', + growable: true, + ); + } + + /// Get the segment configuration. + /// Get the segment configuration. + /// + /// Parameters: + /// * [segmentID] The ID of the Segment to fetch. + /// * [requestOptions] additional request configuration. + Future fetchSegment({ + required String segmentID, + RequestOptions? requestOptions, + }) async { + assert( + segmentID.isNotEmpty, + 'Parameter `segmentID` is required when calling `fetchSegment`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/segments/{segmentID}'.replaceAll( + '{' r'segmentID' '}', Uri.encodeComponent(segmentID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Segment', + growable: true, + ); + } + + /// Get user profile. + /// Get predictions, properties (raw, computed or custom) and segments (computed or custom) for a user profile. + /// + /// Parameters: + /// * [userID] User ID for authenticated users or cookie ID for non-authenticated repeated users (visitors). + /// * [params] - one of types: [ModelsToRetrieveParam], [AllParams], [TypesToRetrieveParam], + /// * [requestOptions] additional request configuration. + Future fetchUserProfile({ + required String userID, + required dynamic params, + RequestOptions? requestOptions, + }) async { + assert( + userID.isNotEmpty, + 'Parameter `userID` is required when calling `fetchUserProfile`.', + ); + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1/users/{userID}/fetch'.replaceAll( + '{' r'userID' '}', Uri.encodeComponent(userID.toString())), + body: params?.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'UserProfile', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [requestOptions] additional request configuration. + Future get({ + required String path, + Map? parameters, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `get`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Get a list of available model types. + /// Get a list of all available model types. Each model type can be activated more than once, by selecting a different data source. + /// + /// Parameters: + /// * [requestOptions] additional request configuration. + Future> getAvailableModelTypes({ + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/predict/modeltypes', + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize, + GetAvailableModelTypesResponseInner>( + response, + 'List', + growable: true, + ); + } + + /// Get a model’s instance configuration. + /// Get the configuration for a model that was activated. + /// + /// Parameters: + /// * [modelID] The ID of the model to retrieve. + /// * [requestOptions] additional request configuration. + Future getModelInstanceConfig({ + required String modelID, + RequestOptions? requestOptions, + }) async { + assert( + modelID.isNotEmpty, + 'Parameter `modelID` is required when calling `getModelInstanceConfig`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/predict/models/{modelID}'.replaceAll( + '{' r'modelID' '}', Uri.encodeComponent(modelID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'ModelInstance', + growable: true, + ); + } + + /// Get model instances. + /// Get a list of all model instances. + /// + /// Parameters: + /// * [requestOptions] additional request configuration. + Future> getModelInstances({ + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/predict/models', + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize, ModelInstance>( + response, + 'List', + growable: true, + ); + } + + /// Get a model’s instance metrics. + /// Get the model instance’ training metrics. + /// + /// Parameters: + /// * [modelID] The ID of the model to retrieve. + /// * [requestOptions] additional request configuration. + Future getModelMetrics({ + required String modelID, + RequestOptions? requestOptions, + }) async { + assert( + modelID.isNotEmpty, + 'Parameter `modelID` is required when calling `getModelMetrics`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/predict/models/{modelID}/metrics'.replaceAll( + '{' r'modelID' '}', Uri.encodeComponent(modelID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetModelMetricsResponse', + growable: true, + ); + } + + /// Get segment users. + /// Get the profiles of users that belong to a segment. + /// + /// Parameters: + /// * [segmentID] The ID of the Segment to fetch. + /// * [fetchAllUserProfilesParams] - one of types: [ModelsToRetrieveParam], [LimitParam], [PreviousPageTokenParam], [NextPageTokenParam], [TypesToRetrieveParam], + /// * [requestOptions] additional request configuration. + Future getSegmentUsers({ + required String segmentID, + required dynamic fetchAllUserProfilesParams, + RequestOptions? requestOptions, + }) async { + assert( + segmentID.isNotEmpty, + 'Parameter `segmentID` is required when calling `getSegmentUsers`.', + ); + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1/segments/{segmentID}/users'.replaceAll( + '{' r'segmentID' '}', Uri.encodeComponent(segmentID.toString())), + body: fetchAllUserProfilesParams?.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetSegmentUsersResponse', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [body] Parameters to send with the custom request. + /// * [requestOptions] additional request configuration. + Future post({ + required String path, + Map? parameters, + Object? body, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `post`.', + ); + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + body: body, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [body] Parameters to send with the custom request. + /// * [requestOptions] additional request configuration. + Future put({ + required String path, + Map? parameters, + Object? body, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `put`.', + ); + final request = ApiRequest( + method: RequestMethod.put, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + body: body, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Update a model instance. + /// Update a model’s configuration. + /// + /// Parameters: + /// * [modelID] The ID of the model to retrieve. + /// * [updateModelParams] + /// * [requestOptions] additional request configuration. + Future updateModelInstance({ + required String modelID, + required UpdateModelParams updateModelParams, + RequestOptions? requestOptions, + }) async { + assert( + modelID.isNotEmpty, + 'Parameter `modelID` is required when calling `updateModelInstance`.', + ); + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1/predict/models/{modelID}'.replaceAll( + '{' r'modelID' '}', Uri.encodeComponent(modelID.toString())), + body: updateModelParams.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'UpdateModelInstanceResponse', + growable: true, + ); + } + + /// Update segment. + /// Update a segment’s configuration. + /// + /// Parameters: + /// * [segmentID] The ID of the Segment to fetch. + /// * [updateSegmentParams] - one of types: [SegmentConditionsParam], [SegmentNameParam], [AllUpdateSegmentParams], + /// * [requestOptions] additional request configuration. + Future updateSegment({ + required String segmentID, + required dynamic updateSegmentParams, + RequestOptions? requestOptions, + }) async { + assert( + segmentID.isNotEmpty, + 'Parameter `segmentID` is required when calling `updateSegment`.', + ); + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1/segments/{segmentID}'.replaceAll( + '{' r'segmentID' '}', Uri.encodeComponent(segmentID.toString())), + body: updateSegmentParams?.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'UpdateSegmentResponse', + growable: true, + ); + } + + @override + void dispose() => _retryStrategy.dispose(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/deserialize.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/deserialize.dart new file mode 100644 index 0000000000..8328183f9d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/deserialize.dart @@ -0,0 +1,273 @@ +import 'package:algolia_client_predict/src/model/activate_model_instance_response.dart'; +import 'package:algolia_client_predict/src/model/activate_model_params.dart'; +import 'package:algolia_client_predict/src/model/affinity.dart'; +import 'package:algolia_client_predict/src/model/all_params.dart'; +import 'package:algolia_client_predict/src/model/all_update_segment_params.dart'; +import 'package:algolia_client_predict/src/model/compatible_sources.dart'; +import 'package:algolia_client_predict/src/model/create_segment_params.dart'; +import 'package:algolia_client_predict/src/model/create_segment_response.dart'; +import 'package:algolia_client_predict/src/model/delete_model_instance_response.dart'; +import 'package:algolia_client_predict/src/model/delete_segment_response.dart'; +import 'package:algolia_client_predict/src/model/delete_user_profile_response.dart'; +import 'package:algolia_client_predict/src/model/error.dart'; +import 'package:algolia_client_predict/src/model/error_base.dart'; +import 'package:algolia_client_predict/src/model/fetch_all_user_profiles_response.dart'; +import 'package:algolia_client_predict/src/model/funnel_stage.dart'; +import 'package:algolia_client_predict/src/model/get_available_model_types_response_inner.dart'; +import 'package:algolia_client_predict/src/model/get_available_model_types_response_inner_data_requirements.dart'; +import 'package:algolia_client_predict/src/model/get_model_instance_config_status.dart'; +import 'package:algolia_client_predict/src/model/get_model_metrics_response.dart'; +import 'package:algolia_client_predict/src/model/get_segment_users_response.dart'; +import 'package:algolia_client_predict/src/model/limit_param.dart'; +import 'package:algolia_client_predict/src/model/model_attributes.dart'; +import 'package:algolia_client_predict/src/model/model_instance.dart'; +import 'package:algolia_client_predict/src/model/model_metrics.dart'; +import 'package:algolia_client_predict/src/model/model_status.dart'; +import 'package:algolia_client_predict/src/model/models_to_retrieve.dart'; +import 'package:algolia_client_predict/src/model/models_to_retrieve_param.dart'; +import 'package:algolia_client_predict/src/model/next_page_token_param.dart'; +import 'package:algolia_client_predict/src/model/predictions.dart'; +import 'package:algolia_client_predict/src/model/predictions_affinities_success.dart'; +import 'package:algolia_client_predict/src/model/predictions_funnel_stage_success.dart'; +import 'package:algolia_client_predict/src/model/predictions_order_value_success.dart'; +import 'package:algolia_client_predict/src/model/previous_page_token_param.dart'; +import 'package:algolia_client_predict/src/model/properties.dart'; +import 'package:algolia_client_predict/src/model/segment.dart'; +import 'package:algolia_client_predict/src/model/segment_affinity_filter.dart'; +import 'package:algolia_client_predict/src/model/segment_child_conditions.dart'; +import 'package:algolia_client_predict/src/model/segment_condition_operator.dart'; +import 'package:algolia_client_predict/src/model/segment_conditions_param.dart'; +import 'package:algolia_client_predict/src/model/segment_filter_operator_boolean.dart'; +import 'package:algolia_client_predict/src/model/segment_filter_operator_numerical.dart'; +import 'package:algolia_client_predict/src/model/segment_filter_probability.dart'; +import 'package:algolia_client_predict/src/model/segment_funnel_stage_filter.dart'; +import 'package:algolia_client_predict/src/model/segment_name_param.dart'; +import 'package:algolia_client_predict/src/model/segment_operand_affinity.dart'; +import 'package:algolia_client_predict/src/model/segment_operand_funnel_stage.dart'; +import 'package:algolia_client_predict/src/model/segment_operand_order_value.dart'; +import 'package:algolia_client_predict/src/model/segment_operand_property.dart'; +import 'package:algolia_client_predict/src/model/segment_order_value_filter.dart'; +import 'package:algolia_client_predict/src/model/segment_parent_conditions.dart'; +import 'package:algolia_client_predict/src/model/segment_property_filter.dart'; +import 'package:algolia_client_predict/src/model/segment_status.dart'; +import 'package:algolia_client_predict/src/model/segment_type.dart'; +import 'package:algolia_client_predict/src/model/segments.dart'; +import 'package:algolia_client_predict/src/model/types_to_retrieve.dart'; +import 'package:algolia_client_predict/src/model/types_to_retrieve_param.dart'; +import 'package:algolia_client_predict/src/model/update_model_instance_response.dart'; +import 'package:algolia_client_predict/src/model/update_model_params.dart'; +import 'package:algolia_client_predict/src/model/update_segment_response.dart'; +import 'package:algolia_client_predict/src/model/user_profile.dart'; + +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + +ReturnType deserialize(dynamic value, String targetType, + {bool growable = true}) { + switch (targetType) { + case 'String': + return '$value' as ReturnType; + case 'int': + return (value is int ? value : int.parse('$value')) as ReturnType; + case 'bool': + if (value is bool) { + return value as ReturnType; + } + final valueString = '$value'.toLowerCase(); + return (valueString == 'true' || valueString == '1') as ReturnType; + case 'double': + return (value is double ? value : double.parse('$value')) as ReturnType; + case 'ActivateModelInstanceResponse': + return ActivateModelInstanceResponse.fromJson( + value as Map) as ReturnType; + case 'ActivateModelParams': + return ActivateModelParams.fromJson(value as Map) + as ReturnType; + case 'Affinity': + return Affinity.fromJson(value as Map) as ReturnType; + case 'AllParams': + return AllParams.fromJson(value as Map) as ReturnType; + case 'AllUpdateSegmentParams': + return AllUpdateSegmentParams.fromJson(value as Map) + as ReturnType; + case 'CompatibleSources': + return CompatibleSources.fromJson(value) as ReturnType; + case 'CreateSegmentParams': + return CreateSegmentParams.fromJson(value as Map) + as ReturnType; + case 'CreateSegmentResponse': + return CreateSegmentResponse.fromJson(value as Map) + as ReturnType; + case 'DeleteModelInstanceResponse': + return DeleteModelInstanceResponse.fromJson(value as Map) + as ReturnType; + case 'DeleteSegmentResponse': + return DeleteSegmentResponse.fromJson(value as Map) + as ReturnType; + case 'DeleteUserProfileResponse': + return DeleteUserProfileResponse.fromJson(value as Map) + as ReturnType; + case 'Error': + return Error.fromJson(value as Map) as ReturnType; + case 'ErrorBase': + return ErrorBase.fromJson(value as Map) as ReturnType; + case 'FetchAllUserProfilesResponse': + return FetchAllUserProfilesResponse.fromJson( + value as Map) as ReturnType; + case 'FunnelStage': + return FunnelStage.fromJson(value as Map) as ReturnType; + case 'GetAvailableModelTypesResponseInner': + return GetAvailableModelTypesResponseInner.fromJson( + value as Map) as ReturnType; + case 'GetAvailableModelTypesResponseInnerDataRequirements': + return GetAvailableModelTypesResponseInnerDataRequirements.fromJson( + value as Map) as ReturnType; + case 'GetModelInstanceConfigStatus': + return GetModelInstanceConfigStatus.fromJson(value) as ReturnType; + case 'GetModelMetricsResponse': + return GetModelMetricsResponse.fromJson(value as Map) + as ReturnType; + case 'GetSegmentUsersResponse': + return GetSegmentUsersResponse.fromJson(value as Map) + as ReturnType; + case 'LimitParam': + return LimitParam.fromJson(value as Map) as ReturnType; + case 'ModelAttributes': + return ModelAttributes.fromJson(value as Map) + as ReturnType; + case 'ModelInstance': + return ModelInstance.fromJson(value as Map) + as ReturnType; + case 'ModelMetrics': + return ModelMetrics.fromJson(value as Map) as ReturnType; + case 'ModelStatus': + return ModelStatus.fromJson(value) as ReturnType; + case 'ModelsToRetrieve': + return ModelsToRetrieve.fromJson(value) as ReturnType; + case 'ModelsToRetrieveParam': + return ModelsToRetrieveParam.fromJson(value as Map) + as ReturnType; + case 'NextPageTokenParam': + return NextPageTokenParam.fromJson(value as Map) + as ReturnType; + case 'Predictions': + return Predictions.fromJson(value as Map) as ReturnType; + case 'PredictionsAffinitiesSuccess': + return PredictionsAffinitiesSuccess.fromJson( + value as Map) as ReturnType; + case 'PredictionsFunnelStageSuccess': + return PredictionsFunnelStageSuccess.fromJson( + value as Map) as ReturnType; + case 'PredictionsOrderValueSuccess': + return PredictionsOrderValueSuccess.fromJson( + value as Map) as ReturnType; + case 'PreviousPageTokenParam': + return PreviousPageTokenParam.fromJson(value as Map) + as ReturnType; + case 'Properties': + return Properties.fromJson(value as Map) as ReturnType; + case 'Segment': + return Segment.fromJson(value as Map) as ReturnType; + case 'SegmentAffinityFilter': + return SegmentAffinityFilter.fromJson(value as Map) + as ReturnType; + case 'SegmentChildConditions': + return SegmentChildConditions.fromJson(value as Map) + as ReturnType; + case 'SegmentConditionOperator': + return SegmentConditionOperator.fromJson(value) as ReturnType; + case 'SegmentConditionsParam': + return SegmentConditionsParam.fromJson(value as Map) + as ReturnType; + case 'SegmentFilterOperatorBoolean': + return SegmentFilterOperatorBoolean.fromJson(value) as ReturnType; + case 'SegmentFilterOperatorNumerical': + return SegmentFilterOperatorNumerical.fromJson(value) as ReturnType; + case 'SegmentFilterProbability': + return SegmentFilterProbability.fromJson(value as Map) + as ReturnType; + case 'SegmentFunnelStageFilter': + return SegmentFunnelStageFilter.fromJson(value as Map) + as ReturnType; + case 'SegmentNameParam': + return SegmentNameParam.fromJson(value as Map) + as ReturnType; + case 'SegmentOperandAffinity': + return SegmentOperandAffinity.fromJson(value as Map) + as ReturnType; + case 'SegmentOperandFunnelStage': + return SegmentOperandFunnelStage.fromJson(value as Map) + as ReturnType; + case 'SegmentOperandOrderValue': + return SegmentOperandOrderValue.fromJson(value as Map) + as ReturnType; + case 'SegmentOperandProperty': + return SegmentOperandProperty.fromJson(value as Map) + as ReturnType; + case 'SegmentOrderValueFilter': + return SegmentOrderValueFilter.fromJson(value as Map) + as ReturnType; + case 'SegmentParentConditions': + return SegmentParentConditions.fromJson(value as Map) + as ReturnType; + case 'SegmentPropertyFilter': + return SegmentPropertyFilter.fromJson(value as Map) + as ReturnType; + case 'SegmentStatus': + return SegmentStatus.fromJson(value) as ReturnType; + case 'SegmentType': + return SegmentType.fromJson(value) as ReturnType; + case 'Segments': + return Segments.fromJson(value as Map) as ReturnType; + case 'TypesToRetrieve': + return TypesToRetrieve.fromJson(value) as ReturnType; + case 'TypesToRetrieveParam': + return TypesToRetrieveParam.fromJson(value as Map) + as ReturnType; + case 'UpdateModelInstanceResponse': + return UpdateModelInstanceResponse.fromJson(value as Map) + as ReturnType; + case 'UpdateModelParams': + return UpdateModelParams.fromJson(value as Map) + as ReturnType; + case 'UpdateSegmentResponse': + return UpdateSegmentResponse.fromJson(value as Map) + as ReturnType; + case 'UserProfile': + return UserProfile.fromJson(value as Map) as ReturnType; + default: + RegExpMatch? match; + + if (value is List && (match = _regList.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toList(growable: growable) as ReturnType; + } + if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toSet() as ReturnType; + } + if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return Map.fromIterables( + value.keys, + value.values.map((dynamic v) => deserialize( + v, targetType, + growable: growable)), + ) as ReturnType; + } + if (targetType == 'Object') { + return value; + } + break; + } + throw Exception('Cannot deserialize'); +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_instance_response.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_instance_response.dart new file mode 100644 index 0000000000..c8d094cbca --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_instance_response.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'activate_model_instance_response.g.dart'; + +@JsonSerializable() +final class ActivateModelInstanceResponse { + /// Returns a new [ActivateModelInstanceResponse] instance. + const ActivateModelInstanceResponse({ + required this.modelID, + required this.updatedAt, + }); + + /// The ID of the model. + @JsonKey(name: r'modelID') + final String modelID; + + /// Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. + @JsonKey(name: r'updatedAt') + final String updatedAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ActivateModelInstanceResponse && + other.modelID == modelID && + other.updatedAt == updatedAt; + + @override + int get hashCode => modelID.hashCode + updatedAt.hashCode; + + factory ActivateModelInstanceResponse.fromJson(Map json) => + _$ActivateModelInstanceResponseFromJson(json); + + Map toJson() => _$ActivateModelInstanceResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_instance_response.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_instance_response.g.dart new file mode 100644 index 0000000000..5ba0afa9d7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_instance_response.g.dart @@ -0,0 +1,28 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'activate_model_instance_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ActivateModelInstanceResponse _$ActivateModelInstanceResponseFromJson( + Map json) => + $checkedCreate( + 'ActivateModelInstanceResponse', + json, + ($checkedConvert) { + final val = ActivateModelInstanceResponse( + modelID: $checkedConvert('modelID', (v) => v as String), + updatedAt: $checkedConvert('updatedAt', (v) => v as String), + ); + return val; + }, + ); + +Map _$ActivateModelInstanceResponseToJson( + ActivateModelInstanceResponse instance) => + { + 'modelID': instance.modelID, + 'updatedAt': instance.updatedAt, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_params.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_params.dart new file mode 100644 index 0000000000..0aff5db31c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_params.dart @@ -0,0 +1,65 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/models_to_retrieve.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'activate_model_params.g.dart'; + +@JsonSerializable() +final class ActivateModelParams { + /// Returns a new [ActivateModelParams] instance. + const ActivateModelParams({ + required this.type, + required this.name, + required this.sourceID, + required this.index, + this.modelAttributes, + }); + + @JsonKey(name: r'type') + final ModelsToRetrieve type; + + /// The model’s instance name. + @JsonKey(name: r'name') + final String name; + + /// The data source ID, as returned by the (external) sources API. + @JsonKey(name: r'sourceID') + final String sourceID; + + /// The index name. + @JsonKey(name: r'index') + final String index; + + @JsonKey(name: r'modelAttributes') + final List? modelAttributes; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ActivateModelParams && + other.type == type && + other.name == name && + other.sourceID == sourceID && + other.index == index && + other.modelAttributes == modelAttributes; + + @override + int get hashCode => + type.hashCode + + name.hashCode + + sourceID.hashCode + + index.hashCode + + modelAttributes.hashCode; + + factory ActivateModelParams.fromJson(Map json) => + _$ActivateModelParamsFromJson(json); + + Map toJson() => _$ActivateModelParamsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_params.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_params.g.dart new file mode 100644 index 0000000000..7b840e9071 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_params.g.dart @@ -0,0 +1,49 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'activate_model_params.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ActivateModelParams _$ActivateModelParamsFromJson(Map json) => + $checkedCreate( + 'ActivateModelParams', + json, + ($checkedConvert) { + final val = ActivateModelParams( + type: $checkedConvert( + 'type', (v) => $enumDecode(_$ModelsToRetrieveEnumMap, v)), + name: $checkedConvert('name', (v) => v as String), + sourceID: $checkedConvert('sourceID', (v) => v as String), + index: $checkedConvert('index', (v) => v as String), + modelAttributes: $checkedConvert('modelAttributes', + (v) => (v as List?)?.map((e) => e as String).toList()), + ); + return val; + }, + ); + +Map _$ActivateModelParamsToJson(ActivateModelParams instance) { + final val = { + 'type': instance.type.toJson(), + 'name': instance.name, + 'sourceID': instance.sourceID, + 'index': instance.index, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('modelAttributes', instance.modelAttributes); + return val; +} + +const _$ModelsToRetrieveEnumMap = { + ModelsToRetrieve.funnelStage: 'funnel_stage', + ModelsToRetrieve.orderValue: 'order_value', + ModelsToRetrieve.affinities: 'affinities', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/affinity.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/affinity.dart new file mode 100644 index 0000000000..bec2ced086 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/affinity.dart @@ -0,0 +1,52 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'affinity.g.dart'; + +@JsonSerializable() +final class Affinity { + /// Returns a new [Affinity] instance. + const Affinity({ + required this.name, + required this.value, + required this.probability, + }); + + @JsonKey(name: r'name') + final String name; + + /// One of types: + /// - [bool] + /// - [double] + /// - [String] + @JsonKey(name: r'value') + final dynamic value; + + // minimum: 0 + // maximum: 1 + @JsonKey(name: r'probability') + final double probability; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Affinity && + other.name == name && + other.value == value && + other.probability == probability; + + @override + int get hashCode => name.hashCode + value.hashCode + probability.hashCode; + + factory Affinity.fromJson(Map json) => + _$AffinityFromJson(json); + + Map toJson() => _$AffinityToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/affinity.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/affinity.g.dart new file mode 100644 index 0000000000..799e14eca2 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/affinity.g.dart @@ -0,0 +1,37 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'affinity.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Affinity _$AffinityFromJson(Map json) => $checkedCreate( + 'Affinity', + json, + ($checkedConvert) { + final val = Affinity( + name: $checkedConvert('name', (v) => v as String), + value: $checkedConvert('value', (v) => v), + probability: + $checkedConvert('probability', (v) => (v as num).toDouble()), + ); + return val; + }, + ); + +Map _$AffinityToJson(Affinity instance) { + final val = { + 'name': instance.name, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('value', instance.value); + val['probability'] = instance.probability; + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_params.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_params.dart new file mode 100644 index 0000000000..08ab405683 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_params.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/models_to_retrieve.dart'; +import 'package:algolia_client_predict/src/model/types_to_retrieve.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'all_params.g.dart'; + +@JsonSerializable() +final class AllParams { + /// Returns a new [AllParams] instance. + const AllParams({ + this.modelsToRetrieve, + this.typesToRetrieve, + }); + + @JsonKey(name: r'modelsToRetrieve') + final List? modelsToRetrieve; + + @JsonKey(name: r'typesToRetrieve') + final List? typesToRetrieve; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AllParams && + other.modelsToRetrieve == modelsToRetrieve && + other.typesToRetrieve == typesToRetrieve; + + @override + int get hashCode => modelsToRetrieve.hashCode + typesToRetrieve.hashCode; + + factory AllParams.fromJson(Map json) => + _$AllParamsFromJson(json); + + Map toJson() => _$AllParamsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_params.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_params.g.dart new file mode 100644 index 0000000000..ab3ee0a9e6 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_params.g.dart @@ -0,0 +1,54 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'all_params.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AllParams _$AllParamsFromJson(Map json) => $checkedCreate( + 'AllParams', + json, + ($checkedConvert) { + final val = AllParams( + modelsToRetrieve: $checkedConvert( + 'modelsToRetrieve', + (v) => (v as List?) + ?.map((e) => $enumDecode(_$ModelsToRetrieveEnumMap, e)) + .toList()), + typesToRetrieve: $checkedConvert( + 'typesToRetrieve', + (v) => (v as List?) + ?.map((e) => $enumDecode(_$TypesToRetrieveEnumMap, e)) + .toList()), + ); + return val; + }, + ); + +Map _$AllParamsToJson(AllParams instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('modelsToRetrieve', + instance.modelsToRetrieve?.map((e) => e.toJson()).toList()); + writeNotNull('typesToRetrieve', + instance.typesToRetrieve?.map((e) => e.toJson()).toList()); + return val; +} + +const _$ModelsToRetrieveEnumMap = { + ModelsToRetrieve.funnelStage: 'funnel_stage', + ModelsToRetrieve.orderValue: 'order_value', + ModelsToRetrieve.affinities: 'affinities', +}; + +const _$TypesToRetrieveEnumMap = { + TypesToRetrieve.properties: 'properties', + TypesToRetrieve.segments: 'segments', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_update_segment_params.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_update_segment_params.dart new file mode 100644 index 0000000000..436b5930f6 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_update_segment_params.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/segment_parent_conditions.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'all_update_segment_params.g.dart'; + +@JsonSerializable() +final class AllUpdateSegmentParams { + /// Returns a new [AllUpdateSegmentParams] instance. + const AllUpdateSegmentParams({ + this.name, + this.conditions, + }); + + /// The name or description of the segment. + @JsonKey(name: r'name') + final String? name; + + @JsonKey(name: r'conditions') + final SegmentParentConditions? conditions; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AllUpdateSegmentParams && + other.name == name && + other.conditions == conditions; + + @override + int get hashCode => name.hashCode + conditions.hashCode; + + factory AllUpdateSegmentParams.fromJson(Map json) => + _$AllUpdateSegmentParamsFromJson(json); + + Map toJson() => _$AllUpdateSegmentParamsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_update_segment_params.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_update_segment_params.g.dart new file mode 100644 index 0000000000..46d05918f9 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_update_segment_params.g.dart @@ -0,0 +1,41 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'all_update_segment_params.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AllUpdateSegmentParams _$AllUpdateSegmentParamsFromJson( + Map json) => + $checkedCreate( + 'AllUpdateSegmentParams', + json, + ($checkedConvert) { + final val = AllUpdateSegmentParams( + name: $checkedConvert('name', (v) => v as String?), + conditions: $checkedConvert( + 'conditions', + (v) => v == null + ? null + : SegmentParentConditions.fromJson( + v as Map)), + ); + return val; + }, + ); + +Map _$AllUpdateSegmentParamsToJson( + AllUpdateSegmentParams instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('name', instance.name); + writeNotNull('conditions', instance.conditions?.toJson()); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/compatible_sources.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/compatible_sources.dart new file mode 100644 index 0000000000..4e858aff38 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/compatible_sources.dart @@ -0,0 +1,23 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum CompatibleSources { + bigquery(r'bigquery'); + + const CompatibleSources(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static CompatibleSources fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_params.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_params.dart new file mode 100644 index 0000000000..c27947488e --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_params.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/segment_parent_conditions.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'create_segment_params.g.dart'; + +@JsonSerializable() +final class CreateSegmentParams { + /// Returns a new [CreateSegmentParams] instance. + const CreateSegmentParams({ + required this.name, + required this.conditions, + }); + + /// The name or description of the segment. + @JsonKey(name: r'name') + final String name; + + @JsonKey(name: r'conditions') + final SegmentParentConditions conditions; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is CreateSegmentParams && + other.name == name && + other.conditions == conditions; + + @override + int get hashCode => name.hashCode + conditions.hashCode; + + factory CreateSegmentParams.fromJson(Map json) => + _$CreateSegmentParamsFromJson(json); + + Map toJson() => _$CreateSegmentParamsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_params.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_params.g.dart new file mode 100644 index 0000000000..c2fb34e3bc --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_params.g.dart @@ -0,0 +1,30 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'create_segment_params.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +CreateSegmentParams _$CreateSegmentParamsFromJson(Map json) => + $checkedCreate( + 'CreateSegmentParams', + json, + ($checkedConvert) { + final val = CreateSegmentParams( + name: $checkedConvert('name', (v) => v as String), + conditions: $checkedConvert( + 'conditions', + (v) => + SegmentParentConditions.fromJson(v as Map)), + ); + return val; + }, + ); + +Map _$CreateSegmentParamsToJson( + CreateSegmentParams instance) => + { + 'name': instance.name, + 'conditions': instance.conditions.toJson(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_response.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_response.dart new file mode 100644 index 0000000000..2661e5f077 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_response.dart @@ -0,0 +1,49 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'create_segment_response.g.dart'; + +@JsonSerializable() +final class CreateSegmentResponse { + /// Returns a new [CreateSegmentResponse] instance. + const CreateSegmentResponse({ + required this.segmentID, + this.size, + required this.updatedAt, + }); + + /// The ID of the segment. + @JsonKey(name: r'segmentID') + final String segmentID; + + /// The approximate number of users that matched the segment conditions when it was created, last updated, or when model inference last ran. + @JsonKey(name: r'size') + final num? size; + + /// The date and time at which the segment was updated (RFC3339). + @JsonKey(name: r'updatedAt') + final String updatedAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is CreateSegmentResponse && + other.segmentID == segmentID && + other.size == size && + other.updatedAt == updatedAt; + + @override + int get hashCode => segmentID.hashCode + size.hashCode + updatedAt.hashCode; + + factory CreateSegmentResponse.fromJson(Map json) => + _$CreateSegmentResponseFromJson(json); + + Map toJson() => _$CreateSegmentResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_response.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_response.g.dart new file mode 100644 index 0000000000..f185df2986 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_response.g.dart @@ -0,0 +1,39 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'create_segment_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +CreateSegmentResponse _$CreateSegmentResponseFromJson( + Map json) => + $checkedCreate( + 'CreateSegmentResponse', + json, + ($checkedConvert) { + final val = CreateSegmentResponse( + segmentID: $checkedConvert('segmentID', (v) => v as String), + size: $checkedConvert('size', (v) => v as num?), + updatedAt: $checkedConvert('updatedAt', (v) => v as String), + ); + return val; + }, + ); + +Map _$CreateSegmentResponseToJson( + CreateSegmentResponse instance) { + final val = { + 'segmentID': instance.segmentID, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('size', instance.size); + val['updatedAt'] = instance.updatedAt; + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_model_instance_response.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_model_instance_response.dart new file mode 100644 index 0000000000..453cf30179 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_model_instance_response.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'delete_model_instance_response.g.dart'; + +@JsonSerializable() +final class DeleteModelInstanceResponse { + /// Returns a new [DeleteModelInstanceResponse] instance. + const DeleteModelInstanceResponse({ + required this.modelID, + required this.deletedUntil, + }); + + /// The ID of the model. + @JsonKey(name: r'modelID') + final String modelID; + + /// The date until which you can safely consider the data as being deleted. + @JsonKey(name: r'deletedUntil') + final String deletedUntil; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is DeleteModelInstanceResponse && + other.modelID == modelID && + other.deletedUntil == deletedUntil; + + @override + int get hashCode => modelID.hashCode + deletedUntil.hashCode; + + factory DeleteModelInstanceResponse.fromJson(Map json) => + _$DeleteModelInstanceResponseFromJson(json); + + Map toJson() => _$DeleteModelInstanceResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_model_instance_response.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_model_instance_response.g.dart new file mode 100644 index 0000000000..b175c3f696 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_model_instance_response.g.dart @@ -0,0 +1,28 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'delete_model_instance_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +DeleteModelInstanceResponse _$DeleteModelInstanceResponseFromJson( + Map json) => + $checkedCreate( + 'DeleteModelInstanceResponse', + json, + ($checkedConvert) { + final val = DeleteModelInstanceResponse( + modelID: $checkedConvert('modelID', (v) => v as String), + deletedUntil: $checkedConvert('deletedUntil', (v) => v as String), + ); + return val; + }, + ); + +Map _$DeleteModelInstanceResponseToJson( + DeleteModelInstanceResponse instance) => + { + 'modelID': instance.modelID, + 'deletedUntil': instance.deletedUntil, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_segment_response.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_segment_response.dart new file mode 100644 index 0000000000..20856f240f --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_segment_response.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'delete_segment_response.g.dart'; + +@JsonSerializable() +final class DeleteSegmentResponse { + /// Returns a new [DeleteSegmentResponse] instance. + const DeleteSegmentResponse({ + required this.segmentID, + required this.deletedUntil, + }); + + /// The ID of the segment. + @JsonKey(name: r'segmentID') + final String segmentID; + + /// The date and time at which the segment will be re-ingested. + @JsonKey(name: r'deletedUntil') + final String deletedUntil; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is DeleteSegmentResponse && + other.segmentID == segmentID && + other.deletedUntil == deletedUntil; + + @override + int get hashCode => segmentID.hashCode + deletedUntil.hashCode; + + factory DeleteSegmentResponse.fromJson(Map json) => + _$DeleteSegmentResponseFromJson(json); + + Map toJson() => _$DeleteSegmentResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_segment_response.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_segment_response.g.dart new file mode 100644 index 0000000000..b565fe0d14 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_segment_response.g.dart @@ -0,0 +1,28 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'delete_segment_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +DeleteSegmentResponse _$DeleteSegmentResponseFromJson( + Map json) => + $checkedCreate( + 'DeleteSegmentResponse', + json, + ($checkedConvert) { + final val = DeleteSegmentResponse( + segmentID: $checkedConvert('segmentID', (v) => v as String), + deletedUntil: $checkedConvert('deletedUntil', (v) => v as String), + ); + return val; + }, + ); + +Map _$DeleteSegmentResponseToJson( + DeleteSegmentResponse instance) => + { + 'segmentID': instance.segmentID, + 'deletedUntil': instance.deletedUntil, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_user_profile_response.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_user_profile_response.dart new file mode 100644 index 0000000000..8f6be21789 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_user_profile_response.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'delete_user_profile_response.g.dart'; + +@JsonSerializable() +final class DeleteUserProfileResponse { + /// Returns a new [DeleteUserProfileResponse] instance. + const DeleteUserProfileResponse({ + required this.user, + required this.deletedUntil, + }); + + /// The ID of the user that was deleted. + @JsonKey(name: r'user') + final String user; + + /// The time the same user ID will be imported again when the data is ingested. + @JsonKey(name: r'deletedUntil') + final String deletedUntil; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is DeleteUserProfileResponse && + other.user == user && + other.deletedUntil == deletedUntil; + + @override + int get hashCode => user.hashCode + deletedUntil.hashCode; + + factory DeleteUserProfileResponse.fromJson(Map json) => + _$DeleteUserProfileResponseFromJson(json); + + Map toJson() => _$DeleteUserProfileResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_user_profile_response.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_user_profile_response.g.dart new file mode 100644 index 0000000000..d249fc6f4a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_user_profile_response.g.dart @@ -0,0 +1,28 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'delete_user_profile_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +DeleteUserProfileResponse _$DeleteUserProfileResponseFromJson( + Map json) => + $checkedCreate( + 'DeleteUserProfileResponse', + json, + ($checkedConvert) { + final val = DeleteUserProfileResponse( + user: $checkedConvert('user', (v) => v as String), + deletedUntil: $checkedConvert('deletedUntil', (v) => v as String), + ); + return val; + }, + ); + +Map _$DeleteUserProfileResponseToJson( + DeleteUserProfileResponse instance) => + { + 'user': instance.user, + 'deletedUntil': instance.deletedUntil, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error.dart new file mode 100644 index 0000000000..ef20fb3b01 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error.dart @@ -0,0 +1,33 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'error.g.dart'; + +@JsonSerializable() +final class Error { + /// Returns a new [Error] instance. + const Error({ + required this.error, + }); + + @JsonKey(name: r'error') + final String error; + + @override + bool operator ==(Object other) => + identical(this, other) || other is Error && other.error == error; + + @override + int get hashCode => error.hashCode; + + factory Error.fromJson(Map json) => _$ErrorFromJson(json); + + Map toJson() => _$ErrorToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error.g.dart new file mode 100644 index 0000000000..387138c249 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error.g.dart @@ -0,0 +1,22 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'error.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Error _$ErrorFromJson(Map json) => $checkedCreate( + 'Error', + json, + ($checkedConvert) { + final val = Error( + error: $checkedConvert('error', (v) => v as String), + ); + return val; + }, + ); + +Map _$ErrorToJson(Error instance) => { + 'error': instance.error, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error_base.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error_base.dart new file mode 100644 index 0000000000..df5d4ade57 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error_base.dart @@ -0,0 +1,47 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:collection/collection.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'error_base.g.dart'; + +@JsonSerializable(createFieldMap: true) +final class ErrorBase extends DelegatingMap { + /// Returns a new [ErrorBase] instance. + const ErrorBase({ + this.message, + Map additionalProperties = const {}, + }) : super(additionalProperties); + + @JsonKey(name: r'message') + final String? message; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ErrorBase && + other.message == message && + const MapEquality().equals(this, this); + + @override + int get hashCode => + message.hashCode + const MapEquality().hash(this); + + factory ErrorBase.fromJson(Map json) { + final instance = _$ErrorBaseFromJson(json); + final additionalProperties = Map.from(json) + ..removeWhere((key, value) => _$ErrorBaseFieldMap.containsKey(key)); + return ErrorBase( + message: instance.message, + additionalProperties: additionalProperties, + ); + } + + Map toJson() => _$ErrorBaseToJson(this)..addAll(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error_base.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error_base.g.dart new file mode 100644 index 0000000000..f796166fb2 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error_base.g.dart @@ -0,0 +1,35 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'error_base.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ErrorBase _$ErrorBaseFromJson(Map json) => $checkedCreate( + 'ErrorBase', + json, + ($checkedConvert) { + final val = ErrorBase( + message: $checkedConvert('message', (v) => v as String?), + ); + return val; + }, + ); + +const _$ErrorBaseFieldMap = { + 'message': 'message', +}; + +Map _$ErrorBaseToJson(ErrorBase instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('message', instance.message); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/fetch_all_user_profiles_response.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/fetch_all_user_profiles_response.dart new file mode 100644 index 0000000000..ef1ec994cc --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/fetch_all_user_profiles_response.dart @@ -0,0 +1,50 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/user_profile.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'fetch_all_user_profiles_response.g.dart'; + +@JsonSerializable() +final class FetchAllUserProfilesResponse { + /// Returns a new [FetchAllUserProfilesResponse] instance. + const FetchAllUserProfilesResponse({ + required this.users, + this.previousPageToken, + this.nextPageToken, + }); + + @JsonKey(name: r'users') + final List users; + + /// The token is used to navigate backward in the user list. To navigate from the current user list to the previous page, the API generates the previous page token and it sends the token in the response, beside the current user list. NOTE: This body param cannot be used with `nextPageToken` at the same time. + @JsonKey(name: r'previousPageToken') + final String? previousPageToken; + + /// The token is used to navigate forward in the user list. To navigate from the current user list to the next page, the API generates the next page token and it sends the token in the response, beside the current user list. NOTE: This body param cannot be used with `previousPageToken` at the same time. + @JsonKey(name: r'nextPageToken') + final String? nextPageToken; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FetchAllUserProfilesResponse && + other.users == users && + other.previousPageToken == previousPageToken && + other.nextPageToken == nextPageToken; + + @override + int get hashCode => + users.hashCode + previousPageToken.hashCode + nextPageToken.hashCode; + + factory FetchAllUserProfilesResponse.fromJson(Map json) => + _$FetchAllUserProfilesResponseFromJson(json); + + Map toJson() => _$FetchAllUserProfilesResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/fetch_all_user_profiles_response.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/fetch_all_user_profiles_response.g.dart new file mode 100644 index 0000000000..4907727c72 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/fetch_all_user_profiles_response.g.dart @@ -0,0 +1,44 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'fetch_all_user_profiles_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +FetchAllUserProfilesResponse _$FetchAllUserProfilesResponseFromJson( + Map json) => + $checkedCreate( + 'FetchAllUserProfilesResponse', + json, + ($checkedConvert) { + final val = FetchAllUserProfilesResponse( + users: $checkedConvert( + 'users', + (v) => (v as List) + .map((e) => UserProfile.fromJson(e as Map)) + .toList()), + previousPageToken: + $checkedConvert('previousPageToken', (v) => v as String?), + nextPageToken: $checkedConvert('nextPageToken', (v) => v as String?), + ); + return val; + }, + ); + +Map _$FetchAllUserProfilesResponseToJson( + FetchAllUserProfilesResponse instance) { + final val = { + 'users': instance.users.map((e) => e.toJson()).toList(), + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('previousPageToken', instance.previousPageToken); + writeNotNull('nextPageToken', instance.nextPageToken); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/funnel_stage.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/funnel_stage.dart new file mode 100644 index 0000000000..06e9d86524 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/funnel_stage.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'funnel_stage.g.dart'; + +@JsonSerializable() +final class FunnelStage { + /// Returns a new [FunnelStage] instance. + const FunnelStage({ + required this.name, + required this.probability, + }); + + @JsonKey(name: r'name') + final String name; + + // minimum: 0 + // maximum: 1 + @JsonKey(name: r'probability') + final double probability; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FunnelStage && + other.name == name && + other.probability == probability; + + @override + int get hashCode => name.hashCode + probability.hashCode; + + factory FunnelStage.fromJson(Map json) => + _$FunnelStageFromJson(json); + + Map toJson() => _$FunnelStageToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/funnel_stage.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/funnel_stage.g.dart new file mode 100644 index 0000000000..d5571fbc96 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/funnel_stage.g.dart @@ -0,0 +1,26 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'funnel_stage.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +FunnelStage _$FunnelStageFromJson(Map json) => $checkedCreate( + 'FunnelStage', + json, + ($checkedConvert) { + final val = FunnelStage( + name: $checkedConvert('name', (v) => v as String), + probability: + $checkedConvert('probability', (v) => (v as num).toDouble()), + ); + return val; + }, + ); + +Map _$FunnelStageToJson(FunnelStage instance) => + { + 'name': instance.name, + 'probability': instance.probability, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner.dart new file mode 100644 index 0000000000..8a77aadbf0 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner.dart @@ -0,0 +1,61 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/compatible_sources.dart'; +import 'package:algolia_client_predict/src/model/get_available_model_types_response_inner_data_requirements.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_available_model_types_response_inner.g.dart'; + +@JsonSerializable() +final class GetAvailableModelTypesResponseInner { + /// Returns a new [GetAvailableModelTypesResponseInner] instance. + const GetAvailableModelTypesResponseInner({ + required this.name, + required this.type, + required this.compatibleSources, + required this.dataRequirements, + }); + + /// Name of the model. + @JsonKey(name: r'name') + final String name; + + /// Description of the model. + @JsonKey(name: r'type') + final String type; + + @JsonKey(name: r'compatibleSources') + final List compatibleSources; + + @JsonKey(name: r'dataRequirements') + final GetAvailableModelTypesResponseInnerDataRequirements dataRequirements; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetAvailableModelTypesResponseInner && + other.name == name && + other.type == type && + other.compatibleSources == compatibleSources && + other.dataRequirements == dataRequirements; + + @override + int get hashCode => + name.hashCode + + type.hashCode + + compatibleSources.hashCode + + dataRequirements.hashCode; + + factory GetAvailableModelTypesResponseInner.fromJson( + Map json) => + _$GetAvailableModelTypesResponseInnerFromJson(json); + + Map toJson() => + _$GetAvailableModelTypesResponseInnerToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner.g.dart new file mode 100644 index 0000000000..1fe7bb6293 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner.g.dart @@ -0,0 +1,44 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_available_model_types_response_inner.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetAvailableModelTypesResponseInner + _$GetAvailableModelTypesResponseInnerFromJson(Map json) => + $checkedCreate( + 'GetAvailableModelTypesResponseInner', + json, + ($checkedConvert) { + final val = GetAvailableModelTypesResponseInner( + name: $checkedConvert('name', (v) => v as String), + type: $checkedConvert('type', (v) => v as String), + compatibleSources: $checkedConvert( + 'compatibleSources', + (v) => (v as List) + .map((e) => $enumDecode(_$CompatibleSourcesEnumMap, e)) + .toList()), + dataRequirements: $checkedConvert( + 'dataRequirements', + (v) => GetAvailableModelTypesResponseInnerDataRequirements + .fromJson(v as Map)), + ); + return val; + }, + ); + +Map _$GetAvailableModelTypesResponseInnerToJson( + GetAvailableModelTypesResponseInner instance) => + { + 'name': instance.name, + 'type': instance.type, + 'compatibleSources': + instance.compatibleSources.map((e) => e.toJson()).toList(), + 'dataRequirements': instance.dataRequirements.toJson(), + }; + +const _$CompatibleSourcesEnumMap = { + CompatibleSources.bigquery: 'bigquery', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner_data_requirements.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner_data_requirements.dart new file mode 100644 index 0000000000..f45f080cd0 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner_data_requirements.dart @@ -0,0 +1,45 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_available_model_types_response_inner_data_requirements.g.dart'; + +@JsonSerializable() +final class GetAvailableModelTypesResponseInnerDataRequirements { + /// Returns a new [GetAvailableModelTypesResponseInnerDataRequirements] instance. + const GetAvailableModelTypesResponseInnerDataRequirements({ + required this.minUsers, + required this.minDays, + }); + + /// Minimum number of users required for this model. + @JsonKey(name: r'minUsers') + final int minUsers; + + /// Minimum number of days model needs to run. + @JsonKey(name: r'minDays') + final int minDays; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetAvailableModelTypesResponseInnerDataRequirements && + other.minUsers == minUsers && + other.minDays == minDays; + + @override + int get hashCode => minUsers.hashCode + minDays.hashCode; + + factory GetAvailableModelTypesResponseInnerDataRequirements.fromJson( + Map json) => + _$GetAvailableModelTypesResponseInnerDataRequirementsFromJson(json); + + Map toJson() => + _$GetAvailableModelTypesResponseInnerDataRequirementsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner_data_requirements.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner_data_requirements.g.dart new file mode 100644 index 0000000000..7ef5195707 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner_data_requirements.g.dart @@ -0,0 +1,30 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_available_model_types_response_inner_data_requirements.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetAvailableModelTypesResponseInnerDataRequirements + _$GetAvailableModelTypesResponseInnerDataRequirementsFromJson( + Map json) => + $checkedCreate( + 'GetAvailableModelTypesResponseInnerDataRequirements', + json, + ($checkedConvert) { + final val = GetAvailableModelTypesResponseInnerDataRequirements( + minUsers: $checkedConvert('minUsers', (v) => v as int), + minDays: $checkedConvert('minDays', (v) => v as int), + ); + return val; + }, + ); + +Map + _$GetAvailableModelTypesResponseInnerDataRequirementsToJson( + GetAvailableModelTypesResponseInnerDataRequirements instance) => + { + 'minUsers': instance.minUsers, + 'minDays': instance.minDays, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_model_instance_config_status.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_model_instance_config_status.dart new file mode 100644 index 0000000000..ea8288d3fd --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_model_instance_config_status.dart @@ -0,0 +1,34 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// `pending` - model has just been created and the pipelines are being set up for the first train & inference. \\ `active` - model is running and generating predictions. \\ `invalid` - model has failed training (ex. can’t retrieve data from source). An additional `errorMessage` field will be set for this status. \\ `inactive` - model has been deactivated from the dashboard. Pipelines still exist but they are not currently running. +@JsonEnum(valueField: 'raw') +enum GetModelInstanceConfigStatus { + /// `pending` - model has just been created and the pipelines are being set up for the first train & inference. \\ `active` - model is running and generating predictions. \\ `invalid` - model has failed training (ex. can’t retrieve data from source). An additional `errorMessage` field will be set for this status. \\ `inactive` - model has been deactivated from the dashboard. Pipelines still exist but they are not currently running. + pending(r'pending'), + + /// `pending` - model has just been created and the pipelines are being set up for the first train & inference. \\ `active` - model is running and generating predictions. \\ `invalid` - model has failed training (ex. can’t retrieve data from source). An additional `errorMessage` field will be set for this status. \\ `inactive` - model has been deactivated from the dashboard. Pipelines still exist but they are not currently running. + active(r'active'), + + /// `pending` - model has just been created and the pipelines are being set up for the first train & inference. \\ `active` - model is running and generating predictions. \\ `invalid` - model has failed training (ex. can’t retrieve data from source). An additional `errorMessage` field will be set for this status. \\ `inactive` - model has been deactivated from the dashboard. Pipelines still exist but they are not currently running. + invalid(r'invalid'), + + /// `pending` - model has just been created and the pipelines are being set up for the first train & inference. \\ `active` - model is running and generating predictions. \\ `invalid` - model has failed training (ex. can’t retrieve data from source). An additional `errorMessage` field will be set for this status. \\ `inactive` - model has been deactivated from the dashboard. Pipelines still exist but they are not currently running. + inactive(r'inactive'); + + const GetModelInstanceConfigStatus(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static GetModelInstanceConfigStatus fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_model_metrics_response.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_model_metrics_response.dart new file mode 100644 index 0000000000..7a258a73aa --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_model_metrics_response.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/model_metrics.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_model_metrics_response.g.dart'; + +@JsonSerializable() +final class GetModelMetricsResponse { + /// Returns a new [GetModelMetricsResponse] instance. + const GetModelMetricsResponse({ + required this.modelID, + required this.metrics, + }); + + /// The ID of the model. + @JsonKey(name: r'modelID') + final String modelID; + + @JsonKey(name: r'metrics') + final List metrics; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetModelMetricsResponse && + other.modelID == modelID && + other.metrics == metrics; + + @override + int get hashCode => modelID.hashCode + metrics.hashCode; + + factory GetModelMetricsResponse.fromJson(Map json) => + _$GetModelMetricsResponseFromJson(json); + + Map toJson() => _$GetModelMetricsResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_model_metrics_response.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_model_metrics_response.g.dart new file mode 100644 index 0000000000..25b7af9ab3 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_model_metrics_response.g.dart @@ -0,0 +1,32 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_model_metrics_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetModelMetricsResponse _$GetModelMetricsResponseFromJson( + Map json) => + $checkedCreate( + 'GetModelMetricsResponse', + json, + ($checkedConvert) { + final val = GetModelMetricsResponse( + modelID: $checkedConvert('modelID', (v) => v as String), + metrics: $checkedConvert( + 'metrics', + (v) => (v as List) + .map((e) => ModelMetrics.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$GetModelMetricsResponseToJson( + GetModelMetricsResponse instance) => + { + 'modelID': instance.modelID, + 'metrics': instance.metrics.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_segment_users_response.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_segment_users_response.dart new file mode 100644 index 0000000000..5eef5f7c4d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_segment_users_response.dart @@ -0,0 +1,59 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/user_profile.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_segment_users_response.g.dart'; + +@JsonSerializable() +final class GetSegmentUsersResponse { + /// Returns a new [GetSegmentUsersResponse] instance. + const GetSegmentUsersResponse({ + required this.segmentID, + required this.users, + this.previousPageToken, + this.nextPageToken, + }); + + /// The ID of the segment. + @JsonKey(name: r'segmentID') + final String segmentID; + + @JsonKey(name: r'users') + final List users; + + /// The token is used to navigate backward in the user list. To navigate from the current user list to the previous page, the API generates the previous page token and it sends the token in the response, beside the current user list. NOTE: This body param cannot be used with `nextPageToken` at the same time. + @JsonKey(name: r'previousPageToken') + final String? previousPageToken; + + /// The token is used to navigate forward in the user list. To navigate from the current user list to the next page, the API generates the next page token and it sends the token in the response, beside the current user list. NOTE: This body param cannot be used with `previousPageToken` at the same time. + @JsonKey(name: r'nextPageToken') + final String? nextPageToken; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetSegmentUsersResponse && + other.segmentID == segmentID && + other.users == users && + other.previousPageToken == previousPageToken && + other.nextPageToken == nextPageToken; + + @override + int get hashCode => + segmentID.hashCode + + users.hashCode + + previousPageToken.hashCode + + nextPageToken.hashCode; + + factory GetSegmentUsersResponse.fromJson(Map json) => + _$GetSegmentUsersResponseFromJson(json); + + Map toJson() => _$GetSegmentUsersResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_segment_users_response.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_segment_users_response.g.dart new file mode 100644 index 0000000000..dc6d365feb --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_segment_users_response.g.dart @@ -0,0 +1,46 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_segment_users_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetSegmentUsersResponse _$GetSegmentUsersResponseFromJson( + Map json) => + $checkedCreate( + 'GetSegmentUsersResponse', + json, + ($checkedConvert) { + final val = GetSegmentUsersResponse( + segmentID: $checkedConvert('segmentID', (v) => v as String), + users: $checkedConvert( + 'users', + (v) => (v as List) + .map((e) => UserProfile.fromJson(e as Map)) + .toList()), + previousPageToken: + $checkedConvert('previousPageToken', (v) => v as String?), + nextPageToken: $checkedConvert('nextPageToken', (v) => v as String?), + ); + return val; + }, + ); + +Map _$GetSegmentUsersResponseToJson( + GetSegmentUsersResponse instance) { + final val = { + 'segmentID': instance.segmentID, + 'users': instance.users.map((e) => e.toJson()).toList(), + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('previousPageToken', instance.previousPageToken); + writeNotNull('nextPageToken', instance.nextPageToken); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/limit_param.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/limit_param.dart new file mode 100644 index 0000000000..023c4f633c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/limit_param.dart @@ -0,0 +1,34 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'limit_param.g.dart'; + +@JsonSerializable() +final class LimitParam { + /// Returns a new [LimitParam] instance. + const LimitParam({ + this.limit, + }); + + @JsonKey(name: r'limit') + final int? limit; + + @override + bool operator ==(Object other) => + identical(this, other) || other is LimitParam && other.limit == limit; + + @override + int get hashCode => limit.hashCode; + + factory LimitParam.fromJson(Map json) => + _$LimitParamFromJson(json); + + Map toJson() => _$LimitParamToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/limit_param.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/limit_param.g.dart new file mode 100644 index 0000000000..f96c9b93ee --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/limit_param.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'limit_param.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +LimitParam _$LimitParamFromJson(Map json) => $checkedCreate( + 'LimitParam', + json, + ($checkedConvert) { + final val = LimitParam( + limit: $checkedConvert('limit', (v) => v as int?), + ); + return val; + }, + ); + +Map _$LimitParamToJson(LimitParam instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('limit', instance.limit); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_attributes.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_attributes.dart new file mode 100644 index 0000000000..0683bca9d0 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_attributes.dart @@ -0,0 +1,39 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'model_attributes.g.dart'; + +@JsonSerializable() +final class ModelAttributes { + /// Returns a new [ModelAttributes] instance. + const ModelAttributes({ + required this.name, + this.values, + }); + + @JsonKey(name: r'name') + final String name; + + @JsonKey(name: r'values') + final List? values; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ModelAttributes && other.name == name && other.values == values; + + @override + int get hashCode => name.hashCode + values.hashCode; + + factory ModelAttributes.fromJson(Map json) => + _$ModelAttributesFromJson(json); + + Map toJson() => _$ModelAttributesToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_attributes.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_attributes.g.dart new file mode 100644 index 0000000000..9a4eff6d1a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_attributes.g.dart @@ -0,0 +1,36 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'model_attributes.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ModelAttributes _$ModelAttributesFromJson(Map json) => + $checkedCreate( + 'ModelAttributes', + json, + ($checkedConvert) { + final val = ModelAttributes( + name: $checkedConvert('name', (v) => v as String), + values: $checkedConvert('values', + (v) => (v as List?)?.map((e) => e as String).toList()), + ); + return val; + }, + ); + +Map _$ModelAttributesToJson(ModelAttributes instance) { + final val = { + 'name': instance.name, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('values', instance.values); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_instance.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_instance.dart new file mode 100644 index 0000000000..379b0d900e --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_instance.dart @@ -0,0 +1,98 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/models_to_retrieve.dart'; +import 'package:algolia_client_predict/src/model/get_model_instance_config_status.dart'; +import 'package:algolia_client_predict/src/model/model_attributes.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'model_instance.g.dart'; + +@JsonSerializable() +final class ModelInstance { + /// Returns a new [ModelInstance] instance. + const ModelInstance({ + required this.modelID, + required this.name, + required this.type, + required this.sourceID, + required this.index, + this.modelAttributes, + required this.lastTrained, + required this.lastInference, + this.errorMessage, + required this.modelStatus, + }); + + /// ID of the model. + @JsonKey(name: r'modelID') + final String modelID; + + /// Name of model instance. + @JsonKey(name: r'name') + final String name; + + @JsonKey(name: r'type') + final ModelsToRetrieve type; + + @JsonKey(name: r'sourceID') + final String sourceID; + + @JsonKey(name: r'index') + final String index; + + @JsonKey(name: r'modelAttributes') + final List? modelAttributes; + + /// The date and time this model instance was last trained. + @JsonKey(name: r'lastTrained') + final String lastTrained; + + /// The date and time this model instance generated its last inference. + @JsonKey(name: r'lastInference') + final String lastInference; + + @JsonKey(name: r'errorMessage') + final String? errorMessage; + + @JsonKey(name: r'modelStatus') + final GetModelInstanceConfigStatus modelStatus; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ModelInstance && + other.modelID == modelID && + other.name == name && + other.type == type && + other.sourceID == sourceID && + other.index == index && + other.modelAttributes == modelAttributes && + other.lastTrained == lastTrained && + other.lastInference == lastInference && + other.errorMessage == errorMessage && + other.modelStatus == modelStatus; + + @override + int get hashCode => + modelID.hashCode + + name.hashCode + + type.hashCode + + sourceID.hashCode + + index.hashCode + + modelAttributes.hashCode + + lastTrained.hashCode + + lastInference.hashCode + + errorMessage.hashCode + + modelStatus.hashCode; + + factory ModelInstance.fromJson(Map json) => + _$ModelInstanceFromJson(json); + + Map toJson() => _$ModelInstanceToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_instance.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_instance.g.dart new file mode 100644 index 0000000000..da56a5eeea --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_instance.g.dart @@ -0,0 +1,72 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'model_instance.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ModelInstance _$ModelInstanceFromJson(Map json) => + $checkedCreate( + 'ModelInstance', + json, + ($checkedConvert) { + final val = ModelInstance( + modelID: $checkedConvert('modelID', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + type: $checkedConvert( + 'type', (v) => $enumDecode(_$ModelsToRetrieveEnumMap, v)), + sourceID: $checkedConvert('sourceID', (v) => v as String), + index: $checkedConvert('index', (v) => v as String), + modelAttributes: $checkedConvert( + 'modelAttributes', + (v) => (v as List?) + ?.map((e) => + ModelAttributes.fromJson(e as Map)) + .toList()), + lastTrained: $checkedConvert('lastTrained', (v) => v as String), + lastInference: $checkedConvert('lastInference', (v) => v as String), + errorMessage: $checkedConvert('errorMessage', (v) => v as String?), + modelStatus: $checkedConvert('modelStatus', + (v) => $enumDecode(_$GetModelInstanceConfigStatusEnumMap, v)), + ); + return val; + }, + ); + +Map _$ModelInstanceToJson(ModelInstance instance) { + final val = { + 'modelID': instance.modelID, + 'name': instance.name, + 'type': instance.type.toJson(), + 'sourceID': instance.sourceID, + 'index': instance.index, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('modelAttributes', + instance.modelAttributes?.map((e) => e.toJson()).toList()); + val['lastTrained'] = instance.lastTrained; + val['lastInference'] = instance.lastInference; + writeNotNull('errorMessage', instance.errorMessage); + val['modelStatus'] = instance.modelStatus.toJson(); + return val; +} + +const _$ModelsToRetrieveEnumMap = { + ModelsToRetrieve.funnelStage: 'funnel_stage', + ModelsToRetrieve.orderValue: 'order_value', + ModelsToRetrieve.affinities: 'affinities', +}; + +const _$GetModelInstanceConfigStatusEnumMap = { + GetModelInstanceConfigStatus.pending: 'pending', + GetModelInstanceConfigStatus.active: 'active', + GetModelInstanceConfigStatus.invalid: 'invalid', + GetModelInstanceConfigStatus.inactive: 'inactive', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_metrics.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_metrics.dart new file mode 100644 index 0000000000..f85610686b --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_metrics.dart @@ -0,0 +1,68 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'model_metrics.g.dart'; + +@JsonSerializable() +final class ModelMetrics { + /// Returns a new [ModelMetrics] instance. + const ModelMetrics({ + this.precision, + this.recall, + this.mrr, + this.coverage, + this.f1Score, + this.updatedAt, + }); + + @JsonKey(name: r'precision') + final double? precision; + + @JsonKey(name: r'recall') + final double? recall; + + @JsonKey(name: r'mrr') + final double? mrr; + + @JsonKey(name: r'coverage') + final double? coverage; + + @JsonKey(name: r'f1_score') + final double? f1Score; + + /// Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. + @JsonKey(name: r'updatedAt') + final String? updatedAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ModelMetrics && + other.precision == precision && + other.recall == recall && + other.mrr == mrr && + other.coverage == coverage && + other.f1Score == f1Score && + other.updatedAt == updatedAt; + + @override + int get hashCode => + precision.hashCode + + recall.hashCode + + mrr.hashCode + + coverage.hashCode + + f1Score.hashCode + + updatedAt.hashCode; + + factory ModelMetrics.fromJson(Map json) => + _$ModelMetricsFromJson(json); + + Map toJson() => _$ModelMetricsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_metrics.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_metrics.g.dart new file mode 100644 index 0000000000..0b4a4aa879 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_metrics.g.dart @@ -0,0 +1,44 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'model_metrics.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ModelMetrics _$ModelMetricsFromJson(Map json) => + $checkedCreate( + 'ModelMetrics', + json, + ($checkedConvert) { + final val = ModelMetrics( + precision: + $checkedConvert('precision', (v) => (v as num?)?.toDouble()), + recall: $checkedConvert('recall', (v) => (v as num?)?.toDouble()), + mrr: $checkedConvert('mrr', (v) => (v as num?)?.toDouble()), + coverage: $checkedConvert('coverage', (v) => (v as num?)?.toDouble()), + f1Score: $checkedConvert('f1_score', (v) => (v as num?)?.toDouble()), + updatedAt: $checkedConvert('updatedAt', (v) => v as String?), + ); + return val; + }, + fieldKeyMap: const {'f1Score': 'f1_score'}, + ); + +Map _$ModelMetricsToJson(ModelMetrics instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('precision', instance.precision); + writeNotNull('recall', instance.recall); + writeNotNull('mrr', instance.mrr); + writeNotNull('coverage', instance.coverage); + writeNotNull('f1_score', instance.f1Score); + writeNotNull('updatedAt', instance.updatedAt); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_status.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_status.dart new file mode 100644 index 0000000000..2aa5eb5546 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_status.dart @@ -0,0 +1,28 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// `active` - model is running and generating predictions. The active value is allowed only if the current status of the model is `inactive`. \\ `inactive` - model training and inference have been paused. The inactive value is allowed only if the current status of the model is `active`. +@JsonEnum(valueField: 'raw') +enum ModelStatus { + /// `active` - model is running and generating predictions. The active value is allowed only if the current status of the model is `inactive`. \\ `inactive` - model training and inference have been paused. The inactive value is allowed only if the current status of the model is `active`. + active(r'active'), + + /// `active` - model is running and generating predictions. The active value is allowed only if the current status of the model is `inactive`. \\ `inactive` - model training and inference have been paused. The inactive value is allowed only if the current status of the model is `active`. + inactive(r'inactive'); + + const ModelStatus(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static ModelStatus fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/models_to_retrieve.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/models_to_retrieve.dart new file mode 100644 index 0000000000..1aac709db7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/models_to_retrieve.dart @@ -0,0 +1,25 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum ModelsToRetrieve { + funnelStage(r'funnel_stage'), + orderValue(r'order_value'), + affinities(r'affinities'); + + const ModelsToRetrieve(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static ModelsToRetrieve fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/models_to_retrieve_param.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/models_to_retrieve_param.dart new file mode 100644 index 0000000000..3f20707aff --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/models_to_retrieve_param.dart @@ -0,0 +1,37 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/models_to_retrieve.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'models_to_retrieve_param.g.dart'; + +@JsonSerializable() +final class ModelsToRetrieveParam { + /// Returns a new [ModelsToRetrieveParam] instance. + const ModelsToRetrieveParam({ + this.modelsToRetrieve, + }); + + @JsonKey(name: r'modelsToRetrieve') + final List? modelsToRetrieve; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ModelsToRetrieveParam && + other.modelsToRetrieve == modelsToRetrieve; + + @override + int get hashCode => modelsToRetrieve.hashCode; + + factory ModelsToRetrieveParam.fromJson(Map json) => + _$ModelsToRetrieveParamFromJson(json); + + Map toJson() => _$ModelsToRetrieveParamToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/models_to_retrieve_param.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/models_to_retrieve_param.g.dart new file mode 100644 index 0000000000..9a41772444 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/models_to_retrieve_param.g.dart @@ -0,0 +1,45 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'models_to_retrieve_param.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ModelsToRetrieveParam _$ModelsToRetrieveParamFromJson( + Map json) => + $checkedCreate( + 'ModelsToRetrieveParam', + json, + ($checkedConvert) { + final val = ModelsToRetrieveParam( + modelsToRetrieve: $checkedConvert( + 'modelsToRetrieve', + (v) => (v as List?) + ?.map((e) => $enumDecode(_$ModelsToRetrieveEnumMap, e)) + .toList()), + ); + return val; + }, + ); + +Map _$ModelsToRetrieveParamToJson( + ModelsToRetrieveParam instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('modelsToRetrieve', + instance.modelsToRetrieve?.map((e) => e.toJson()).toList()); + return val; +} + +const _$ModelsToRetrieveEnumMap = { + ModelsToRetrieve.funnelStage: 'funnel_stage', + ModelsToRetrieve.orderValue: 'order_value', + ModelsToRetrieve.affinities: 'affinities', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/next_page_token_param.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/next_page_token_param.dart new file mode 100644 index 0000000000..e312c72961 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/next_page_token_param.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'next_page_token_param.g.dart'; + +@JsonSerializable() +final class NextPageTokenParam { + /// Returns a new [NextPageTokenParam] instance. + const NextPageTokenParam({ + this.nextPageToken, + }); + + /// The token is used to navigate forward in the user list. To navigate from the current user list to the next page, the API generates the next page token and it sends the token in the response, beside the current user list. NOTE: This body param cannot be used with `previousPageToken` at the same time. + @JsonKey(name: r'nextPageToken') + final String? nextPageToken; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NextPageTokenParam && other.nextPageToken == nextPageToken; + + @override + int get hashCode => nextPageToken.hashCode; + + factory NextPageTokenParam.fromJson(Map json) => + _$NextPageTokenParamFromJson(json); + + Map toJson() => _$NextPageTokenParamToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/next_page_token_param.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/next_page_token_param.g.dart new file mode 100644 index 0000000000..2eb9206dbe --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/next_page_token_param.g.dart @@ -0,0 +1,32 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'next_page_token_param.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +NextPageTokenParam _$NextPageTokenParamFromJson(Map json) => + $checkedCreate( + 'NextPageTokenParam', + json, + ($checkedConvert) { + final val = NextPageTokenParam( + nextPageToken: $checkedConvert('nextPageToken', (v) => v as String?), + ); + return val; + }, + ); + +Map _$NextPageTokenParamToJson(NextPageTokenParam instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('nextPageToken', instance.nextPageToken); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions.dart new file mode 100644 index 0000000000..e47e0019ec --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions.dart @@ -0,0 +1,56 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'predictions.g.dart'; + +@JsonSerializable() +final class Predictions { + /// Returns a new [Predictions] instance. + const Predictions({ + this.funnelStage, + this.orderValue, + this.affinities, + }); + + /// One of types: + /// - [PredictionsFunnelStageSuccess] + /// - [Error] + @JsonKey(name: r'funnel_stage') + final dynamic funnelStage; + + /// One of types: + /// - [PredictionsOrderValueSuccess] + /// - [Error] + @JsonKey(name: r'order_value') + final dynamic orderValue; + + /// One of types: + /// - [PredictionsAffinitiesSuccess] + /// - [Error] + @JsonKey(name: r'affinities') + final dynamic affinities; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Predictions && + other.funnelStage == funnelStage && + other.orderValue == orderValue && + other.affinities == affinities; + + @override + int get hashCode => + funnelStage.hashCode + orderValue.hashCode + affinities.hashCode; + + factory Predictions.fromJson(Map json) => + _$PredictionsFromJson(json); + + Map toJson() => _$PredictionsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions.g.dart new file mode 100644 index 0000000000..9246f154f3 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions.g.dart @@ -0,0 +1,39 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'predictions.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Predictions _$PredictionsFromJson(Map json) => $checkedCreate( + 'Predictions', + json, + ($checkedConvert) { + final val = Predictions( + funnelStage: $checkedConvert('funnel_stage', (v) => v), + orderValue: $checkedConvert('order_value', (v) => v), + affinities: $checkedConvert('affinities', (v) => v), + ); + return val; + }, + fieldKeyMap: const { + 'funnelStage': 'funnel_stage', + 'orderValue': 'order_value' + }, + ); + +Map _$PredictionsToJson(Predictions instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('funnel_stage', instance.funnelStage); + writeNotNull('order_value', instance.orderValue); + writeNotNull('affinities', instance.affinities); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_affinities_success.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_affinities_success.dart new file mode 100644 index 0000000000..31b905007f --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_affinities_success.dart @@ -0,0 +1,42 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/affinity.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'predictions_affinities_success.g.dart'; + +@JsonSerializable() +final class PredictionsAffinitiesSuccess { + /// Returns a new [PredictionsAffinitiesSuccess] instance. + const PredictionsAffinitiesSuccess({ + required this.value, + required this.lastUpdatedAt, + }); + + @JsonKey(name: r'value') + final List value; + + @JsonKey(name: r'lastUpdatedAt') + final String lastUpdatedAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PredictionsAffinitiesSuccess && + other.value == value && + other.lastUpdatedAt == lastUpdatedAt; + + @override + int get hashCode => value.hashCode + lastUpdatedAt.hashCode; + + factory PredictionsAffinitiesSuccess.fromJson(Map json) => + _$PredictionsAffinitiesSuccessFromJson(json); + + Map toJson() => _$PredictionsAffinitiesSuccessToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_affinities_success.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_affinities_success.g.dart new file mode 100644 index 0000000000..8cb7a9307a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_affinities_success.g.dart @@ -0,0 +1,32 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'predictions_affinities_success.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PredictionsAffinitiesSuccess _$PredictionsAffinitiesSuccessFromJson( + Map json) => + $checkedCreate( + 'PredictionsAffinitiesSuccess', + json, + ($checkedConvert) { + final val = PredictionsAffinitiesSuccess( + value: $checkedConvert( + 'value', + (v) => (v as List) + .map((e) => Affinity.fromJson(e as Map)) + .toList()), + lastUpdatedAt: $checkedConvert('lastUpdatedAt', (v) => v as String), + ); + return val; + }, + ); + +Map _$PredictionsAffinitiesSuccessToJson( + PredictionsAffinitiesSuccess instance) => + { + 'value': instance.value.map((e) => e.toJson()).toList(), + 'lastUpdatedAt': instance.lastUpdatedAt, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_funnel_stage_success.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_funnel_stage_success.dart new file mode 100644 index 0000000000..5231a34945 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_funnel_stage_success.dart @@ -0,0 +1,42 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/funnel_stage.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'predictions_funnel_stage_success.g.dart'; + +@JsonSerializable() +final class PredictionsFunnelStageSuccess { + /// Returns a new [PredictionsFunnelStageSuccess] instance. + const PredictionsFunnelStageSuccess({ + required this.value, + required this.lastUpdatedAt, + }); + + @JsonKey(name: r'value') + final List value; + + @JsonKey(name: r'lastUpdatedAt') + final String lastUpdatedAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PredictionsFunnelStageSuccess && + other.value == value && + other.lastUpdatedAt == lastUpdatedAt; + + @override + int get hashCode => value.hashCode + lastUpdatedAt.hashCode; + + factory PredictionsFunnelStageSuccess.fromJson(Map json) => + _$PredictionsFunnelStageSuccessFromJson(json); + + Map toJson() => _$PredictionsFunnelStageSuccessToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_funnel_stage_success.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_funnel_stage_success.g.dart new file mode 100644 index 0000000000..7db53c8e02 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_funnel_stage_success.g.dart @@ -0,0 +1,32 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'predictions_funnel_stage_success.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PredictionsFunnelStageSuccess _$PredictionsFunnelStageSuccessFromJson( + Map json) => + $checkedCreate( + 'PredictionsFunnelStageSuccess', + json, + ($checkedConvert) { + final val = PredictionsFunnelStageSuccess( + value: $checkedConvert( + 'value', + (v) => (v as List) + .map((e) => FunnelStage.fromJson(e as Map)) + .toList()), + lastUpdatedAt: $checkedConvert('lastUpdatedAt', (v) => v as String), + ); + return val; + }, + ); + +Map _$PredictionsFunnelStageSuccessToJson( + PredictionsFunnelStageSuccess instance) => + { + 'value': instance.value.map((e) => e.toJson()).toList(), + 'lastUpdatedAt': instance.lastUpdatedAt, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_order_value_success.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_order_value_success.dart new file mode 100644 index 0000000000..29e9779ff9 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_order_value_success.dart @@ -0,0 +1,42 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'predictions_order_value_success.g.dart'; + +@JsonSerializable() +final class PredictionsOrderValueSuccess { + /// Returns a new [PredictionsOrderValueSuccess] instance. + const PredictionsOrderValueSuccess({ + required this.value, + required this.lastUpdatedAt, + }); + + // minimum: 0 + @JsonKey(name: r'value') + final double value; + + @JsonKey(name: r'lastUpdatedAt') + final String lastUpdatedAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PredictionsOrderValueSuccess && + other.value == value && + other.lastUpdatedAt == lastUpdatedAt; + + @override + int get hashCode => value.hashCode + lastUpdatedAt.hashCode; + + factory PredictionsOrderValueSuccess.fromJson(Map json) => + _$PredictionsOrderValueSuccessFromJson(json); + + Map toJson() => _$PredictionsOrderValueSuccessToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_order_value_success.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_order_value_success.g.dart new file mode 100644 index 0000000000..1456551da5 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_order_value_success.g.dart @@ -0,0 +1,28 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'predictions_order_value_success.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PredictionsOrderValueSuccess _$PredictionsOrderValueSuccessFromJson( + Map json) => + $checkedCreate( + 'PredictionsOrderValueSuccess', + json, + ($checkedConvert) { + final val = PredictionsOrderValueSuccess( + value: $checkedConvert('value', (v) => (v as num).toDouble()), + lastUpdatedAt: $checkedConvert('lastUpdatedAt', (v) => v as String), + ); + return val; + }, + ); + +Map _$PredictionsOrderValueSuccessToJson( + PredictionsOrderValueSuccess instance) => + { + 'value': instance.value, + 'lastUpdatedAt': instance.lastUpdatedAt, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/previous_page_token_param.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/previous_page_token_param.dart new file mode 100644 index 0000000000..6fd90b0c5a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/previous_page_token_param.dart @@ -0,0 +1,37 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'previous_page_token_param.g.dart'; + +@JsonSerializable() +final class PreviousPageTokenParam { + /// Returns a new [PreviousPageTokenParam] instance. + const PreviousPageTokenParam({ + this.previousPageToken, + }); + + /// The token is used to navigate backward in the user list. To navigate from the current user list to the previous page, the API generates the previous page token and it sends the token in the response, beside the current user list. NOTE: This body param cannot be used with `nextPageToken` at the same time. + @JsonKey(name: r'previousPageToken') + final String? previousPageToken; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PreviousPageTokenParam && + other.previousPageToken == previousPageToken; + + @override + int get hashCode => previousPageToken.hashCode; + + factory PreviousPageTokenParam.fromJson(Map json) => + _$PreviousPageTokenParamFromJson(json); + + Map toJson() => _$PreviousPageTokenParamToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/previous_page_token_param.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/previous_page_token_param.g.dart new file mode 100644 index 0000000000..9d8db1519c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/previous_page_token_param.g.dart @@ -0,0 +1,35 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'previous_page_token_param.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PreviousPageTokenParam _$PreviousPageTokenParamFromJson( + Map json) => + $checkedCreate( + 'PreviousPageTokenParam', + json, + ($checkedConvert) { + final val = PreviousPageTokenParam( + previousPageToken: + $checkedConvert('previousPageToken', (v) => v as String?), + ); + return val; + }, + ); + +Map _$PreviousPageTokenParamToJson( + PreviousPageTokenParam instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('previousPageToken', instance.previousPageToken); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/properties.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/properties.dart new file mode 100644 index 0000000000..496e9384c0 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/properties.dart @@ -0,0 +1,49 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'properties.g.dart'; + +@JsonSerializable() +final class Properties { + /// Returns a new [Properties] instance. + const Properties({ + this.raw, + this.computed, + this.custom, + }); + + /// Raw user properties (key-value pairs). + @JsonKey(name: r'raw') + final Object? raw; + + /// Computed user properties (key-value pairs). + @JsonKey(name: r'computed') + final Object? computed; + + /// Custom user properties (key-value pairs). + @JsonKey(name: r'custom') + final Object? custom; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Properties && + other.raw == raw && + other.computed == computed && + other.custom == custom; + + @override + int get hashCode => raw.hashCode + computed.hashCode + custom.hashCode; + + factory Properties.fromJson(Map json) => + _$PropertiesFromJson(json); + + Map toJson() => _$PropertiesToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/properties.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/properties.g.dart new file mode 100644 index 0000000000..5b42d39523 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/properties.g.dart @@ -0,0 +1,35 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'properties.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Properties _$PropertiesFromJson(Map json) => $checkedCreate( + 'Properties', + json, + ($checkedConvert) { + final val = Properties( + raw: $checkedConvert('raw', (v) => v), + computed: $checkedConvert('computed', (v) => v), + custom: $checkedConvert('custom', (v) => v), + ); + return val; + }, + ); + +Map _$PropertiesToJson(Properties instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('raw', instance.raw); + writeNotNull('computed', instance.computed); + writeNotNull('custom', instance.custom); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment.dart new file mode 100644 index 0000000000..eee6c462b3 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment.dart @@ -0,0 +1,86 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/segment_status.dart'; +import 'package:algolia_client_predict/src/model/segment_parent_conditions.dart'; +import 'package:algolia_client_predict/src/model/segment_type.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'segment.g.dart'; + +@JsonSerializable() +final class Segment { + /// Returns a new [Segment] instance. + const Segment({ + required this.segmentID, + required this.name, + required this.conditions, + required this.size, + required this.segmentStatus, + required this.type, + required this.lastUpdatedAt, + this.errorMessage, + }); + + /// The ID of the segment. + @JsonKey(name: r'segmentID') + final String segmentID; + + /// The name of the segment. + @JsonKey(name: r'name') + final String name; + + @JsonKey(name: r'conditions') + final SegmentParentConditions conditions; + + /// The approximate number of users that matched the segment conditions when it was created, last updated, or when model inference last ran. + @JsonKey(name: r'size') + final num size; + + @JsonKey(name: r'segmentStatus') + final SegmentStatus segmentStatus; + + @JsonKey(name: r'type') + final SegmentType type; + + /// The date and time at which the segment was last updated (RFC3339). + @JsonKey(name: r'lastUpdatedAt') + final String lastUpdatedAt; + + @JsonKey(name: r'errorMessage') + final String? errorMessage; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Segment && + other.segmentID == segmentID && + other.name == name && + other.conditions == conditions && + other.size == size && + other.segmentStatus == segmentStatus && + other.type == type && + other.lastUpdatedAt == lastUpdatedAt && + other.errorMessage == errorMessage; + + @override + int get hashCode => + segmentID.hashCode + + name.hashCode + + conditions.hashCode + + size.hashCode + + segmentStatus.hashCode + + type.hashCode + + lastUpdatedAt.hashCode + + errorMessage.hashCode; + + factory Segment.fromJson(Map json) => + _$SegmentFromJson(json); + + Map toJson() => _$SegmentToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment.g.dart new file mode 100644 index 0000000000..795f07c6a6 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment.g.dart @@ -0,0 +1,62 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'segment.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Segment _$SegmentFromJson(Map json) => $checkedCreate( + 'Segment', + json, + ($checkedConvert) { + final val = Segment( + segmentID: $checkedConvert('segmentID', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + conditions: $checkedConvert( + 'conditions', + (v) => + SegmentParentConditions.fromJson(v as Map)), + size: $checkedConvert('size', (v) => v as num), + segmentStatus: $checkedConvert( + 'segmentStatus', (v) => $enumDecode(_$SegmentStatusEnumMap, v)), + type: $checkedConvert( + 'type', (v) => $enumDecode(_$SegmentTypeEnumMap, v)), + lastUpdatedAt: $checkedConvert('lastUpdatedAt', (v) => v as String), + errorMessage: $checkedConvert('errorMessage', (v) => v as String?), + ); + return val; + }, + ); + +Map _$SegmentToJson(Segment instance) { + final val = { + 'segmentID': instance.segmentID, + 'name': instance.name, + 'conditions': instance.conditions.toJson(), + 'size': instance.size, + 'segmentStatus': instance.segmentStatus.toJson(), + 'type': instance.type.toJson(), + 'lastUpdatedAt': instance.lastUpdatedAt, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('errorMessage', instance.errorMessage); + return val; +} + +const _$SegmentStatusEnumMap = { + SegmentStatus.active: 'active', + SegmentStatus.pending: 'pending', + SegmentStatus.failed: 'failed', +}; + +const _$SegmentTypeEnumMap = { + SegmentType.computed: 'computed', + SegmentType.custom: 'custom', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_affinity_filter.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_affinity_filter.dart new file mode 100644 index 0000000000..df2049d048 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_affinity_filter.dart @@ -0,0 +1,53 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/segment_filter_operator_numerical.dart'; +import 'package:algolia_client_predict/src/model/segment_filter_probability.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'segment_affinity_filter.g.dart'; + +@JsonSerializable() +final class SegmentAffinityFilter { + /// Returns a new [SegmentAffinityFilter] instance. + const SegmentAffinityFilter({ + required this.operator, + required this.value, + this.probability, + }); + + @JsonKey(name: r'operator') + final SegmentFilterOperatorNumerical operator; + + /// One of types: + /// - [bool] + /// - [double] + /// - [String] + /// - [List] + @JsonKey(name: r'value') + final dynamic value; + + @JsonKey(name: r'probability') + final SegmentFilterProbability? probability; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SegmentAffinityFilter && + other.operator == operator && + other.value == value && + other.probability == probability; + + @override + int get hashCode => operator.hashCode + value.hashCode + probability.hashCode; + + factory SegmentAffinityFilter.fromJson(Map json) => + _$SegmentAffinityFilterFromJson(json); + + Map toJson() => _$SegmentAffinityFilterToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_affinity_filter.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_affinity_filter.g.dart new file mode 100644 index 0000000000..03c2078f53 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_affinity_filter.g.dart @@ -0,0 +1,54 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'segment_affinity_filter.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SegmentAffinityFilter _$SegmentAffinityFilterFromJson( + Map json) => + $checkedCreate( + 'SegmentAffinityFilter', + json, + ($checkedConvert) { + final val = SegmentAffinityFilter( + operator: $checkedConvert('operator', + (v) => $enumDecode(_$SegmentFilterOperatorNumericalEnumMap, v)), + value: $checkedConvert('value', (v) => v), + probability: $checkedConvert( + 'probability', + (v) => v == null + ? null + : SegmentFilterProbability.fromJson( + v as Map)), + ); + return val; + }, + ); + +Map _$SegmentAffinityFilterToJson( + SegmentAffinityFilter instance) { + final val = { + 'operator': instance.operator.toJson(), + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('value', instance.value); + writeNotNull('probability', instance.probability?.toJson()); + return val; +} + +const _$SegmentFilterOperatorNumericalEnumMap = { + SegmentFilterOperatorNumerical.eq: 'EQ', + SegmentFilterOperatorNumerical.neq: 'NEQ', + SegmentFilterOperatorNumerical.gt: 'GT', + SegmentFilterOperatorNumerical.gte: 'GTE', + SegmentFilterOperatorNumerical.lt: 'LT', + SegmentFilterOperatorNumerical.lte: 'LTE', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_child_conditions.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_child_conditions.dart new file mode 100644 index 0000000000..918ef3579e --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_child_conditions.dart @@ -0,0 +1,47 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/segment_condition_operator.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'segment_child_conditions.g.dart'; + +@JsonSerializable() +final class SegmentChildConditions { + /// Returns a new [SegmentChildConditions] instance. + const SegmentChildConditions({ + required this.operator, + required this.operands, + }); + + @JsonKey(name: r'operator') + final SegmentConditionOperator operator; + + /// One of types: + /// - [SegmentOperandAffinity] + /// - [SegmentOperandFunnelStage] + /// - [SegmentOperandOrderValue] + /// - [SegmentOperandProperty] + @JsonKey(name: r'operands') + final Iterable operands; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SegmentChildConditions && + other.operator == operator && + other.operands == operands; + + @override + int get hashCode => operator.hashCode + operands.hashCode; + + factory SegmentChildConditions.fromJson(Map json) => + _$SegmentChildConditionsFromJson(json); + + Map toJson() => _$SegmentChildConditionsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_child_conditions.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_child_conditions.g.dart new file mode 100644 index 0000000000..6dff48a97e --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_child_conditions.g.dart @@ -0,0 +1,34 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'segment_child_conditions.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SegmentChildConditions _$SegmentChildConditionsFromJson( + Map json) => + $checkedCreate( + 'SegmentChildConditions', + json, + ($checkedConvert) { + final val = SegmentChildConditions( + operator: $checkedConvert('operator', + (v) => $enumDecode(_$SegmentConditionOperatorEnumMap, v)), + operands: $checkedConvert('operands', (v) => v as List), + ); + return val; + }, + ); + +Map _$SegmentChildConditionsToJson( + SegmentChildConditions instance) => + { + 'operator': instance.operator.toJson(), + 'operands': instance.operands.toList(), + }; + +const _$SegmentConditionOperatorEnumMap = { + SegmentConditionOperator.and: 'AND', + SegmentConditionOperator.or: 'OR', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_condition_operator.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_condition_operator.dart new file mode 100644 index 0000000000..5ab0f0e5d3 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_condition_operator.dart @@ -0,0 +1,28 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Operator used to combine the operands. +@JsonEnum(valueField: 'raw') +enum SegmentConditionOperator { + /// Operator used to combine the operands. + and(r'AND'), + + /// Operator used to combine the operands. + or(r'OR'); + + const SegmentConditionOperator(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static SegmentConditionOperator fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_conditions_param.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_conditions_param.dart new file mode 100644 index 0000000000..d043672394 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_conditions_param.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/segment_parent_conditions.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'segment_conditions_param.g.dart'; + +@JsonSerializable() +final class SegmentConditionsParam { + /// Returns a new [SegmentConditionsParam] instance. + const SegmentConditionsParam({ + this.conditions, + }); + + @JsonKey(name: r'conditions') + final SegmentParentConditions? conditions; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SegmentConditionsParam && other.conditions == conditions; + + @override + int get hashCode => conditions.hashCode; + + factory SegmentConditionsParam.fromJson(Map json) => + _$SegmentConditionsParamFromJson(json); + + Map toJson() => _$SegmentConditionsParamToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_conditions_param.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_conditions_param.g.dart new file mode 100644 index 0000000000..c206446498 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_conditions_param.g.dart @@ -0,0 +1,39 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'segment_conditions_param.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SegmentConditionsParam _$SegmentConditionsParamFromJson( + Map json) => + $checkedCreate( + 'SegmentConditionsParam', + json, + ($checkedConvert) { + final val = SegmentConditionsParam( + conditions: $checkedConvert( + 'conditions', + (v) => v == null + ? null + : SegmentParentConditions.fromJson( + v as Map)), + ); + return val; + }, + ); + +Map _$SegmentConditionsParamToJson( + SegmentConditionsParam instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('conditions', instance.conditions?.toJson()); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_operator_boolean.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_operator_boolean.dart new file mode 100644 index 0000000000..b395f6d388 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_operator_boolean.dart @@ -0,0 +1,28 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// The operator used on the boolean filter value. +@JsonEnum(valueField: 'raw') +enum SegmentFilterOperatorBoolean { + /// The operator used on the boolean filter value. + eq(r'EQ'), + + /// The operator used on the boolean filter value. + neq(r'NEQ'); + + const SegmentFilterOperatorBoolean(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static SegmentFilterOperatorBoolean fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_operator_numerical.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_operator_numerical.dart new file mode 100644 index 0000000000..2ef51870e9 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_operator_numerical.dart @@ -0,0 +1,40 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// The operator used on the numerical filter value. +@JsonEnum(valueField: 'raw') +enum SegmentFilterOperatorNumerical { + /// The operator used on the numerical filter value. + eq(r'EQ'), + + /// The operator used on the numerical filter value. + neq(r'NEQ'), + + /// The operator used on the numerical filter value. + gt(r'GT'), + + /// The operator used on the numerical filter value. + gte(r'GTE'), + + /// The operator used on the numerical filter value. + lt(r'LT'), + + /// The operator used on the numerical filter value. + lte(r'LTE'); + + const SegmentFilterOperatorNumerical(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static SegmentFilterOperatorNumerical fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_probability.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_probability.dart new file mode 100644 index 0000000000..10e08070d8 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_probability.dart @@ -0,0 +1,51 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'segment_filter_probability.g.dart'; + +@JsonSerializable() +final class SegmentFilterProbability { + /// Returns a new [SegmentFilterProbability] instance. + const SegmentFilterProbability({ + this.lt, + this.lte, + this.gt, + this.gte, + }); + + @JsonKey(name: r'LT') + final num? lt; + + @JsonKey(name: r'LTE') + final num? lte; + + @JsonKey(name: r'GT') + final num? gt; + + @JsonKey(name: r'GTE') + final num? gte; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SegmentFilterProbability && + other.lt == lt && + other.lte == lte && + other.gt == gt && + other.gte == gte; + + @override + int get hashCode => lt.hashCode + lte.hashCode + gt.hashCode + gte.hashCode; + + factory SegmentFilterProbability.fromJson(Map json) => + _$SegmentFilterProbabilityFromJson(json); + + Map toJson() => _$SegmentFilterProbabilityToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_probability.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_probability.g.dart new file mode 100644 index 0000000000..bbe005f2d5 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_probability.g.dart @@ -0,0 +1,41 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'segment_filter_probability.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SegmentFilterProbability _$SegmentFilterProbabilityFromJson( + Map json) => + $checkedCreate( + 'SegmentFilterProbability', + json, + ($checkedConvert) { + final val = SegmentFilterProbability( + lt: $checkedConvert('LT', (v) => v as num?), + lte: $checkedConvert('LTE', (v) => v as num?), + gt: $checkedConvert('GT', (v) => v as num?), + gte: $checkedConvert('GTE', (v) => v as num?), + ); + return val; + }, + fieldKeyMap: const {'lt': 'LT', 'lte': 'LTE', 'gt': 'GT', 'gte': 'GTE'}, + ); + +Map _$SegmentFilterProbabilityToJson( + SegmentFilterProbability instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('LT', instance.lt); + writeNotNull('LTE', instance.lte); + writeNotNull('GT', instance.gt); + writeNotNull('GTE', instance.gte); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_funnel_stage_filter.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_funnel_stage_filter.dart new file mode 100644 index 0000000000..ed5660889e --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_funnel_stage_filter.dart @@ -0,0 +1,48 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/segment_filter_operator_boolean.dart'; +import 'package:algolia_client_predict/src/model/segment_filter_probability.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'segment_funnel_stage_filter.g.dart'; + +@JsonSerializable() +final class SegmentFunnelStageFilter { + /// Returns a new [SegmentFunnelStageFilter] instance. + const SegmentFunnelStageFilter({ + this.operator, + required this.value, + required this.probability, + }); + + @JsonKey(name: r'operator') + final SegmentFilterOperatorBoolean? operator; + + @JsonKey(name: r'value') + final String value; + + @JsonKey(name: r'probability') + final SegmentFilterProbability probability; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SegmentFunnelStageFilter && + other.operator == operator && + other.value == value && + other.probability == probability; + + @override + int get hashCode => operator.hashCode + value.hashCode + probability.hashCode; + + factory SegmentFunnelStageFilter.fromJson(Map json) => + _$SegmentFunnelStageFilterFromJson(json); + + Map toJson() => _$SegmentFunnelStageFilterToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_funnel_stage_filter.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_funnel_stage_filter.g.dart new file mode 100644 index 0000000000..a99f4ba47a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_funnel_stage_filter.g.dart @@ -0,0 +1,49 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'segment_funnel_stage_filter.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SegmentFunnelStageFilter _$SegmentFunnelStageFilterFromJson( + Map json) => + $checkedCreate( + 'SegmentFunnelStageFilter', + json, + ($checkedConvert) { + final val = SegmentFunnelStageFilter( + operator: $checkedConvert( + 'operator', + (v) => $enumDecodeNullable( + _$SegmentFilterOperatorBooleanEnumMap, v)), + value: $checkedConvert('value', (v) => v as String), + probability: $checkedConvert( + 'probability', + (v) => + SegmentFilterProbability.fromJson(v as Map)), + ); + return val; + }, + ); + +Map _$SegmentFunnelStageFilterToJson( + SegmentFunnelStageFilter instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('operator', instance.operator?.toJson()); + val['value'] = instance.value; + val['probability'] = instance.probability.toJson(); + return val; +} + +const _$SegmentFilterOperatorBooleanEnumMap = { + SegmentFilterOperatorBoolean.eq: 'EQ', + SegmentFilterOperatorBoolean.neq: 'NEQ', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_name_param.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_name_param.dart new file mode 100644 index 0000000000..5f4d417074 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_name_param.dart @@ -0,0 +1,35 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'segment_name_param.g.dart'; + +@JsonSerializable() +final class SegmentNameParam { + /// Returns a new [SegmentNameParam] instance. + const SegmentNameParam({ + this.name, + }); + + /// The name or description of the segment. + @JsonKey(name: r'name') + final String? name; + + @override + bool operator ==(Object other) => + identical(this, other) || other is SegmentNameParam && other.name == name; + + @override + int get hashCode => name.hashCode; + + factory SegmentNameParam.fromJson(Map json) => + _$SegmentNameParamFromJson(json); + + Map toJson() => _$SegmentNameParamToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_name_param.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_name_param.g.dart new file mode 100644 index 0000000000..6c2d1fef21 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_name_param.g.dart @@ -0,0 +1,32 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'segment_name_param.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SegmentNameParam _$SegmentNameParamFromJson(Map json) => + $checkedCreate( + 'SegmentNameParam', + json, + ($checkedConvert) { + final val = SegmentNameParam( + name: $checkedConvert('name', (v) => v as String?), + ); + return val; + }, + ); + +Map _$SegmentNameParamToJson(SegmentNameParam instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('name', instance.name); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_affinity.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_affinity.dart new file mode 100644 index 0000000000..8ffa24f71f --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_affinity.dart @@ -0,0 +1,42 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/segment_affinity_filter.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'segment_operand_affinity.g.dart'; + +@JsonSerializable() +final class SegmentOperandAffinity { + /// Returns a new [SegmentOperandAffinity] instance. + const SegmentOperandAffinity({ + required this.name, + required this.filters, + }); + + @JsonKey(name: r'name') + final String name; + + @JsonKey(name: r'filters') + final List filters; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SegmentOperandAffinity && + other.name == name && + other.filters == filters; + + @override + int get hashCode => name.hashCode + filters.hashCode; + + factory SegmentOperandAffinity.fromJson(Map json) => + _$SegmentOperandAffinityFromJson(json); + + Map toJson() => _$SegmentOperandAffinityToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_affinity.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_affinity.g.dart new file mode 100644 index 0000000000..b8b4eea1ed --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_affinity.g.dart @@ -0,0 +1,33 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'segment_operand_affinity.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SegmentOperandAffinity _$SegmentOperandAffinityFromJson( + Map json) => + $checkedCreate( + 'SegmentOperandAffinity', + json, + ($checkedConvert) { + final val = SegmentOperandAffinity( + name: $checkedConvert('name', (v) => v as String), + filters: $checkedConvert( + 'filters', + (v) => (v as List) + .map((e) => + SegmentAffinityFilter.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$SegmentOperandAffinityToJson( + SegmentOperandAffinity instance) => + { + 'name': instance.name, + 'filters': instance.filters.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_funnel_stage.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_funnel_stage.dart new file mode 100644 index 0000000000..f2ffc81a70 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_funnel_stage.dart @@ -0,0 +1,42 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/segment_funnel_stage_filter.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'segment_operand_funnel_stage.g.dart'; + +@JsonSerializable() +final class SegmentOperandFunnelStage { + /// Returns a new [SegmentOperandFunnelStage] instance. + const SegmentOperandFunnelStage({ + required this.name, + required this.filters, + }); + + @JsonKey(name: r'name') + final String name; + + @JsonKey(name: r'filters') + final List filters; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SegmentOperandFunnelStage && + other.name == name && + other.filters == filters; + + @override + int get hashCode => name.hashCode + filters.hashCode; + + factory SegmentOperandFunnelStage.fromJson(Map json) => + _$SegmentOperandFunnelStageFromJson(json); + + Map toJson() => _$SegmentOperandFunnelStageToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_funnel_stage.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_funnel_stage.g.dart new file mode 100644 index 0000000000..55ea824a0f --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_funnel_stage.g.dart @@ -0,0 +1,33 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'segment_operand_funnel_stage.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SegmentOperandFunnelStage _$SegmentOperandFunnelStageFromJson( + Map json) => + $checkedCreate( + 'SegmentOperandFunnelStage', + json, + ($checkedConvert) { + final val = SegmentOperandFunnelStage( + name: $checkedConvert('name', (v) => v as String), + filters: $checkedConvert( + 'filters', + (v) => (v as List) + .map((e) => SegmentFunnelStageFilter.fromJson( + e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$SegmentOperandFunnelStageToJson( + SegmentOperandFunnelStage instance) => + { + 'name': instance.name, + 'filters': instance.filters.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_order_value.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_order_value.dart new file mode 100644 index 0000000000..c5cad8b92e --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_order_value.dart @@ -0,0 +1,42 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/segment_order_value_filter.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'segment_operand_order_value.g.dart'; + +@JsonSerializable() +final class SegmentOperandOrderValue { + /// Returns a new [SegmentOperandOrderValue] instance. + const SegmentOperandOrderValue({ + required this.name, + required this.filters, + }); + + @JsonKey(name: r'name') + final String name; + + @JsonKey(name: r'filters') + final List filters; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SegmentOperandOrderValue && + other.name == name && + other.filters == filters; + + @override + int get hashCode => name.hashCode + filters.hashCode; + + factory SegmentOperandOrderValue.fromJson(Map json) => + _$SegmentOperandOrderValueFromJson(json); + + Map toJson() => _$SegmentOperandOrderValueToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_order_value.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_order_value.g.dart new file mode 100644 index 0000000000..8dcd00e672 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_order_value.g.dart @@ -0,0 +1,33 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'segment_operand_order_value.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SegmentOperandOrderValue _$SegmentOperandOrderValueFromJson( + Map json) => + $checkedCreate( + 'SegmentOperandOrderValue', + json, + ($checkedConvert) { + final val = SegmentOperandOrderValue( + name: $checkedConvert('name', (v) => v as String), + filters: $checkedConvert( + 'filters', + (v) => (v as List) + .map((e) => SegmentOrderValueFilter.fromJson( + e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$SegmentOperandOrderValueToJson( + SegmentOperandOrderValue instance) => + { + 'name': instance.name, + 'filters': instance.filters.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_property.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_property.dart new file mode 100644 index 0000000000..cacab6b2c5 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_property.dart @@ -0,0 +1,42 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/segment_property_filter.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'segment_operand_property.g.dart'; + +@JsonSerializable() +final class SegmentOperandProperty { + /// Returns a new [SegmentOperandProperty] instance. + const SegmentOperandProperty({ + required this.name, + required this.filters, + }); + + @JsonKey(name: r'name') + final String name; + + @JsonKey(name: r'filters') + final List filters; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SegmentOperandProperty && + other.name == name && + other.filters == filters; + + @override + int get hashCode => name.hashCode + filters.hashCode; + + factory SegmentOperandProperty.fromJson(Map json) => + _$SegmentOperandPropertyFromJson(json); + + Map toJson() => _$SegmentOperandPropertyToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_property.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_property.g.dart new file mode 100644 index 0000000000..febd1d4b7b --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_property.g.dart @@ -0,0 +1,33 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'segment_operand_property.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SegmentOperandProperty _$SegmentOperandPropertyFromJson( + Map json) => + $checkedCreate( + 'SegmentOperandProperty', + json, + ($checkedConvert) { + final val = SegmentOperandProperty( + name: $checkedConvert('name', (v) => v as String), + filters: $checkedConvert( + 'filters', + (v) => (v as List) + .map((e) => + SegmentPropertyFilter.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$SegmentOperandPropertyToJson( + SegmentOperandProperty instance) => + { + 'name': instance.name, + 'filters': instance.filters.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_order_value_filter.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_order_value_filter.dart new file mode 100644 index 0000000000..103b9ef99e --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_order_value_filter.dart @@ -0,0 +1,42 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/segment_filter_operator_numerical.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'segment_order_value_filter.g.dart'; + +@JsonSerializable() +final class SegmentOrderValueFilter { + /// Returns a new [SegmentOrderValueFilter] instance. + const SegmentOrderValueFilter({ + this.operator, + required this.value, + }); + + @JsonKey(name: r'operator') + final SegmentFilterOperatorNumerical? operator; + + @JsonKey(name: r'value') + final num value; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SegmentOrderValueFilter && + other.operator == operator && + other.value == value; + + @override + int get hashCode => operator.hashCode + value.hashCode; + + factory SegmentOrderValueFilter.fromJson(Map json) => + _$SegmentOrderValueFilterFromJson(json); + + Map toJson() => _$SegmentOrderValueFilterToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_order_value_filter.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_order_value_filter.g.dart new file mode 100644 index 0000000000..967404dcd7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_order_value_filter.g.dart @@ -0,0 +1,48 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'segment_order_value_filter.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SegmentOrderValueFilter _$SegmentOrderValueFilterFromJson( + Map json) => + $checkedCreate( + 'SegmentOrderValueFilter', + json, + ($checkedConvert) { + final val = SegmentOrderValueFilter( + operator: $checkedConvert( + 'operator', + (v) => $enumDecodeNullable( + _$SegmentFilterOperatorNumericalEnumMap, v)), + value: $checkedConvert('value', (v) => v as num), + ); + return val; + }, + ); + +Map _$SegmentOrderValueFilterToJson( + SegmentOrderValueFilter instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('operator', instance.operator?.toJson()); + val['value'] = instance.value; + return val; +} + +const _$SegmentFilterOperatorNumericalEnumMap = { + SegmentFilterOperatorNumerical.eq: 'EQ', + SegmentFilterOperatorNumerical.neq: 'NEQ', + SegmentFilterOperatorNumerical.gt: 'GT', + SegmentFilterOperatorNumerical.gte: 'GTE', + SegmentFilterOperatorNumerical.lt: 'LT', + SegmentFilterOperatorNumerical.lte: 'LTE', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_parent_conditions.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_parent_conditions.dart new file mode 100644 index 0000000000..97432ae0a8 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_parent_conditions.dart @@ -0,0 +1,48 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/segment_condition_operator.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'segment_parent_conditions.g.dart'; + +@JsonSerializable() +final class SegmentParentConditions { + /// Returns a new [SegmentParentConditions] instance. + const SegmentParentConditions({ + required this.operator, + required this.operands, + }); + + @JsonKey(name: r'operator') + final SegmentConditionOperator operator; + + /// One of types: + /// - [SegmentOperandAffinity] + /// - [SegmentChildConditions] + /// - [SegmentOperandFunnelStage] + /// - [SegmentOperandOrderValue] + /// - [SegmentOperandProperty] + @JsonKey(name: r'operands') + final Iterable operands; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SegmentParentConditions && + other.operator == operator && + other.operands == operands; + + @override + int get hashCode => operator.hashCode + operands.hashCode; + + factory SegmentParentConditions.fromJson(Map json) => + _$SegmentParentConditionsFromJson(json); + + Map toJson() => _$SegmentParentConditionsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_parent_conditions.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_parent_conditions.g.dart new file mode 100644 index 0000000000..93adee6593 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_parent_conditions.g.dart @@ -0,0 +1,34 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'segment_parent_conditions.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SegmentParentConditions _$SegmentParentConditionsFromJson( + Map json) => + $checkedCreate( + 'SegmentParentConditions', + json, + ($checkedConvert) { + final val = SegmentParentConditions( + operator: $checkedConvert('operator', + (v) => $enumDecode(_$SegmentConditionOperatorEnumMap, v)), + operands: $checkedConvert('operands', (v) => v as List), + ); + return val; + }, + ); + +Map _$SegmentParentConditionsToJson( + SegmentParentConditions instance) => + { + 'operator': instance.operator.toJson(), + 'operands': instance.operands.toList(), + }; + +const _$SegmentConditionOperatorEnumMap = { + SegmentConditionOperator.and: 'AND', + SegmentConditionOperator.or: 'OR', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_property_filter.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_property_filter.dart new file mode 100644 index 0000000000..4d72c1da61 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_property_filter.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/segment_filter_operator_numerical.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'segment_property_filter.g.dart'; + +@JsonSerializable() +final class SegmentPropertyFilter { + /// Returns a new [SegmentPropertyFilter] instance. + const SegmentPropertyFilter({ + this.operator, + required this.value, + }); + + @JsonKey(name: r'operator') + final SegmentFilterOperatorNumerical? operator; + + /// One of types: + @JsonKey(name: r'value') + final dynamic value; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SegmentPropertyFilter && + other.operator == operator && + other.value == value; + + @override + int get hashCode => operator.hashCode + value.hashCode; + + factory SegmentPropertyFilter.fromJson(Map json) => + _$SegmentPropertyFilterFromJson(json); + + Map toJson() => _$SegmentPropertyFilterToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_property_filter.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_property_filter.g.dart new file mode 100644 index 0000000000..3607c246cf --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_property_filter.g.dart @@ -0,0 +1,48 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'segment_property_filter.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SegmentPropertyFilter _$SegmentPropertyFilterFromJson( + Map json) => + $checkedCreate( + 'SegmentPropertyFilter', + json, + ($checkedConvert) { + final val = SegmentPropertyFilter( + operator: $checkedConvert( + 'operator', + (v) => $enumDecodeNullable( + _$SegmentFilterOperatorNumericalEnumMap, v)), + value: $checkedConvert('value', (v) => v), + ); + return val; + }, + ); + +Map _$SegmentPropertyFilterToJson( + SegmentPropertyFilter instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('operator', instance.operator?.toJson()); + writeNotNull('value', instance.value); + return val; +} + +const _$SegmentFilterOperatorNumericalEnumMap = { + SegmentFilterOperatorNumerical.eq: 'EQ', + SegmentFilterOperatorNumerical.neq: 'NEQ', + SegmentFilterOperatorNumerical.gt: 'GT', + SegmentFilterOperatorNumerical.gte: 'GTE', + SegmentFilterOperatorNumerical.lt: 'LT', + SegmentFilterOperatorNumerical.lte: 'LTE', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_status.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_status.dart new file mode 100644 index 0000000000..f5ecaa8600 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_status.dart @@ -0,0 +1,31 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// The status of the segment. +@JsonEnum(valueField: 'raw') +enum SegmentStatus { + /// The status of the segment. + active(r'active'), + + /// The status of the segment. + pending(r'pending'), + + /// The status of the segment. + failed(r'failed'); + + const SegmentStatus(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static SegmentStatus fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_type.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_type.dart new file mode 100644 index 0000000000..31df7352b4 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_type.dart @@ -0,0 +1,28 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// The type of the segment. +@JsonEnum(valueField: 'raw') +enum SegmentType { + /// The type of the segment. + computed(r'computed'), + + /// The type of the segment. + custom(r'custom'); + + const SegmentType(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static SegmentType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segments.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segments.dart new file mode 100644 index 0000000000..3e4673bacc --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segments.dart @@ -0,0 +1,41 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'segments.g.dart'; + +@JsonSerializable() +final class Segments { + /// Returns a new [Segments] instance. + const Segments({ + required this.computed, + required this.custom, + }); + + /// List of computed segments IDs. + @JsonKey(name: r'computed') + final List computed; + + /// List of custom segments IDs. + @JsonKey(name: r'custom') + final List custom; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Segments && other.computed == computed && other.custom == custom; + + @override + int get hashCode => computed.hashCode + custom.hashCode; + + factory Segments.fromJson(Map json) => + _$SegmentsFromJson(json); + + Map toJson() => _$SegmentsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segments.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segments.g.dart new file mode 100644 index 0000000000..285cd96c8e --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segments.g.dart @@ -0,0 +1,26 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'segments.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Segments _$SegmentsFromJson(Map json) => $checkedCreate( + 'Segments', + json, + ($checkedConvert) { + final val = Segments( + computed: $checkedConvert('computed', + (v) => (v as List).map((e) => e as String).toList()), + custom: $checkedConvert('custom', + (v) => (v as List).map((e) => e as String).toList()), + ); + return val; + }, + ); + +Map _$SegmentsToJson(Segments instance) => { + 'computed': instance.computed, + 'custom': instance.custom, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/types_to_retrieve.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/types_to_retrieve.dart new file mode 100644 index 0000000000..44da965fd0 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/types_to_retrieve.dart @@ -0,0 +1,24 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum TypesToRetrieve { + properties(r'properties'), + segments(r'segments'); + + const TypesToRetrieve(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static TypesToRetrieve fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/types_to_retrieve_param.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/types_to_retrieve_param.dart new file mode 100644 index 0000000000..3fe350a5a6 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/types_to_retrieve_param.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/types_to_retrieve.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'types_to_retrieve_param.g.dart'; + +@JsonSerializable() +final class TypesToRetrieveParam { + /// Returns a new [TypesToRetrieveParam] instance. + const TypesToRetrieveParam({ + this.typesToRetrieve, + }); + + @JsonKey(name: r'typesToRetrieve') + final List? typesToRetrieve; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TypesToRetrieveParam && other.typesToRetrieve == typesToRetrieve; + + @override + int get hashCode => typesToRetrieve.hashCode; + + factory TypesToRetrieveParam.fromJson(Map json) => + _$TypesToRetrieveParamFromJson(json); + + Map toJson() => _$TypesToRetrieveParamToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/types_to_retrieve_param.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/types_to_retrieve_param.g.dart new file mode 100644 index 0000000000..65059bf7fa --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/types_to_retrieve_param.g.dart @@ -0,0 +1,44 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'types_to_retrieve_param.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TypesToRetrieveParam _$TypesToRetrieveParamFromJson( + Map json) => + $checkedCreate( + 'TypesToRetrieveParam', + json, + ($checkedConvert) { + final val = TypesToRetrieveParam( + typesToRetrieve: $checkedConvert( + 'typesToRetrieve', + (v) => (v as List?) + ?.map((e) => $enumDecode(_$TypesToRetrieveEnumMap, e)) + .toList()), + ); + return val; + }, + ); + +Map _$TypesToRetrieveParamToJson( + TypesToRetrieveParam instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('typesToRetrieve', + instance.typesToRetrieve?.map((e) => e.toJson()).toList()); + return val; +} + +const _$TypesToRetrieveEnumMap = { + TypesToRetrieve.properties: 'properties', + TypesToRetrieve.segments: 'segments', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_instance_response.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_instance_response.dart new file mode 100644 index 0000000000..3ea7e91bc0 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_instance_response.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'update_model_instance_response.g.dart'; + +@JsonSerializable() +final class UpdateModelInstanceResponse { + /// Returns a new [UpdateModelInstanceResponse] instance. + const UpdateModelInstanceResponse({ + required this.modelID, + required this.updatedAt, + }); + + /// The ID of the model. + @JsonKey(name: r'modelID') + final String modelID; + + /// Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. + @JsonKey(name: r'updatedAt') + final String updatedAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is UpdateModelInstanceResponse && + other.modelID == modelID && + other.updatedAt == updatedAt; + + @override + int get hashCode => modelID.hashCode + updatedAt.hashCode; + + factory UpdateModelInstanceResponse.fromJson(Map json) => + _$UpdateModelInstanceResponseFromJson(json); + + Map toJson() => _$UpdateModelInstanceResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_instance_response.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_instance_response.g.dart new file mode 100644 index 0000000000..4b901de910 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_instance_response.g.dart @@ -0,0 +1,28 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'update_model_instance_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +UpdateModelInstanceResponse _$UpdateModelInstanceResponseFromJson( + Map json) => + $checkedCreate( + 'UpdateModelInstanceResponse', + json, + ($checkedConvert) { + final val = UpdateModelInstanceResponse( + modelID: $checkedConvert('modelID', (v) => v as String), + updatedAt: $checkedConvert('updatedAt', (v) => v as String), + ); + return val; + }, + ); + +Map _$UpdateModelInstanceResponseToJson( + UpdateModelInstanceResponse instance) => + { + 'modelID': instance.modelID, + 'updatedAt': instance.updatedAt, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_params.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_params.dart new file mode 100644 index 0000000000..6ef3a69e44 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_params.dart @@ -0,0 +1,49 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/model_status.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'update_model_params.g.dart'; + +@JsonSerializable() +final class UpdateModelParams { + /// Returns a new [UpdateModelParams] instance. + const UpdateModelParams({ + this.name, + this.modelAttributes, + this.modelStatus, + }); + + /// The model’s instance name. + @JsonKey(name: r'name') + final String? name; + + @JsonKey(name: r'modelAttributes') + final List? modelAttributes; + + @JsonKey(name: r'modelStatus') + final ModelStatus? modelStatus; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is UpdateModelParams && + other.name == name && + other.modelAttributes == modelAttributes && + other.modelStatus == modelStatus; + + @override + int get hashCode => + name.hashCode + modelAttributes.hashCode + modelStatus.hashCode; + + factory UpdateModelParams.fromJson(Map json) => + _$UpdateModelParamsFromJson(json); + + Map toJson() => _$UpdateModelParamsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_params.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_params.g.dart new file mode 100644 index 0000000000..67052d61b7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_params.g.dart @@ -0,0 +1,43 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'update_model_params.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +UpdateModelParams _$UpdateModelParamsFromJson(Map json) => + $checkedCreate( + 'UpdateModelParams', + json, + ($checkedConvert) { + final val = UpdateModelParams( + name: $checkedConvert('name', (v) => v as String?), + modelAttributes: $checkedConvert('modelAttributes', + (v) => (v as List?)?.map((e) => e as String).toList()), + modelStatus: $checkedConvert('modelStatus', + (v) => $enumDecodeNullable(_$ModelStatusEnumMap, v)), + ); + return val; + }, + ); + +Map _$UpdateModelParamsToJson(UpdateModelParams instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('name', instance.name); + writeNotNull('modelAttributes', instance.modelAttributes); + writeNotNull('modelStatus', instance.modelStatus?.toJson()); + return val; +} + +const _$ModelStatusEnumMap = { + ModelStatus.active: 'active', + ModelStatus.inactive: 'inactive', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_segment_response.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_segment_response.dart new file mode 100644 index 0000000000..f4ef6bbf11 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_segment_response.dart @@ -0,0 +1,49 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'update_segment_response.g.dart'; + +@JsonSerializable() +final class UpdateSegmentResponse { + /// Returns a new [UpdateSegmentResponse] instance. + const UpdateSegmentResponse({ + required this.segmentID, + this.size, + required this.updatedAt, + }); + + /// The ID of the segment. + @JsonKey(name: r'segmentID') + final String segmentID; + + /// The approximate number of users that matched the segment conditions when it was created, last updated, or when model inference last ran. + @JsonKey(name: r'size') + final num? size; + + /// The date and time at which the segment was updated (RFC3339). + @JsonKey(name: r'updatedAt') + final String updatedAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is UpdateSegmentResponse && + other.segmentID == segmentID && + other.size == size && + other.updatedAt == updatedAt; + + @override + int get hashCode => segmentID.hashCode + size.hashCode + updatedAt.hashCode; + + factory UpdateSegmentResponse.fromJson(Map json) => + _$UpdateSegmentResponseFromJson(json); + + Map toJson() => _$UpdateSegmentResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_segment_response.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_segment_response.g.dart new file mode 100644 index 0000000000..8efc88cf45 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_segment_response.g.dart @@ -0,0 +1,39 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'update_segment_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +UpdateSegmentResponse _$UpdateSegmentResponseFromJson( + Map json) => + $checkedCreate( + 'UpdateSegmentResponse', + json, + ($checkedConvert) { + final val = UpdateSegmentResponse( + segmentID: $checkedConvert('segmentID', (v) => v as String), + size: $checkedConvert('size', (v) => v as num?), + updatedAt: $checkedConvert('updatedAt', (v) => v as String), + ); + return val; + }, + ); + +Map _$UpdateSegmentResponseToJson( + UpdateSegmentResponse instance) { + final val = { + 'segmentID': instance.segmentID, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('size', instance.size); + val['updatedAt'] = instance.updatedAt; + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/user_profile.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/user_profile.dart new file mode 100644 index 0000000000..191265d957 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/user_profile.dart @@ -0,0 +1,58 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_predict/src/model/predictions.dart'; +import 'package:algolia_client_predict/src/model/properties.dart'; +import 'package:algolia_client_predict/src/model/segments.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'user_profile.g.dart'; + +@JsonSerializable() +final class UserProfile { + /// Returns a new [UserProfile] instance. + const UserProfile({ + required this.user, + this.predictions, + this.properties, + this.segments, + }); + + @JsonKey(name: r'user') + final String user; + + @JsonKey(name: r'predictions') + final Predictions? predictions; + + @JsonKey(name: r'properties') + final Properties? properties; + + @JsonKey(name: r'segments') + final Segments? segments; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is UserProfile && + other.user == user && + other.predictions == predictions && + other.properties == properties && + other.segments == segments; + + @override + int get hashCode => + user.hashCode + + predictions.hashCode + + properties.hashCode + + segments.hashCode; + + factory UserProfile.fromJson(Map json) => + _$UserProfileFromJson(json); + + Map toJson() => _$UserProfileToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/user_profile.g.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/user_profile.g.dart new file mode 100644 index 0000000000..d7c52a50a6 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/user_profile.g.dart @@ -0,0 +1,50 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'user_profile.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +UserProfile _$UserProfileFromJson(Map json) => $checkedCreate( + 'UserProfile', + json, + ($checkedConvert) { + final val = UserProfile( + user: $checkedConvert('user', (v) => v as String), + predictions: $checkedConvert( + 'predictions', + (v) => v == null + ? null + : Predictions.fromJson(v as Map)), + properties: $checkedConvert( + 'properties', + (v) => v == null + ? null + : Properties.fromJson(v as Map)), + segments: $checkedConvert( + 'segments', + (v) => v == null + ? null + : Segments.fromJson(v as Map)), + ); + return val; + }, + ); + +Map _$UserProfileToJson(UserProfile instance) { + final val = { + 'user': instance.user, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('predictions', instance.predictions?.toJson()); + writeNotNull('properties', instance.properties?.toJson()); + writeNotNull('segments', instance.segments?.toJson()); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/version.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/version.dart new file mode 100644 index 0000000000..03e065a0a8 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/version.dart @@ -0,0 +1,2 @@ +/// Current package version +const packageVersion = '0.1.2'; diff --git a/clients/algoliasearch-client-dart/packages/client_predict/pubspec.yaml b/clients/algoliasearch-client-dart/packages/client_predict/pubspec.yaml new file mode 100644 index 0000000000..d47693e6fe --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_predict/pubspec.yaml @@ -0,0 +1,24 @@ +name: algolia_client_predict +version: 0.1.2 +description: A sub-package of the AlgoliaSearch library, offering predict-specific functionalities for enhanced search and discovery in Dart/Flutter apps. +homepage: https://www.algolia.com/doc/ +repository: https://github.com/algolia/algoliasearch-client-dart/tree/main/packages/client_predict +topics: + - search + - discovery + +environment: + sdk: '>=3.0.0 <4.0.0' + +dependencies: + # Pinning versions until the API stabilizes. + algolia_client_core: 0.1.1+4 + json_annotation: ^4.8.1 + collection: ^1.17.1 + +dev_dependencies: + build_runner: ^2.4.4 + json_serializable: ^6.7.0 + lints: ^2.1.1 + logging: ^1.2.0 + test: ^1.24.3 diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/build.yaml b/clients/algoliasearch-client-dart/packages/client_query_suggestions/build.yaml new file mode 100644 index 0000000000..6d71b406a7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/build.yaml @@ -0,0 +1,14 @@ +targets: + $default: + builders: + json_serializable: + options: + any_map: false + checked: true + create_factory: true + create_to_json: true + disallow_unrecognized_keys: false + explicit_to_json: true + field_rename: none + ignore_unannotated: false + include_if_null: false diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/algolia_client_query_suggestions.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/algolia_client_query_suggestions.dart new file mode 100644 index 0000000000..5726ba13f9 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/algolia_client_query_suggestions.dart @@ -0,0 +1,21 @@ +// A sub-package of the AlgoliaSearch library, offering query suggestions-specific functionalities for enhanced search and discovery in Dart/Flutter apps. +library algolia_client_query_suggestions; + +export 'package:algolia_client_core/algolia_client_core.dart'; + +export 'src/api/query_suggestions_client.dart'; + +export 'src/model/base_response.dart'; +export 'src/model/error_base.dart'; +export 'src/model/facet.dart'; +export 'src/model/get_config_status200_response.dart'; +export 'src/model/get_log_file200_response.dart'; +export 'src/model/log_level.dart'; +export 'src/model/query_suggestions_configuration.dart'; +export 'src/model/query_suggestions_configuration_response.dart'; +export 'src/model/query_suggestions_configuration_response_all_of.dart'; +export 'src/model/query_suggestions_configuration_with_index.dart'; +export 'src/model/query_suggestions_configuration_with_index_all_of.dart'; +export 'src/model/source_index.dart'; + +export 'src/extension.dart'; diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/api/query_suggestions_client.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/api/query_suggestions_client.dart new file mode 100644 index 0000000000..a0d36a98f5 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/api/query_suggestions_client.dart @@ -0,0 +1,402 @@ +// 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. + +import 'package:algolia_client_core/algolia_client_core.dart'; +import 'package:algolia_client_query_suggestions/src/deserialize.dart'; +import 'package:algolia_client_query_suggestions/src/version.dart'; + +import 'package:algolia_client_query_suggestions/src/model/base_response.dart'; +import 'package:algolia_client_query_suggestions/src/model/get_config_status200_response.dart'; +import 'package:algolia_client_query_suggestions/src/model/get_log_file200_response.dart'; +import 'package:algolia_client_query_suggestions/src/model/query_suggestions_configuration.dart'; +import 'package:algolia_client_query_suggestions/src/model/query_suggestions_configuration_response.dart'; +import 'package:algolia_client_query_suggestions/src/model/query_suggestions_configuration_with_index.dart'; + +final class QuerySuggestionsClient implements ApiClient { + @override + final String apiKey; + + @override + final String appId; + + @override + final ClientOptions options; + + final String region; + + final RetryStrategy _retryStrategy; + + QuerySuggestionsClient({ + required this.appId, + required this.apiKey, + this.options = const ClientOptions(), + required this.region, + }) : _retryStrategy = RetryStrategy.create( + segment: AgentSegment( + value: "QuerySuggestions", version: packageVersion), + appId: appId, + apiKey: apiKey, + options: options, + defaultHosts: () { + final allowedRegions = ['eu', 'us']; + assert( + allowedRegions.contains(region), + '`region` is required and must be one of the following: ${allowedRegions.join(', ')}', + ); + final url = 'query-suggestions.{region}.algolia.com' + .replaceAll('{region}', region); + return [Host(url: url)]; + }) { + assert(appId.isNotEmpty, '`appId` is missing.'); + assert(apiKey.isNotEmpty, '`apiKey` is missing.'); + } + + /// Create a configuration. + /// Create a new Query Suggestions configuration. You can have up to 100 configurations per Algolia application. + /// + /// Parameters: + /// * [querySuggestionsConfigurationWithIndex] + /// * [requestOptions] additional request configuration. + Future createConfig({ + required QuerySuggestionsConfigurationWithIndex + querySuggestionsConfigurationWithIndex, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1/configs', + body: querySuggestionsConfigurationWithIndex.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'BaseResponse', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [requestOptions] additional request configuration. + Future del({ + required String path, + Map? parameters, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `del`.', + ); + final request = ApiRequest( + method: RequestMethod.delete, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Delete a configuration. + /// Delete a Query Suggestions configuration. Deleting only removes the configuration and stops updates to the Query Suggestions index. The Query Suggestions index itself is not deleted. + /// + /// Parameters: + /// * [indexName] Query Suggestions index name. + /// * [requestOptions] additional request configuration. + Future deleteConfig({ + required String indexName, + RequestOptions? requestOptions, + }) async { + assert( + indexName.isNotEmpty, + 'Parameter `indexName` is required when calling `deleteConfig`.', + ); + final request = ApiRequest( + method: RequestMethod.delete, + path: r'/1/configs/{indexName}'.replaceAll( + '{' r'indexName' '}', Uri.encodeComponent(indexName.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'BaseResponse', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [requestOptions] additional request configuration. + Future get({ + required String path, + Map? parameters, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `get`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// List configurations. + /// List all Query Suggestions configurations of your Algolia application. + /// + /// Parameters: + /// * [requestOptions] additional request configuration. + Future> getAllConfigs({ + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/configs', + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize, + QuerySuggestionsConfigurationResponse>( + response, + 'List', + growable: true, + ); + } + + /// Get a configuration. + /// Get a single Query Suggestions configuration. + /// + /// Parameters: + /// * [indexName] Query Suggestions index name. + /// * [requestOptions] additional request configuration. + Future getConfig({ + required String indexName, + RequestOptions? requestOptions, + }) async { + assert( + indexName.isNotEmpty, + 'Parameter `indexName` is required when calling `getConfig`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/configs/{indexName}'.replaceAll( + '{' r'indexName' '}', Uri.encodeComponent(indexName.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'QuerySuggestionsConfigurationResponse', + growable: true, + ); + } + + /// Get configuration status. + /// Report the status of a Query Suggestions index. + /// + /// Parameters: + /// * [indexName] Query Suggestions index name. + /// * [requestOptions] additional request configuration. + Future getConfigStatus({ + required String indexName, + RequestOptions? requestOptions, + }) async { + assert( + indexName.isNotEmpty, + 'Parameter `indexName` is required when calling `getConfigStatus`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/configs/{indexName}/status'.replaceAll( + '{' r'indexName' '}', Uri.encodeComponent(indexName.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetConfigStatus200Response', + growable: true, + ); + } + + /// Get logs. + /// Get the logs for a single Query Suggestions index. + /// + /// Parameters: + /// * [indexName] Query Suggestions index name. + /// * [requestOptions] additional request configuration. + Future getLogFile({ + required String indexName, + RequestOptions? requestOptions, + }) async { + assert( + indexName.isNotEmpty, + 'Parameter `indexName` is required when calling `getLogFile`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/logs/{indexName}'.replaceAll( + '{' r'indexName' '}', Uri.encodeComponent(indexName.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetLogFile200Response', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [body] Parameters to send with the custom request. + /// * [requestOptions] additional request configuration. + Future post({ + required String path, + Map? parameters, + Object? body, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `post`.', + ); + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + body: body, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [body] Parameters to send with the custom request. + /// * [requestOptions] additional request configuration. + Future put({ + required String path, + Map? parameters, + Object? body, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `put`.', + ); + final request = ApiRequest( + method: RequestMethod.put, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + body: body, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Update a configuration. + /// Update a QuerySuggestions configuration. + /// + /// Parameters: + /// * [indexName] Query Suggestions index name. + /// * [querySuggestionsConfiguration] + /// * [requestOptions] additional request configuration. + Future updateConfig({ + required String indexName, + required QuerySuggestionsConfiguration querySuggestionsConfiguration, + RequestOptions? requestOptions, + }) async { + assert( + indexName.isNotEmpty, + 'Parameter `indexName` is required when calling `updateConfig`.', + ); + final request = ApiRequest( + method: RequestMethod.put, + path: r'/1/configs/{indexName}'.replaceAll( + '{' r'indexName' '}', Uri.encodeComponent(indexName.toString())), + body: querySuggestionsConfiguration.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'BaseResponse', + growable: true, + ); + } + + @override + void dispose() => _retryStrategy.dispose(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/deserialize.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/deserialize.dart new file mode 100644 index 0000000000..f1df4aa617 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/deserialize.dart @@ -0,0 +1,98 @@ +import 'package:algolia_client_query_suggestions/src/model/base_response.dart'; +import 'package:algolia_client_query_suggestions/src/model/error_base.dart'; +import 'package:algolia_client_query_suggestions/src/model/facet.dart'; +import 'package:algolia_client_query_suggestions/src/model/get_config_status200_response.dart'; +import 'package:algolia_client_query_suggestions/src/model/get_log_file200_response.dart'; +import 'package:algolia_client_query_suggestions/src/model/log_level.dart'; +import 'package:algolia_client_query_suggestions/src/model/query_suggestions_configuration.dart'; +import 'package:algolia_client_query_suggestions/src/model/query_suggestions_configuration_response.dart'; +import 'package:algolia_client_query_suggestions/src/model/query_suggestions_configuration_response_all_of.dart'; +import 'package:algolia_client_query_suggestions/src/model/query_suggestions_configuration_with_index.dart'; +import 'package:algolia_client_query_suggestions/src/model/query_suggestions_configuration_with_index_all_of.dart'; +import 'package:algolia_client_query_suggestions/src/model/source_index.dart'; + +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + +ReturnType deserialize(dynamic value, String targetType, + {bool growable = true}) { + switch (targetType) { + case 'String': + return '$value' as ReturnType; + case 'int': + return (value is int ? value : int.parse('$value')) as ReturnType; + case 'bool': + if (value is bool) { + return value as ReturnType; + } + final valueString = '$value'.toLowerCase(); + return (valueString == 'true' || valueString == '1') as ReturnType; + case 'double': + return (value is double ? value : double.parse('$value')) as ReturnType; + case 'BaseResponse': + return BaseResponse.fromJson(value as Map) as ReturnType; + case 'ErrorBase': + return ErrorBase.fromJson(value as Map) as ReturnType; + case 'Facet': + return Facet.fromJson(value as Map) as ReturnType; + case 'GetConfigStatus200Response': + return GetConfigStatus200Response.fromJson(value as Map) + as ReturnType; + case 'GetLogFile200Response': + return GetLogFile200Response.fromJson(value as Map) + as ReturnType; + case 'LogLevel': + return LogLevel.fromJson(value) as ReturnType; + case 'QuerySuggestionsConfiguration': + return QuerySuggestionsConfiguration.fromJson( + value as Map) as ReturnType; + case 'QuerySuggestionsConfigurationResponse': + return QuerySuggestionsConfigurationResponse.fromJson( + value as Map) as ReturnType; + case 'QuerySuggestionsConfigurationResponseAllOf': + return QuerySuggestionsConfigurationResponseAllOf.fromJson( + value as Map) as ReturnType; + case 'QuerySuggestionsConfigurationWithIndex': + return QuerySuggestionsConfigurationWithIndex.fromJson( + value as Map) as ReturnType; + case 'QuerySuggestionsConfigurationWithIndexAllOf': + return QuerySuggestionsConfigurationWithIndexAllOf.fromJson( + value as Map) as ReturnType; + case 'SourceIndex': + return SourceIndex.fromJson(value as Map) as ReturnType; + default: + RegExpMatch? match; + + if (value is List && (match = _regList.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toList(growable: growable) as ReturnType; + } + if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toSet() as ReturnType; + } + if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return Map.fromIterables( + value.keys, + value.values.map((dynamic v) => deserialize( + v, targetType, + growable: growable)), + ) as ReturnType; + } + if (targetType == 'Object') { + return value; + } + break; + } + throw Exception('Cannot deserialize'); +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/base_response.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/base_response.dart new file mode 100644 index 0000000000..7594da00af --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/base_response.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'base_response.g.dart'; + +@JsonSerializable() +final class BaseResponse { + /// Returns a new [BaseResponse] instance. + const BaseResponse({ + this.status, + this.message, + }); + + /// HTTP status code. + @JsonKey(name: r'status') + final int? status; + + /// Details about the response, such as error messages. + @JsonKey(name: r'message') + final String? message; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BaseResponse && + other.status == status && + other.message == message; + + @override + int get hashCode => status.hashCode + message.hashCode; + + factory BaseResponse.fromJson(Map json) => + _$BaseResponseFromJson(json); + + Map toJson() => _$BaseResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/base_response.g.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/base_response.g.dart new file mode 100644 index 0000000000..13c999ed52 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/base_response.g.dart @@ -0,0 +1,34 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'base_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BaseResponse _$BaseResponseFromJson(Map json) => + $checkedCreate( + 'BaseResponse', + json, + ($checkedConvert) { + final val = BaseResponse( + status: $checkedConvert('status', (v) => v as int?), + message: $checkedConvert('message', (v) => v as String?), + ); + return val; + }, + ); + +Map _$BaseResponseToJson(BaseResponse instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('status', instance.status); + writeNotNull('message', instance.message); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/error_base.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/error_base.dart new file mode 100644 index 0000000000..df5d4ade57 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/error_base.dart @@ -0,0 +1,47 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:collection/collection.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'error_base.g.dart'; + +@JsonSerializable(createFieldMap: true) +final class ErrorBase extends DelegatingMap { + /// Returns a new [ErrorBase] instance. + const ErrorBase({ + this.message, + Map additionalProperties = const {}, + }) : super(additionalProperties); + + @JsonKey(name: r'message') + final String? message; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ErrorBase && + other.message == message && + const MapEquality().equals(this, this); + + @override + int get hashCode => + message.hashCode + const MapEquality().hash(this); + + factory ErrorBase.fromJson(Map json) { + final instance = _$ErrorBaseFromJson(json); + final additionalProperties = Map.from(json) + ..removeWhere((key, value) => _$ErrorBaseFieldMap.containsKey(key)); + return ErrorBase( + message: instance.message, + additionalProperties: additionalProperties, + ); + } + + Map toJson() => _$ErrorBaseToJson(this)..addAll(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/error_base.g.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/error_base.g.dart new file mode 100644 index 0000000000..f796166fb2 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/error_base.g.dart @@ -0,0 +1,35 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'error_base.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ErrorBase _$ErrorBaseFromJson(Map json) => $checkedCreate( + 'ErrorBase', + json, + ($checkedConvert) { + final val = ErrorBase( + message: $checkedConvert('message', (v) => v as String?), + ); + return val; + }, + ); + +const _$ErrorBaseFieldMap = { + 'message': 'message', +}; + +Map _$ErrorBaseToJson(ErrorBase instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('message', instance.message); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/facet.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/facet.dart new file mode 100644 index 0000000000..ebe6c0964a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/facet.dart @@ -0,0 +1,40 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'facet.g.dart'; + +@JsonSerializable() +final class Facet { + /// Returns a new [Facet] instance. + const Facet({ + this.attribute, + this.amount, + }); + + /// Facet name. + @JsonKey(name: r'attribute') + final String? attribute; + + /// Number of suggestions. + @JsonKey(name: r'amount') + final int? amount; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Facet && other.attribute == attribute && other.amount == amount; + + @override + int get hashCode => attribute.hashCode + amount.hashCode; + + factory Facet.fromJson(Map json) => _$FacetFromJson(json); + + Map toJson() => _$FacetToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/facet.g.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/facet.g.dart new file mode 100644 index 0000000000..2e5e03dbad --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/facet.g.dart @@ -0,0 +1,33 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'facet.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Facet _$FacetFromJson(Map json) => $checkedCreate( + 'Facet', + json, + ($checkedConvert) { + final val = Facet( + attribute: $checkedConvert('attribute', (v) => v as String?), + amount: $checkedConvert('amount', (v) => v as int?), + ); + return val; + }, + ); + +Map _$FacetToJson(Facet instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('attribute', instance.attribute); + writeNotNull('amount', instance.amount); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/get_config_status200_response.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/get_config_status200_response.dart new file mode 100644 index 0000000000..2af8959155 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/get_config_status200_response.dart @@ -0,0 +1,66 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_config_status200_response.g.dart'; + +@JsonSerializable() +final class GetConfigStatus200Response { + /// Returns a new [GetConfigStatus200Response] instance. + const GetConfigStatus200Response({ + this.indexName, + this.isRunning, + this.lastBuiltAt, + this.lastSuccessfulBuiltAt, + this.lastSuccessfulBuildDuration, + }); + + /// Query Suggestions index name. + @JsonKey(name: r'indexName') + final String? indexName; + + /// Indicates whether the creation or update of the Query Suggestions is in progress. + @JsonKey(name: r'isRunning') + final bool? isRunning; + + /// Timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format when the Query Suggestions index was last built. + @JsonKey(name: r'lastBuiltAt') + final String? lastBuiltAt; + + /// Timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format when the Query Suggestions index was last updated successfully. + @JsonKey(name: r'lastSuccessfulBuiltAt') + final String? lastSuccessfulBuiltAt; + + /// Duration of the last successful build in seconds. + @JsonKey(name: r'lastSuccessfulBuildDuration') + final String? lastSuccessfulBuildDuration; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetConfigStatus200Response && + other.indexName == indexName && + other.isRunning == isRunning && + other.lastBuiltAt == lastBuiltAt && + other.lastSuccessfulBuiltAt == lastSuccessfulBuiltAt && + other.lastSuccessfulBuildDuration == lastSuccessfulBuildDuration; + + @override + int get hashCode => + indexName.hashCode + + isRunning.hashCode + + lastBuiltAt.hashCode + + lastSuccessfulBuiltAt.hashCode + + lastSuccessfulBuildDuration.hashCode; + + factory GetConfigStatus200Response.fromJson(Map json) => + _$GetConfigStatus200ResponseFromJson(json); + + Map toJson() => _$GetConfigStatus200ResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/get_config_status200_response.g.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/get_config_status200_response.g.dart new file mode 100644 index 0000000000..5b756c7586 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/get_config_status200_response.g.dart @@ -0,0 +1,45 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_config_status200_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetConfigStatus200Response _$GetConfigStatus200ResponseFromJson( + Map json) => + $checkedCreate( + 'GetConfigStatus200Response', + json, + ($checkedConvert) { + final val = GetConfigStatus200Response( + indexName: $checkedConvert('indexName', (v) => v as String?), + isRunning: $checkedConvert('isRunning', (v) => v as bool?), + lastBuiltAt: $checkedConvert('lastBuiltAt', (v) => v as String?), + lastSuccessfulBuiltAt: + $checkedConvert('lastSuccessfulBuiltAt', (v) => v as String?), + lastSuccessfulBuildDuration: $checkedConvert( + 'lastSuccessfulBuildDuration', (v) => v as String?), + ); + return val; + }, + ); + +Map _$GetConfigStatus200ResponseToJson( + GetConfigStatus200Response instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('indexName', instance.indexName); + writeNotNull('isRunning', instance.isRunning); + writeNotNull('lastBuiltAt', instance.lastBuiltAt); + writeNotNull('lastSuccessfulBuiltAt', instance.lastSuccessfulBuiltAt); + writeNotNull( + 'lastSuccessfulBuildDuration', instance.lastSuccessfulBuildDuration); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/get_log_file200_response.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/get_log_file200_response.dart new file mode 100644 index 0000000000..d965b9cb29 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/get_log_file200_response.dart @@ -0,0 +1,59 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_query_suggestions/src/model/log_level.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_log_file200_response.g.dart'; + +@JsonSerializable() +final class GetLogFile200Response { + /// Returns a new [GetLogFile200Response] instance. + const GetLogFile200Response({ + this.timestamp, + this.level, + this.message, + this.contextLevel, + }); + + /// Timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format. + @JsonKey(name: r'timestamp') + final String? timestamp; + + @JsonKey(name: r'level') + final LogLevel? level; + + /// Details about this log entry. + @JsonKey(name: r'message') + final String? message; + + /// Level indicating the position of a suggestion in a hierarchy of records. For example, a `contextLevel` of 1 indicates that this suggestion belongs to a previous suggestion with `contextLevel` 0. + @JsonKey(name: r'contextLevel') + final int? contextLevel; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetLogFile200Response && + other.timestamp == timestamp && + other.level == level && + other.message == message && + other.contextLevel == contextLevel; + + @override + int get hashCode => + timestamp.hashCode + + level.hashCode + + message.hashCode + + contextLevel.hashCode; + + factory GetLogFile200Response.fromJson(Map json) => + _$GetLogFile200ResponseFromJson(json); + + Map toJson() => _$GetLogFile200ResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/get_log_file200_response.g.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/get_log_file200_response.g.dart new file mode 100644 index 0000000000..c46f08b58e --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/get_log_file200_response.g.dart @@ -0,0 +1,47 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_log_file200_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetLogFile200Response _$GetLogFile200ResponseFromJson( + Map json) => + $checkedCreate( + 'GetLogFile200Response', + json, + ($checkedConvert) { + final val = GetLogFile200Response( + timestamp: $checkedConvert('timestamp', (v) => v as String?), + level: $checkedConvert( + 'level', (v) => $enumDecodeNullable(_$LogLevelEnumMap, v)), + message: $checkedConvert('message', (v) => v as String?), + contextLevel: $checkedConvert('contextLevel', (v) => v as int?), + ); + return val; + }, + ); + +Map _$GetLogFile200ResponseToJson( + GetLogFile200Response instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('timestamp', instance.timestamp); + writeNotNull('level', instance.level?.toJson()); + writeNotNull('message', instance.message); + writeNotNull('contextLevel', instance.contextLevel); + return val; +} + +const _$LogLevelEnumMap = { + LogLevel.skip: 'SKIP', + LogLevel.info: 'INFO', + LogLevel.error: 'ERROR', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/log_level.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/log_level.dart new file mode 100644 index 0000000000..0c5b0a6a7c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/log_level.dart @@ -0,0 +1,31 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// The type of log entry. - `SKIP`. A query is skipped because it doesn't match the conditions for successful inclusion. For example, when a query doesn't generate enough search results. - `INFO`. An informative log entry. - `ERROR`. The Query Suggestions process encountered an error. +@JsonEnum(valueField: 'raw') +enum LogLevel { + /// The type of log entry. - `SKIP`. A query is skipped because it doesn't match the conditions for successful inclusion. For example, when a query doesn't generate enough search results. - `INFO`. An informative log entry. - `ERROR`. The Query Suggestions process encountered an error. + skip(r'SKIP'), + + /// The type of log entry. - `SKIP`. A query is skipped because it doesn't match the conditions for successful inclusion. For example, when a query doesn't generate enough search results. - `INFO`. An informative log entry. - `ERROR`. The Query Suggestions process encountered an error. + info(r'INFO'), + + /// The type of log entry. - `SKIP`. A query is skipped because it doesn't match the conditions for successful inclusion. For example, when a query doesn't generate enough search results. - `INFO`. An informative log entry. - `ERROR`. The Query Suggestions process encountered an error. + error(r'ERROR'); + + const LogLevel(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static LogLevel fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration.dart new file mode 100644 index 0000000000..f8e23123f6 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration.dart @@ -0,0 +1,69 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_query_suggestions/src/model/source_index.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'query_suggestions_configuration.g.dart'; + +@JsonSerializable() +final class QuerySuggestionsConfiguration { + /// Returns a new [QuerySuggestionsConfiguration] instance. + const QuerySuggestionsConfiguration({ + required this.sourceIndices, + this.languages, + this.exclude, + this.enablePersonalization, + this.allowSpecialCharacters, + }); + + /// Algolia indices from which to get the popular searches for query suggestions. + @JsonKey(name: r'sourceIndices') + final List sourceIndices; + + /// One of types: + /// - [bool] + /// - [List] + @JsonKey(name: r'languages') + final dynamic languages; + + /// Patterns to exclude from query suggestions. + @JsonKey(name: r'exclude') + final List? exclude; + + /// Turn on personalized query suggestions. + @JsonKey(name: r'enablePersonalization') + final bool? enablePersonalization; + + /// Allow suggestions with special characters. + @JsonKey(name: r'allowSpecialCharacters') + final bool? allowSpecialCharacters; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is QuerySuggestionsConfiguration && + other.sourceIndices == sourceIndices && + other.languages == languages && + other.exclude == exclude && + other.enablePersonalization == enablePersonalization && + other.allowSpecialCharacters == allowSpecialCharacters; + + @override + int get hashCode => + sourceIndices.hashCode + + languages.hashCode + + (exclude == null ? 0 : exclude.hashCode) + + enablePersonalization.hashCode + + allowSpecialCharacters.hashCode; + + factory QuerySuggestionsConfiguration.fromJson(Map json) => + _$QuerySuggestionsConfigurationFromJson(json); + + Map toJson() => _$QuerySuggestionsConfigurationToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration.g.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration.g.dart new file mode 100644 index 0000000000..31cbc82777 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration.g.dart @@ -0,0 +1,50 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'query_suggestions_configuration.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +QuerySuggestionsConfiguration _$QuerySuggestionsConfigurationFromJson( + Map json) => + $checkedCreate( + 'QuerySuggestionsConfiguration', + json, + ($checkedConvert) { + final val = QuerySuggestionsConfiguration( + sourceIndices: $checkedConvert( + 'sourceIndices', + (v) => (v as List) + .map((e) => SourceIndex.fromJson(e as Map)) + .toList()), + languages: $checkedConvert('languages', (v) => v), + exclude: $checkedConvert('exclude', + (v) => (v as List?)?.map((e) => e as String).toList()), + enablePersonalization: + $checkedConvert('enablePersonalization', (v) => v as bool?), + allowSpecialCharacters: + $checkedConvert('allowSpecialCharacters', (v) => v as bool?), + ); + return val; + }, + ); + +Map _$QuerySuggestionsConfigurationToJson( + QuerySuggestionsConfiguration instance) { + final val = { + 'sourceIndices': instance.sourceIndices.map((e) => e.toJson()).toList(), + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('languages', instance.languages); + writeNotNull('exclude', instance.exclude); + writeNotNull('enablePersonalization', instance.enablePersonalization); + writeNotNull('allowSpecialCharacters', instance.allowSpecialCharacters); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_response.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_response.dart new file mode 100644 index 0000000000..c0fa50008c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_response.dart @@ -0,0 +1,106 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_query_suggestions/src/model/source_index.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'query_suggestions_configuration_response.g.dart'; + +@JsonSerializable() +final class QuerySuggestionsConfigurationResponse { + /// Returns a new [QuerySuggestionsConfigurationResponse] instance. + const QuerySuggestionsConfigurationResponse({ + this.appId, + this.sourceIndicesAPIKey, + this.suggestionsIndicesAPIKey, + this.externalIndicesAPIKey, + required this.indexName, + required this.sourceIndices, + this.languages, + this.exclude, + this.enablePersonalization, + this.allowSpecialCharacters, + }); + + /// Your Algolia application ID. + @JsonKey(name: r'appId') + final String? appId; + + /// API key used to read from your source index. + @JsonKey(name: r'sourceIndicesAPIKey') + final String? sourceIndicesAPIKey; + + /// API key used to write and configure your Query Suggestions index. + @JsonKey(name: r'suggestionsIndicesAPIKey') + final String? suggestionsIndicesAPIKey; + + /// API key used to read from external Algolia indices. + @JsonKey(name: r'externalIndicesAPIKey') + final String? externalIndicesAPIKey; + + /// Query Suggestions index name. + @JsonKey(name: r'indexName') + final String indexName; + + /// Algolia indices from which to get the popular searches for query suggestions. + @JsonKey(name: r'sourceIndices') + final List sourceIndices; + + /// One of types: + /// - [bool] + /// - [List] + @JsonKey(name: r'languages') + final dynamic languages; + + /// Patterns to exclude from query suggestions. + @JsonKey(name: r'exclude') + final List? exclude; + + /// Turn on personalized query suggestions. + @JsonKey(name: r'enablePersonalization') + final bool? enablePersonalization; + + /// Allow suggestions with special characters. + @JsonKey(name: r'allowSpecialCharacters') + final bool? allowSpecialCharacters; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is QuerySuggestionsConfigurationResponse && + other.appId == appId && + other.sourceIndicesAPIKey == sourceIndicesAPIKey && + other.suggestionsIndicesAPIKey == suggestionsIndicesAPIKey && + other.externalIndicesAPIKey == externalIndicesAPIKey && + other.indexName == indexName && + other.sourceIndices == sourceIndices && + other.languages == languages && + other.exclude == exclude && + other.enablePersonalization == enablePersonalization && + other.allowSpecialCharacters == allowSpecialCharacters; + + @override + int get hashCode => + appId.hashCode + + sourceIndicesAPIKey.hashCode + + suggestionsIndicesAPIKey.hashCode + + externalIndicesAPIKey.hashCode + + indexName.hashCode + + sourceIndices.hashCode + + languages.hashCode + + (exclude == null ? 0 : exclude.hashCode) + + enablePersonalization.hashCode + + allowSpecialCharacters.hashCode; + + factory QuerySuggestionsConfigurationResponse.fromJson( + Map json) => + _$QuerySuggestionsConfigurationResponseFromJson(json); + + Map toJson() => + _$QuerySuggestionsConfigurationResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_response.g.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_response.g.dart new file mode 100644 index 0000000000..d02dd0cc8e --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_response.g.dart @@ -0,0 +1,66 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'query_suggestions_configuration_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +QuerySuggestionsConfigurationResponse + _$QuerySuggestionsConfigurationResponseFromJson( + Map json) => + $checkedCreate( + 'QuerySuggestionsConfigurationResponse', + json, + ($checkedConvert) { + final val = QuerySuggestionsConfigurationResponse( + appId: $checkedConvert('appId', (v) => v as String?), + sourceIndicesAPIKey: + $checkedConvert('sourceIndicesAPIKey', (v) => v as String?), + suggestionsIndicesAPIKey: $checkedConvert( + 'suggestionsIndicesAPIKey', (v) => v as String?), + externalIndicesAPIKey: + $checkedConvert('externalIndicesAPIKey', (v) => v as String?), + indexName: $checkedConvert('indexName', (v) => v as String), + sourceIndices: $checkedConvert( + 'sourceIndices', + (v) => (v as List) + .map((e) => + SourceIndex.fromJson(e as Map)) + .toList()), + languages: $checkedConvert('languages', (v) => v), + exclude: $checkedConvert( + 'exclude', + (v) => + (v as List?)?.map((e) => e as String).toList()), + enablePersonalization: + $checkedConvert('enablePersonalization', (v) => v as bool?), + allowSpecialCharacters: + $checkedConvert('allowSpecialCharacters', (v) => v as bool?), + ); + return val; + }, + ); + +Map _$QuerySuggestionsConfigurationResponseToJson( + QuerySuggestionsConfigurationResponse instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('appId', instance.appId); + writeNotNull('sourceIndicesAPIKey', instance.sourceIndicesAPIKey); + writeNotNull('suggestionsIndicesAPIKey', instance.suggestionsIndicesAPIKey); + writeNotNull('externalIndicesAPIKey', instance.externalIndicesAPIKey); + val['indexName'] = instance.indexName; + val['sourceIndices'] = instance.sourceIndices.map((e) => e.toJson()).toList(); + writeNotNull('languages', instance.languages); + writeNotNull('exclude', instance.exclude); + writeNotNull('enablePersonalization', instance.enablePersonalization); + writeNotNull('allowSpecialCharacters', instance.allowSpecialCharacters); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_response_all_of.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_response_all_of.dart new file mode 100644 index 0000000000..c3bc3ab3ef --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_response_all_of.dart @@ -0,0 +1,61 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'query_suggestions_configuration_response_all_of.g.dart'; + +@JsonSerializable() +final class QuerySuggestionsConfigurationResponseAllOf { + /// Returns a new [QuerySuggestionsConfigurationResponseAllOf] instance. + const QuerySuggestionsConfigurationResponseAllOf({ + this.appId, + this.sourceIndicesAPIKey, + this.suggestionsIndicesAPIKey, + this.externalIndicesAPIKey, + }); + + /// Your Algolia application ID. + @JsonKey(name: r'appId') + final String? appId; + + /// API key used to read from your source index. + @JsonKey(name: r'sourceIndicesAPIKey') + final String? sourceIndicesAPIKey; + + /// API key used to write and configure your Query Suggestions index. + @JsonKey(name: r'suggestionsIndicesAPIKey') + final String? suggestionsIndicesAPIKey; + + /// API key used to read from external Algolia indices. + @JsonKey(name: r'externalIndicesAPIKey') + final String? externalIndicesAPIKey; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is QuerySuggestionsConfigurationResponseAllOf && + other.appId == appId && + other.sourceIndicesAPIKey == sourceIndicesAPIKey && + other.suggestionsIndicesAPIKey == suggestionsIndicesAPIKey && + other.externalIndicesAPIKey == externalIndicesAPIKey; + + @override + int get hashCode => + appId.hashCode + + sourceIndicesAPIKey.hashCode + + suggestionsIndicesAPIKey.hashCode + + externalIndicesAPIKey.hashCode; + + factory QuerySuggestionsConfigurationResponseAllOf.fromJson( + Map json) => + _$QuerySuggestionsConfigurationResponseAllOfFromJson(json); + + Map toJson() => + _$QuerySuggestionsConfigurationResponseAllOfToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_response_all_of.g.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_response_all_of.g.dart new file mode 100644 index 0000000000..05aca5781d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_response_all_of.g.dart @@ -0,0 +1,44 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'query_suggestions_configuration_response_all_of.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +QuerySuggestionsConfigurationResponseAllOf + _$QuerySuggestionsConfigurationResponseAllOfFromJson( + Map json) => + $checkedCreate( + 'QuerySuggestionsConfigurationResponseAllOf', + json, + ($checkedConvert) { + final val = QuerySuggestionsConfigurationResponseAllOf( + appId: $checkedConvert('appId', (v) => v as String?), + sourceIndicesAPIKey: + $checkedConvert('sourceIndicesAPIKey', (v) => v as String?), + suggestionsIndicesAPIKey: $checkedConvert( + 'suggestionsIndicesAPIKey', (v) => v as String?), + externalIndicesAPIKey: + $checkedConvert('externalIndicesAPIKey', (v) => v as String?), + ); + return val; + }, + ); + +Map _$QuerySuggestionsConfigurationResponseAllOfToJson( + QuerySuggestionsConfigurationResponseAllOf instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('appId', instance.appId); + writeNotNull('sourceIndicesAPIKey', instance.sourceIndicesAPIKey); + writeNotNull('suggestionsIndicesAPIKey', instance.suggestionsIndicesAPIKey); + writeNotNull('externalIndicesAPIKey', instance.externalIndicesAPIKey); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_with_index.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_with_index.dart new file mode 100644 index 0000000000..d2fcd2354a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_with_index.dart @@ -0,0 +1,78 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_query_suggestions/src/model/source_index.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'query_suggestions_configuration_with_index.g.dart'; + +@JsonSerializable() +final class QuerySuggestionsConfigurationWithIndex { + /// Returns a new [QuerySuggestionsConfigurationWithIndex] instance. + const QuerySuggestionsConfigurationWithIndex({ + required this.indexName, + required this.sourceIndices, + this.languages, + this.exclude, + this.enablePersonalization, + this.allowSpecialCharacters, + }); + + /// Query Suggestions index name. + @JsonKey(name: r'indexName') + final String indexName; + + /// Algolia indices from which to get the popular searches for query suggestions. + @JsonKey(name: r'sourceIndices') + final List sourceIndices; + + /// One of types: + /// - [bool] + /// - [List] + @JsonKey(name: r'languages') + final dynamic languages; + + /// Patterns to exclude from query suggestions. + @JsonKey(name: r'exclude') + final List? exclude; + + /// Turn on personalized query suggestions. + @JsonKey(name: r'enablePersonalization') + final bool? enablePersonalization; + + /// Allow suggestions with special characters. + @JsonKey(name: r'allowSpecialCharacters') + final bool? allowSpecialCharacters; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is QuerySuggestionsConfigurationWithIndex && + other.indexName == indexName && + other.sourceIndices == sourceIndices && + other.languages == languages && + other.exclude == exclude && + other.enablePersonalization == enablePersonalization && + other.allowSpecialCharacters == allowSpecialCharacters; + + @override + int get hashCode => + indexName.hashCode + + sourceIndices.hashCode + + languages.hashCode + + (exclude == null ? 0 : exclude.hashCode) + + enablePersonalization.hashCode + + allowSpecialCharacters.hashCode; + + factory QuerySuggestionsConfigurationWithIndex.fromJson( + Map json) => + _$QuerySuggestionsConfigurationWithIndexFromJson(json); + + Map toJson() => + _$QuerySuggestionsConfigurationWithIndexToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_with_index.g.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_with_index.g.dart new file mode 100644 index 0000000000..9d83bdb360 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_with_index.g.dart @@ -0,0 +1,56 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'query_suggestions_configuration_with_index.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +QuerySuggestionsConfigurationWithIndex + _$QuerySuggestionsConfigurationWithIndexFromJson( + Map json) => + $checkedCreate( + 'QuerySuggestionsConfigurationWithIndex', + json, + ($checkedConvert) { + final val = QuerySuggestionsConfigurationWithIndex( + indexName: $checkedConvert('indexName', (v) => v as String), + sourceIndices: $checkedConvert( + 'sourceIndices', + (v) => (v as List) + .map((e) => + SourceIndex.fromJson(e as Map)) + .toList()), + languages: $checkedConvert('languages', (v) => v), + exclude: $checkedConvert( + 'exclude', + (v) => + (v as List?)?.map((e) => e as String).toList()), + enablePersonalization: + $checkedConvert('enablePersonalization', (v) => v as bool?), + allowSpecialCharacters: + $checkedConvert('allowSpecialCharacters', (v) => v as bool?), + ); + return val; + }, + ); + +Map _$QuerySuggestionsConfigurationWithIndexToJson( + QuerySuggestionsConfigurationWithIndex instance) { + final val = { + 'indexName': instance.indexName, + 'sourceIndices': instance.sourceIndices.map((e) => e.toJson()).toList(), + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('languages', instance.languages); + writeNotNull('exclude', instance.exclude); + writeNotNull('enablePersonalization', instance.enablePersonalization); + writeNotNull('allowSpecialCharacters', instance.allowSpecialCharacters); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_with_index_all_of.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_with_index_all_of.dart new file mode 100644 index 0000000000..a4d4b1e6fb --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_with_index_all_of.dart @@ -0,0 +1,39 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'query_suggestions_configuration_with_index_all_of.g.dart'; + +@JsonSerializable() +final class QuerySuggestionsConfigurationWithIndexAllOf { + /// Returns a new [QuerySuggestionsConfigurationWithIndexAllOf] instance. + const QuerySuggestionsConfigurationWithIndexAllOf({ + required this.indexName, + }); + + /// Query Suggestions index name. + @JsonKey(name: r'indexName') + final String indexName; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is QuerySuggestionsConfigurationWithIndexAllOf && + other.indexName == indexName; + + @override + int get hashCode => indexName.hashCode; + + factory QuerySuggestionsConfigurationWithIndexAllOf.fromJson( + Map json) => + _$QuerySuggestionsConfigurationWithIndexAllOfFromJson(json); + + Map toJson() => + _$QuerySuggestionsConfigurationWithIndexAllOfToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_with_index_all_of.g.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_with_index_all_of.g.dart new file mode 100644 index 0000000000..4cdf6ef371 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/query_suggestions_configuration_with_index_all_of.g.dart @@ -0,0 +1,27 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'query_suggestions_configuration_with_index_all_of.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +QuerySuggestionsConfigurationWithIndexAllOf + _$QuerySuggestionsConfigurationWithIndexAllOfFromJson( + Map json) => + $checkedCreate( + 'QuerySuggestionsConfigurationWithIndexAllOf', + json, + ($checkedConvert) { + final val = QuerySuggestionsConfigurationWithIndexAllOf( + indexName: $checkedConvert('indexName', (v) => v as String), + ); + return val; + }, + ); + +Map _$QuerySuggestionsConfigurationWithIndexAllOfToJson( + QuerySuggestionsConfigurationWithIndexAllOf instance) => + { + 'indexName': instance.indexName, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/source_index.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/source_index.dart new file mode 100644 index 0000000000..b5283dac36 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/source_index.dart @@ -0,0 +1,89 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_query_suggestions/src/model/facet.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'source_index.g.dart'; + +@JsonSerializable() +final class SourceIndex { + /// Returns a new [SourceIndex] instance. + const SourceIndex({ + required this.indexName, + this.replicas, + this.analyticsTags, + this.facets, + this.minHits, + this.minLetters, + this.generate, + this.external_, + }); + + /// Name of the Algolia index to use as source for query suggestions. + @JsonKey(name: r'indexName') + final String indexName; + + /// If true, Query Suggestions uses all replicas of the primary index to find popular searches. If false, only the primary index is used. + @JsonKey(name: r'replicas') + final bool? replicas; + + /// [Analytics tags](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) for filtering the popular searches. + @JsonKey(name: r'analyticsTags') + final List? analyticsTags; + + /// Facets to use as top categories with your suggestions. If provided, Query Suggestions adds the top facet values to each suggestion. + @JsonKey(name: r'facets') + final List? facets; + + /// Minimum number of hits required to be included as a suggestion. A search query must at least generate `minHits` hits to be included in the Query Suggestions index. + // minimum: 0 + @JsonKey(name: r'minHits') + final int? minHits; + + /// Minimum letters required to be included as a suggestion. A search query must be at least `minLetters` long to be included in the Query Suggestions index. + // minimum: 0 + @JsonKey(name: r'minLetters') + final int? minLetters; + + @JsonKey(name: r'generate') + final List>? generate; + + /// Algolia indices with popular searches to use as query suggestions. Records of these indices must have these attributes: - `query`: search query which will be added as a suggestion - `count`: measure of popularity of that search query For example, you can export popular searches from an external analytics tool, such as Google Analytics or Adobe Analytics, and feed this data into an external Algolia index. You can use this external index to generate query suggestions until your Algolia analytics has collected enough data. + @JsonKey(name: r'external') + final List? external_; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SourceIndex && + other.indexName == indexName && + other.replicas == replicas && + other.analyticsTags == analyticsTags && + other.facets == facets && + other.minHits == minHits && + other.minLetters == minLetters && + other.generate == generate && + other.external_ == external_; + + @override + int get hashCode => + indexName.hashCode + + replicas.hashCode + + (analyticsTags == null ? 0 : analyticsTags.hashCode) + + (facets == null ? 0 : facets.hashCode) + + minHits.hashCode + + minLetters.hashCode + + generate.hashCode + + (external_ == null ? 0 : external_.hashCode); + + factory SourceIndex.fromJson(Map json) => + _$SourceIndexFromJson(json); + + Map toJson() => _$SourceIndexToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/source_index.g.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/source_index.g.dart new file mode 100644 index 0000000000..723cb03501 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/model/source_index.g.dart @@ -0,0 +1,58 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'source_index.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SourceIndex _$SourceIndexFromJson(Map json) => $checkedCreate( + 'SourceIndex', + json, + ($checkedConvert) { + final val = SourceIndex( + indexName: $checkedConvert('indexName', (v) => v as String), + replicas: $checkedConvert('replicas', (v) => v as bool?), + analyticsTags: $checkedConvert('analyticsTags', + (v) => (v as List?)?.map((e) => e as String).toList()), + facets: $checkedConvert( + 'facets', + (v) => (v as List?) + ?.map((e) => Facet.fromJson(e as Map)) + .toList()), + minHits: $checkedConvert('minHits', (v) => v as int?), + minLetters: $checkedConvert('minLetters', (v) => v as int?), + generate: $checkedConvert( + 'generate', + (v) => (v as List?) + ?.map((e) => + (e as List).map((e) => e as String).toList()) + .toList()), + external_: $checkedConvert('external', + (v) => (v as List?)?.map((e) => e as String).toList()), + ); + return val; + }, + fieldKeyMap: const {'external_': 'external'}, + ); + +Map _$SourceIndexToJson(SourceIndex instance) { + final val = { + 'indexName': instance.indexName, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('replicas', instance.replicas); + writeNotNull('analyticsTags', instance.analyticsTags); + writeNotNull('facets', instance.facets?.map((e) => e.toJson()).toList()); + writeNotNull('minHits', instance.minHits); + writeNotNull('minLetters', instance.minLetters); + writeNotNull('generate', instance.generate); + writeNotNull('external', instance.external_); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/version.dart b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/version.dart new file mode 100644 index 0000000000..03e065a0a8 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/lib/src/version.dart @@ -0,0 +1,2 @@ +/// Current package version +const packageVersion = '0.1.2'; diff --git a/clients/algoliasearch-client-dart/packages/client_query_suggestions/pubspec.yaml b/clients/algoliasearch-client-dart/packages/client_query_suggestions/pubspec.yaml new file mode 100644 index 0000000000..6cdac380a4 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_query_suggestions/pubspec.yaml @@ -0,0 +1,24 @@ +name: algolia_client_query_suggestions +version: 0.1.2 +description: A sub-package of the AlgoliaSearch library, offering query suggestions-specific functionalities for enhanced search and discovery in Dart/Flutter apps. +homepage: https://www.algolia.com/doc/ +repository: https://github.com/algolia/algoliasearch-client-dart/tree/main/packages/client_query_suggestions +topics: + - search + - discovery + +environment: + sdk: '>=3.0.0 <4.0.0' + +dependencies: + # Pinning versions until the API stabilizes. + algolia_client_core: 0.1.1+4 + json_annotation: ^4.8.1 + collection: ^1.17.1 + +dev_dependencies: + build_runner: ^2.4.4 + json_serializable: ^6.7.0 + lints: ^2.1.1 + logging: ^1.2.0 + test: ^1.24.3 diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/build.yaml b/clients/algoliasearch-client-dart/packages/client_recommend/build.yaml new file mode 100644 index 0000000000..6d71b406a7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/build.yaml @@ -0,0 +1,14 @@ +targets: + $default: + builders: + json_serializable: + options: + any_map: false + checked: true + create_factory: true + create_to_json: true + disallow_unrecognized_keys: false + explicit_to_json: true + field_rename: none + ignore_unannotated: false + include_if_null: false diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/algolia_client_recommend.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/algolia_client_recommend.dart new file mode 100644 index 0000000000..e8b30dc57f --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/algolia_client_recommend.dart @@ -0,0 +1,72 @@ +// A sub-package of the AlgoliaSearch library, offering recommend-specific functionalities for enhanced search and discovery in Dart/Flutter apps. +library algolia_client_recommend; + +export 'package:algolia_client_core/algolia_client_core.dart'; + +export 'src/api/recommend_client.dart'; + +export 'src/model/advanced_syntax_features.dart'; +export 'src/model/alternatives_as_exact.dart'; +export 'src/model/anchoring.dart'; +export 'src/model/around_radius_all.dart'; +export 'src/model/automatic_facet_filter.dart'; +export 'src/model/base_recommend_request.dart'; +export 'src/model/base_recommendation_request.dart'; +export 'src/model/base_search_params.dart'; +export 'src/model/base_search_params_without_query.dart'; +export 'src/model/base_search_response.dart'; +export 'src/model/base_search_response_redirect.dart'; +export 'src/model/base_trending_request.dart'; +export 'src/model/condition.dart'; +export 'src/model/consequence.dart'; +export 'src/model/consequence_hide.dart'; +export 'src/model/consequence_params.dart'; +export 'src/model/consequence_query_object.dart'; +export 'src/model/deleted_at_response.dart'; +export 'src/model/edit.dart'; +export 'src/model/edit_type.dart'; +export 'src/model/error_base.dart'; +export 'src/model/exact_on_single_word_query.dart'; +export 'src/model/facet_ordering.dart'; +export 'src/model/facets.dart'; +export 'src/model/facets_stats.dart'; +export 'src/model/get_recommend_task_response.dart'; +export 'src/model/get_recommendations_params.dart'; +export 'src/model/get_recommendations_response.dart'; +export 'src/model/highlight_result_option.dart'; +export 'src/model/index_settings_as_search_params.dart'; +export 'src/model/index_settings_as_search_params_semantic_search.dart'; +export 'src/model/match_level.dart'; +export 'src/model/matched_geo_location.dart'; +export 'src/model/mode.dart'; +export 'src/model/params.dart'; +export 'src/model/personalization.dart'; +export 'src/model/promote_object_id.dart'; +export 'src/model/promote_object_ids.dart'; +export 'src/model/query_type.dart'; +export 'src/model/ranking_info.dart'; +export 'src/model/recommend_hit.dart'; +export 'src/model/recommend_hits.dart'; +export 'src/model/recommend_models.dart'; +export 'src/model/recommendation_models.dart'; +export 'src/model/recommendation_request.dart'; +export 'src/model/recommendations_response.dart'; +export 'src/model/redirect_rule_index_metadata.dart'; +export 'src/model/redirect_rule_index_metadata_data.dart'; +export 'src/model/remove_words_if_no_results.dart'; +export 'src/model/rendering_content.dart'; +export 'src/model/rule_response.dart'; +export 'src/model/rule_response_metadata.dart'; +export 'src/model/search_params_object.dart'; +export 'src/model/search_params_query.dart'; +export 'src/model/search_recommend_rules_params.dart'; +export 'src/model/search_recommend_rules_response.dart'; +export 'src/model/snippet_result_option.dart'; +export 'src/model/sort_remaining_by.dart'; +export 'src/model/task_status.dart'; +export 'src/model/trending_models.dart'; +export 'src/model/trending_request.dart'; +export 'src/model/typo_tolerance_enum.dart'; +export 'src/model/value.dart'; + +export 'src/extension.dart'; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/api/recommend_client.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/api/recommend_client.dart new file mode 100644 index 0000000000..4f34d9173f --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/api/recommend_client.dart @@ -0,0 +1,384 @@ +// 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. + +import 'package:algolia_client_core/algolia_client_core.dart'; +import 'package:algolia_client_recommend/src/deserialize.dart'; +import 'package:algolia_client_recommend/src/version.dart'; + +import 'package:algolia_client_recommend/src/model/deleted_at_response.dart'; +import 'package:algolia_client_recommend/src/model/get_recommend_task_response.dart'; +import 'package:algolia_client_recommend/src/model/get_recommendations_params.dart'; +import 'package:algolia_client_recommend/src/model/get_recommendations_response.dart'; +import 'package:algolia_client_recommend/src/model/recommend_models.dart'; +import 'package:algolia_client_recommend/src/model/rule_response.dart'; +import 'package:algolia_client_recommend/src/model/search_recommend_rules_params.dart'; +import 'package:algolia_client_recommend/src/model/search_recommend_rules_response.dart'; + +final class RecommendClient implements ApiClient { + @override + final String apiKey; + + @override + final String appId; + + @override + final ClientOptions options; + + final RetryStrategy _retryStrategy; + + RecommendClient({ + required this.appId, + required this.apiKey, + this.options = const ClientOptions(), + }) : _retryStrategy = RetryStrategy.create( + segment: AgentSegment(value: "Recommend", version: packageVersion), + appId: appId, + apiKey: apiKey, + options: options, + defaultHosts: () => + [ + Host(url: '$appId-dsn.algolia.net', callType: CallType.read), + Host(url: '$appId.algolia.net', callType: CallType.write), + ] + + ([ + Host(url: '$appId-1.algolianet.com'), + Host(url: '$appId-2.algolianet.com'), + Host(url: '$appId-3.algolianet.com'), + ]..shuffle()), + ) { + assert(appId.isNotEmpty, '`appId` is missing.'); + assert(apiKey.isNotEmpty, '`apiKey` is missing.'); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [requestOptions] additional request configuration. + Future del({ + required String path, + Map? parameters, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `del`.', + ); + final request = ApiRequest( + method: RequestMethod.delete, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Delete a Recommend rule. + /// Delete a [Recommend rule](https://www.algolia.com/doc/guides/algolia-recommend/how-to/rules/). + /// + /// Parameters: + /// * [indexName] Index on which to perform the request. + /// * [model] [Recommend models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models). + /// * [objectID] Unique record (object) identifier. + /// * [requestOptions] additional request configuration. + Future deleteRecommendRule({ + required String indexName, + required RecommendModels model, + required String objectID, + RequestOptions? requestOptions, + }) async { + assert( + indexName.isNotEmpty, + 'Parameter `indexName` is required when calling `deleteRecommendRule`.', + ); + assert( + objectID.isNotEmpty, + 'Parameter `objectID` is required when calling `deleteRecommendRule`.', + ); + final request = ApiRequest( + method: RequestMethod.delete, + path: r'/1/indexes/{indexName}/{model}/recommend/rules/{objectID}' + .replaceAll( + '{' r'indexName' '}', Uri.encodeComponent(indexName.toString())) + .replaceAll('{' r'model' '}', Uri.encodeComponent(model.toString())) + .replaceAll( + '{' r'objectID' '}', Uri.encodeComponent(objectID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'DeletedAtResponse', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [requestOptions] additional request configuration. + Future get({ + required String path, + Map? parameters, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `get`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Get a Recommend rule. + /// Return a [Recommend rule](https://www.algolia.com/doc/guides/algolia-recommend/how-to/rules/). + /// + /// Parameters: + /// * [indexName] Index on which to perform the request. + /// * [model] [Recommend models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models). + /// * [objectID] Unique record (object) identifier. + /// * [requestOptions] additional request configuration. + Future getRecommendRule({ + required String indexName, + required RecommendModels model, + required String objectID, + RequestOptions? requestOptions, + }) async { + assert( + indexName.isNotEmpty, + 'Parameter `indexName` is required when calling `getRecommendRule`.', + ); + assert( + objectID.isNotEmpty, + 'Parameter `objectID` is required when calling `getRecommendRule`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/indexes/{indexName}/{model}/recommend/rules/{objectID}' + .replaceAll( + '{' r'indexName' '}', Uri.encodeComponent(indexName.toString())) + .replaceAll('{' r'model' '}', Uri.encodeComponent(model.toString())) + .replaceAll( + '{' r'objectID' '}', Uri.encodeComponent(objectID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'RuleResponse', + growable: true, + ); + } + + /// Get a Recommend task's status. + /// Some operations, such as deleting a Recommend rule, will respond with a `taskID` value. Use this value here to check the status of that task. + /// + /// Parameters: + /// * [indexName] Index on which to perform the request. + /// * [model] [Recommend models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models). + /// * [taskID] Unique identifier of a task. Numeric value (up to 64bits). + /// * [requestOptions] additional request configuration. + Future getRecommendStatus({ + required String indexName, + required RecommendModels model, + required int taskID, + RequestOptions? requestOptions, + }) async { + assert( + indexName.isNotEmpty, + 'Parameter `indexName` is required when calling `getRecommendStatus`.', + ); + final request = ApiRequest( + method: RequestMethod.get, + path: r'/1/indexes/{indexName}/{model}/task/{taskID}' + .replaceAll( + '{' r'indexName' '}', Uri.encodeComponent(indexName.toString())) + .replaceAll('{' r'model' '}', Uri.encodeComponent(model.toString())) + .replaceAll( + '{' r'taskID' '}', Uri.encodeComponent(taskID.toString())), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetRecommendTaskResponse', + growable: true, + ); + } + + /// Get recommendations and trending items. + /// Returns results from either recommendation or trending models: - **Recommendations** are provided by the [Related Products](https://www.algolia.com/doc/guides/algolia-recommend/overview/#related-products-and-related-content) and [Frequently Bought Together](https://www.algolia.com/doc/guides/algolia-recommend/overview/#frequently-bought-together) models - **Trending** models are [Trending Items and Trending Facet Values](https://www.algolia.com/doc/guides/algolia-recommend/overview/#trending-items-and-trending-facet-values). + /// + /// Parameters: + /// * [getRecommendationsParams] + /// * [requestOptions] additional request configuration. + Future getRecommendations({ + required GetRecommendationsParams getRecommendationsParams, + RequestOptions? requestOptions, + }) async { + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1/indexes/*/recommendations', + isRead: true, + body: getRecommendationsParams.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'GetRecommendationsResponse', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [body] Parameters to send with the custom request. + /// * [requestOptions] additional request configuration. + Future post({ + required String path, + Map? parameters, + Object? body, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `post`.', + ); + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + body: body, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// Send requests to the Algolia REST API. + /// This method allow you to send requests to the Algolia REST API. + /// + /// Parameters: + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [body] Parameters to send with the custom request. + /// * [requestOptions] additional request configuration. + Future put({ + required String path, + Map? parameters, + Object? body, + RequestOptions? requestOptions, + }) async { + assert( + path.isNotEmpty, + 'Parameter `path` is required when calling `put`.', + ); + final request = ApiRequest( + method: RequestMethod.put, + path: r'/1{path}'.replaceAll('{' r'path' '}', path), + queryParams: { + ...?parameters, + }, + body: body, + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'Object', + growable: true, + ); + } + + /// List Recommend rules. + /// List [Recommend rules](https://www.algolia.com/doc/guides/algolia-recommend/how-to/rules/). + /// + /// Parameters: + /// * [indexName] Index on which to perform the request. + /// * [model] [Recommend models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models). + /// * [searchRecommendRulesParams] + /// * [requestOptions] additional request configuration. + Future searchRecommendRules({ + required String indexName, + required RecommendModels model, + SearchRecommendRulesParams? searchRecommendRulesParams, + RequestOptions? requestOptions, + }) async { + assert( + indexName.isNotEmpty, + 'Parameter `indexName` is required when calling `searchRecommendRules`.', + ); + final request = ApiRequest( + method: RequestMethod.post, + path: r'/1/indexes/{indexName}/{model}/recommend/rules/search' + .replaceAll( + '{' r'indexName' '}', Uri.encodeComponent(indexName.toString())) + .replaceAll('{' r'model' '}', Uri.encodeComponent(model.toString())), + isRead: true, + body: searchRecommendRulesParams?.toJson(), + ); + final response = await _retryStrategy.execute( + request: request, + options: requestOptions, + ); + return deserialize( + response, + 'SearchRecommendRulesResponse', + growable: true, + ); + } + + @override + void dispose() => _retryStrategy.dispose(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/deserialize.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/deserialize.dart new file mode 100644 index 0000000000..1b19f109ef --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/deserialize.dart @@ -0,0 +1,280 @@ +import 'package:algolia_client_recommend/src/model/advanced_syntax_features.dart'; +import 'package:algolia_client_recommend/src/model/alternatives_as_exact.dart'; +import 'package:algolia_client_recommend/src/model/anchoring.dart'; +import 'package:algolia_client_recommend/src/model/around_radius_all.dart'; +import 'package:algolia_client_recommend/src/model/automatic_facet_filter.dart'; +import 'package:algolia_client_recommend/src/model/base_recommend_request.dart'; +import 'package:algolia_client_recommend/src/model/base_recommendation_request.dart'; +import 'package:algolia_client_recommend/src/model/base_search_params.dart'; +import 'package:algolia_client_recommend/src/model/base_search_params_without_query.dart'; +import 'package:algolia_client_recommend/src/model/base_search_response.dart'; +import 'package:algolia_client_recommend/src/model/base_search_response_redirect.dart'; +import 'package:algolia_client_recommend/src/model/base_trending_request.dart'; +import 'package:algolia_client_recommend/src/model/condition.dart'; +import 'package:algolia_client_recommend/src/model/consequence.dart'; +import 'package:algolia_client_recommend/src/model/consequence_hide.dart'; +import 'package:algolia_client_recommend/src/model/consequence_params.dart'; +import 'package:algolia_client_recommend/src/model/consequence_query_object.dart'; +import 'package:algolia_client_recommend/src/model/deleted_at_response.dart'; +import 'package:algolia_client_recommend/src/model/edit.dart'; +import 'package:algolia_client_recommend/src/model/edit_type.dart'; +import 'package:algolia_client_recommend/src/model/error_base.dart'; +import 'package:algolia_client_recommend/src/model/exact_on_single_word_query.dart'; +import 'package:algolia_client_recommend/src/model/facet_ordering.dart'; +import 'package:algolia_client_recommend/src/model/facets.dart'; +import 'package:algolia_client_recommend/src/model/facets_stats.dart'; +import 'package:algolia_client_recommend/src/model/get_recommend_task_response.dart'; +import 'package:algolia_client_recommend/src/model/get_recommendations_params.dart'; +import 'package:algolia_client_recommend/src/model/get_recommendations_response.dart'; +import 'package:algolia_client_recommend/src/model/highlight_result_option.dart'; +import 'package:algolia_client_recommend/src/model/index_settings_as_search_params.dart'; +import 'package:algolia_client_recommend/src/model/index_settings_as_search_params_semantic_search.dart'; +import 'package:algolia_client_recommend/src/model/match_level.dart'; +import 'package:algolia_client_recommend/src/model/matched_geo_location.dart'; +import 'package:algolia_client_recommend/src/model/mode.dart'; +import 'package:algolia_client_recommend/src/model/params.dart'; +import 'package:algolia_client_recommend/src/model/personalization.dart'; +import 'package:algolia_client_recommend/src/model/promote_object_id.dart'; +import 'package:algolia_client_recommend/src/model/promote_object_ids.dart'; +import 'package:algolia_client_recommend/src/model/query_type.dart'; +import 'package:algolia_client_recommend/src/model/ranking_info.dart'; +import 'package:algolia_client_recommend/src/model/recommend_hit.dart'; +import 'package:algolia_client_recommend/src/model/recommend_hits.dart'; +import 'package:algolia_client_recommend/src/model/recommend_models.dart'; +import 'package:algolia_client_recommend/src/model/recommendation_models.dart'; +import 'package:algolia_client_recommend/src/model/recommendation_request.dart'; +import 'package:algolia_client_recommend/src/model/recommendations_response.dart'; +import 'package:algolia_client_recommend/src/model/redirect_rule_index_metadata.dart'; +import 'package:algolia_client_recommend/src/model/redirect_rule_index_metadata_data.dart'; +import 'package:algolia_client_recommend/src/model/remove_words_if_no_results.dart'; +import 'package:algolia_client_recommend/src/model/rendering_content.dart'; +import 'package:algolia_client_recommend/src/model/rule_response.dart'; +import 'package:algolia_client_recommend/src/model/rule_response_metadata.dart'; +import 'package:algolia_client_recommend/src/model/search_params_object.dart'; +import 'package:algolia_client_recommend/src/model/search_params_query.dart'; +import 'package:algolia_client_recommend/src/model/search_recommend_rules_params.dart'; +import 'package:algolia_client_recommend/src/model/search_recommend_rules_response.dart'; +import 'package:algolia_client_recommend/src/model/snippet_result_option.dart'; +import 'package:algolia_client_recommend/src/model/sort_remaining_by.dart'; +import 'package:algolia_client_recommend/src/model/task_status.dart'; +import 'package:algolia_client_recommend/src/model/trending_models.dart'; +import 'package:algolia_client_recommend/src/model/trending_request.dart'; +import 'package:algolia_client_recommend/src/model/typo_tolerance_enum.dart'; +import 'package:algolia_client_recommend/src/model/value.dart'; + +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + +ReturnType deserialize(dynamic value, String targetType, + {bool growable = true}) { + switch (targetType) { + case 'String': + return '$value' as ReturnType; + case 'int': + return (value is int ? value : int.parse('$value')) as ReturnType; + case 'bool': + if (value is bool) { + return value as ReturnType; + } + final valueString = '$value'.toLowerCase(); + return (valueString == 'true' || valueString == '1') as ReturnType; + case 'double': + return (value is double ? value : double.parse('$value')) as ReturnType; + case 'AdvancedSyntaxFeatures': + return AdvancedSyntaxFeatures.fromJson(value) as ReturnType; + case 'AlternativesAsExact': + return AlternativesAsExact.fromJson(value) as ReturnType; + case 'Anchoring': + return Anchoring.fromJson(value) as ReturnType; + case 'AroundRadiusAll': + return AroundRadiusAll.fromJson(value) as ReturnType; + case 'AutomaticFacetFilter': + return AutomaticFacetFilter.fromJson(value as Map) + as ReturnType; + case 'BaseRecommendRequest': + return BaseRecommendRequest.fromJson(value as Map) + as ReturnType; + case 'BaseRecommendationRequest': + return BaseRecommendationRequest.fromJson(value as Map) + as ReturnType; + case 'BaseSearchParams': + return BaseSearchParams.fromJson(value as Map) + as ReturnType; + case 'BaseSearchParamsWithoutQuery': + return BaseSearchParamsWithoutQuery.fromJson( + value as Map) as ReturnType; + case 'BaseSearchResponse': + return BaseSearchResponse.fromJson(value as Map) + as ReturnType; + case 'BaseSearchResponseRedirect': + return BaseSearchResponseRedirect.fromJson(value as Map) + as ReturnType; + case 'BaseTrendingRequest': + return BaseTrendingRequest.fromJson(value as Map) + as ReturnType; + case 'Condition': + return Condition.fromJson(value as Map) as ReturnType; + case 'Consequence': + return Consequence.fromJson(value as Map) as ReturnType; + case 'ConsequenceHide': + return ConsequenceHide.fromJson(value as Map) + as ReturnType; + case 'ConsequenceParams': + return ConsequenceParams.fromJson(value as Map) + as ReturnType; + case 'ConsequenceQueryObject': + return ConsequenceQueryObject.fromJson(value as Map) + as ReturnType; + case 'DeletedAtResponse': + return DeletedAtResponse.fromJson(value as Map) + as ReturnType; + case 'Edit': + return Edit.fromJson(value as Map) as ReturnType; + case 'EditType': + return EditType.fromJson(value) as ReturnType; + case 'ErrorBase': + return ErrorBase.fromJson(value as Map) as ReturnType; + case 'ExactOnSingleWordQuery': + return ExactOnSingleWordQuery.fromJson(value) as ReturnType; + case 'FacetOrdering': + return FacetOrdering.fromJson(value as Map) + as ReturnType; + case 'Facets': + return Facets.fromJson(value as Map) as ReturnType; + case 'FacetsStats': + return FacetsStats.fromJson(value as Map) as ReturnType; + case 'GetRecommendTaskResponse': + return GetRecommendTaskResponse.fromJson(value as Map) + as ReturnType; + case 'GetRecommendationsParams': + return GetRecommendationsParams.fromJson(value as Map) + as ReturnType; + case 'GetRecommendationsResponse': + return GetRecommendationsResponse.fromJson(value as Map) + as ReturnType; + case 'HighlightResultOption': + return HighlightResultOption.fromJson(value as Map) + as ReturnType; + case 'IndexSettingsAsSearchParams': + return IndexSettingsAsSearchParams.fromJson(value as Map) + as ReturnType; + case 'IndexSettingsAsSearchParamsSemanticSearch': + return IndexSettingsAsSearchParamsSemanticSearch.fromJson( + value as Map) as ReturnType; + case 'MatchLevel': + return MatchLevel.fromJson(value) as ReturnType; + case 'MatchedGeoLocation': + return MatchedGeoLocation.fromJson(value as Map) + as ReturnType; + case 'Mode': + return Mode.fromJson(value) as ReturnType; + case 'Params': + return Params.fromJson(value as Map) as ReturnType; + case 'Personalization': + return Personalization.fromJson(value as Map) + as ReturnType; + case 'PromoteObjectID': + return PromoteObjectID.fromJson(value as Map) + as ReturnType; + case 'PromoteObjectIDs': + return PromoteObjectIDs.fromJson(value as Map) + as ReturnType; + case 'QueryType': + return QueryType.fromJson(value) as ReturnType; + case 'RankingInfo': + return RankingInfo.fromJson(value as Map) as ReturnType; + case 'RecommendHit': + return RecommendHit.fromJson(value as Map) as ReturnType; + case 'RecommendHits': + return RecommendHits.fromJson(value as Map) + as ReturnType; + case 'RecommendModels': + return RecommendModels.fromJson(value) as ReturnType; + case 'RecommendationModels': + return RecommendationModels.fromJson(value) as ReturnType; + case 'RecommendationRequest': + return RecommendationRequest.fromJson(value as Map) + as ReturnType; + case 'RecommendationsResponse': + return RecommendationsResponse.fromJson(value as Map) + as ReturnType; + case 'RedirectRuleIndexMetadata': + return RedirectRuleIndexMetadata.fromJson(value as Map) + as ReturnType; + case 'RedirectRuleIndexMetadataData': + return RedirectRuleIndexMetadataData.fromJson( + value as Map) as ReturnType; + case 'RemoveWordsIfNoResults': + return RemoveWordsIfNoResults.fromJson(value) as ReturnType; + case 'RenderingContent': + return RenderingContent.fromJson(value as Map) + as ReturnType; + case 'RuleResponse': + return RuleResponse.fromJson(value as Map) as ReturnType; + case 'RuleResponseMetadata': + return RuleResponseMetadata.fromJson(value as Map) + as ReturnType; + case 'SearchParamsObject': + return SearchParamsObject.fromJson(value as Map) + as ReturnType; + case 'SearchParamsQuery': + return SearchParamsQuery.fromJson(value as Map) + as ReturnType; + case 'SearchRecommendRulesParams': + return SearchRecommendRulesParams.fromJson(value as Map) + as ReturnType; + case 'SearchRecommendRulesResponse': + return SearchRecommendRulesResponse.fromJson( + value as Map) as ReturnType; + case 'SnippetResultOption': + return SnippetResultOption.fromJson(value as Map) + as ReturnType; + case 'SortRemainingBy': + return SortRemainingBy.fromJson(value) as ReturnType; + case 'TaskStatus': + return TaskStatus.fromJson(value) as ReturnType; + case 'TrendingModels': + return TrendingModels.fromJson(value) as ReturnType; + case 'TrendingRequest': + return TrendingRequest.fromJson(value as Map) + as ReturnType; + case 'TypoToleranceEnum': + return TypoToleranceEnum.fromJson(value) as ReturnType; + case 'Value': + return Value.fromJson(value as Map) as ReturnType; + default: + RegExpMatch? match; + + if (value is List && (match = _regList.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toList(growable: growable) as ReturnType; + } + if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return value + .map((dynamic v) => deserialize( + v, targetType, + growable: growable)) + .toSet() as ReturnType; + } + if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { + targetType = match![1]!; // ignore: parameter_assignments + return Map.fromIterables( + value.keys, + value.values.map((dynamic v) => deserialize( + v, targetType, + growable: growable)), + ) as ReturnType; + } + if (targetType == 'Object') { + return value; + } + break; + } + throw Exception('Cannot deserialize'); +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/advanced_syntax_features.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/advanced_syntax_features.dart new file mode 100644 index 0000000000..b63f46b55a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/advanced_syntax_features.dart @@ -0,0 +1,24 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum AdvancedSyntaxFeatures { + exactPhrase(r'exactPhrase'), + excludeWords(r'excludeWords'); + + const AdvancedSyntaxFeatures(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static AdvancedSyntaxFeatures fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/alternatives_as_exact.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/alternatives_as_exact.dart new file mode 100644 index 0000000000..58dea73f89 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/alternatives_as_exact.dart @@ -0,0 +1,25 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum AlternativesAsExact { + ignorePlurals(r'ignorePlurals'), + singleWordSynonym(r'singleWordSynonym'), + multiWordsSynonym(r'multiWordsSynonym'); + + const AlternativesAsExact(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static AlternativesAsExact fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/anchoring.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/anchoring.dart new file mode 100644 index 0000000000..c5f1439dde --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/anchoring.dart @@ -0,0 +1,34 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Whether the pattern parameter matches the beginning (`startsWith`) or end (`endsWith`) of the query string, is an exact match (`is`), or a partial match (`contains`). +@JsonEnum(valueField: 'raw') +enum Anchoring { + /// Whether the pattern parameter matches the beginning (`startsWith`) or end (`endsWith`) of the query string, is an exact match (`is`), or a partial match (`contains`). + is_(r'is'), + + /// Whether the pattern parameter matches the beginning (`startsWith`) or end (`endsWith`) of the query string, is an exact match (`is`), or a partial match (`contains`). + startsWith(r'startsWith'), + + /// Whether the pattern parameter matches the beginning (`startsWith`) or end (`endsWith`) of the query string, is an exact match (`is`), or a partial match (`contains`). + endsWith(r'endsWith'), + + /// Whether the pattern parameter matches the beginning (`startsWith`) or end (`endsWith`) of the query string, is an exact match (`is`), or a partial match (`contains`). + contains(r'contains'); + + const Anchoring(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static Anchoring fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/around_radius_all.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/around_radius_all.dart new file mode 100644 index 0000000000..907fb416e0 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/around_radius_all.dart @@ -0,0 +1,23 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum AroundRadiusAll { + all(r'all'); + + const AroundRadiusAll(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static AroundRadiusAll fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/automatic_facet_filter.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/automatic_facet_filter.dart new file mode 100644 index 0000000000..a9fb95c8f2 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/automatic_facet_filter.dart @@ -0,0 +1,49 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'automatic_facet_filter.g.dart'; + +@JsonSerializable() +final class AutomaticFacetFilter { + /// Returns a new [AutomaticFacetFilter] instance. + const AutomaticFacetFilter({ + required this.facet, + this.score, + this.disjunctive, + }); + + /// Attribute to filter on. This must match a facet placeholder in the Rule's pattern. + @JsonKey(name: r'facet') + final String facet; + + /// Score for the filter. Typically used for optional or disjunctive filters. + @JsonKey(name: r'score') + final int? score; + + /// Whether the filter is disjunctive (true) or conjunctive (false). + @JsonKey(name: r'disjunctive') + final bool? disjunctive; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AutomaticFacetFilter && + other.facet == facet && + other.score == score && + other.disjunctive == disjunctive; + + @override + int get hashCode => facet.hashCode + score.hashCode + disjunctive.hashCode; + + factory AutomaticFacetFilter.fromJson(Map json) => + _$AutomaticFacetFilterFromJson(json); + + Map toJson() => _$AutomaticFacetFilterToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/automatic_facet_filter.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/automatic_facet_filter.g.dart new file mode 100644 index 0000000000..dda5b6eaa0 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/automatic_facet_filter.g.dart @@ -0,0 +1,39 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'automatic_facet_filter.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AutomaticFacetFilter _$AutomaticFacetFilterFromJson( + Map json) => + $checkedCreate( + 'AutomaticFacetFilter', + json, + ($checkedConvert) { + final val = AutomaticFacetFilter( + facet: $checkedConvert('facet', (v) => v as String), + score: $checkedConvert('score', (v) => v as int?), + disjunctive: $checkedConvert('disjunctive', (v) => v as bool?), + ); + return val; + }, + ); + +Map _$AutomaticFacetFilterToJson( + AutomaticFacetFilter instance) { + final val = { + 'facet': instance.facet, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('score', instance.score); + writeNotNull('disjunctive', instance.disjunctive); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommend_request.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommend_request.dart new file mode 100644 index 0000000000..2bfcffe792 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommend_request.dart @@ -0,0 +1,67 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/search_params_object.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'base_recommend_request.g.dart'; + +@JsonSerializable() +final class BaseRecommendRequest { + /// Returns a new [BaseRecommendRequest] instance. + const BaseRecommendRequest({ + required this.indexName, + required this.threshold, + this.maxRecommendations, + this.queryParameters, + this.fallbackParameters, + }); + + /// Algolia index name. + @JsonKey(name: r'indexName') + final String indexName; + + /// Recommendations with a confidence score lower than `threshold` won't appear in results. > **Note**: Each recommendation has a confidence score of 0 to 100. The closer the score is to 100, the more relevant the recommendations are. + // minimum: 0 + // maximum: 100 + @JsonKey(name: r'threshold') + final int threshold; + + /// Maximum number of recommendations to retrieve. If 0, all recommendations will be returned. + @JsonKey(name: r'maxRecommendations') + final int? maxRecommendations; + + @JsonKey(name: r'queryParameters') + final SearchParamsObject? queryParameters; + + @JsonKey(name: r'fallbackParameters') + final SearchParamsObject? fallbackParameters; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BaseRecommendRequest && + other.indexName == indexName && + other.threshold == threshold && + other.maxRecommendations == maxRecommendations && + other.queryParameters == queryParameters && + other.fallbackParameters == fallbackParameters; + + @override + int get hashCode => + indexName.hashCode + + threshold.hashCode + + maxRecommendations.hashCode + + queryParameters.hashCode + + fallbackParameters.hashCode; + + factory BaseRecommendRequest.fromJson(Map json) => + _$BaseRecommendRequestFromJson(json); + + Map toJson() => _$BaseRecommendRequestToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommend_request.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommend_request.g.dart new file mode 100644 index 0000000000..c3fd62cab7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommend_request.g.dart @@ -0,0 +1,52 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'base_recommend_request.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BaseRecommendRequest _$BaseRecommendRequestFromJson( + Map json) => + $checkedCreate( + 'BaseRecommendRequest', + json, + ($checkedConvert) { + final val = BaseRecommendRequest( + indexName: $checkedConvert('indexName', (v) => v as String), + threshold: $checkedConvert('threshold', (v) => v as int), + maxRecommendations: + $checkedConvert('maxRecommendations', (v) => v as int?), + queryParameters: $checkedConvert( + 'queryParameters', + (v) => v == null + ? null + : SearchParamsObject.fromJson(v as Map)), + fallbackParameters: $checkedConvert( + 'fallbackParameters', + (v) => v == null + ? null + : SearchParamsObject.fromJson(v as Map)), + ); + return val; + }, + ); + +Map _$BaseRecommendRequestToJson( + BaseRecommendRequest instance) { + final val = { + 'indexName': instance.indexName, + 'threshold': instance.threshold, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('maxRecommendations', instance.maxRecommendations); + writeNotNull('queryParameters', instance.queryParameters?.toJson()); + writeNotNull('fallbackParameters', instance.fallbackParameters?.toJson()); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommendation_request.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommendation_request.dart new file mode 100644 index 0000000000..cfb2347f23 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommendation_request.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/recommendation_models.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'base_recommendation_request.g.dart'; + +@JsonSerializable() +final class BaseRecommendationRequest { + /// Returns a new [BaseRecommendationRequest] instance. + const BaseRecommendationRequest({ + required this.model, + required this.objectID, + }); + + @JsonKey(name: r'model') + final RecommendationModels model; + + /// Unique object identifier. + @JsonKey(name: r'objectID') + final String objectID; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BaseRecommendationRequest && + other.model == model && + other.objectID == objectID; + + @override + int get hashCode => model.hashCode + objectID.hashCode; + + factory BaseRecommendationRequest.fromJson(Map json) => + _$BaseRecommendationRequestFromJson(json); + + Map toJson() => _$BaseRecommendationRequestToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommendation_request.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommendation_request.g.dart new file mode 100644 index 0000000000..175df69b78 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_recommendation_request.g.dart @@ -0,0 +1,34 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'base_recommendation_request.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BaseRecommendationRequest _$BaseRecommendationRequestFromJson( + Map json) => + $checkedCreate( + 'BaseRecommendationRequest', + json, + ($checkedConvert) { + final val = BaseRecommendationRequest( + model: $checkedConvert( + 'model', (v) => $enumDecode(_$RecommendationModelsEnumMap, v)), + objectID: $checkedConvert('objectID', (v) => v as String), + ); + return val; + }, + ); + +Map _$BaseRecommendationRequestToJson( + BaseRecommendationRequest instance) => + { + 'model': instance.model.toJson(), + 'objectID': instance.objectID, + }; + +const _$RecommendationModelsEnumMap = { + RecommendationModels.relatedProducts: 'related-products', + RecommendationModels.boughtTogether: 'bought-together', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_params.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_params.dart new file mode 100644 index 0000000000..5f3cf2602a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_params.dart @@ -0,0 +1,289 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'base_search_params.g.dart'; + +@JsonSerializable() +final class BaseSearchParams { + /// Returns a new [BaseSearchParams] instance. + const BaseSearchParams({ + this.query, + this.similarQuery, + this.filters, + this.facetFilters, + this.optionalFilters, + this.numericFilters, + this.tagFilters, + this.sumOrFiltersScores, + this.facets, + this.maxValuesPerFacet, + this.facetingAfterDistinct, + this.sortFacetValuesBy, + this.page, + this.offset, + this.length, + this.aroundLatLng, + this.aroundLatLngViaIP, + this.aroundRadius, + this.aroundPrecision, + this.minimumAroundRadius, + this.insideBoundingBox, + this.insidePolygon, + this.naturalLanguages, + this.ruleContexts, + this.personalizationImpact, + this.userToken, + this.getRankingInfo, + this.clickAnalytics, + this.analytics, + this.analyticsTags, + this.percentileComputation, + this.enableABTest, + this.enableReRanking, + this.reRankingApplyFilter, + }); + + /// Text to search for in an index. + @JsonKey(name: r'query') + final String? query; + + /// Overrides the query parameter and performs a more generic search. + @JsonKey(name: r'similarQuery') + final String? similarQuery; + + /// [Filter](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/) the query with numeric, facet, or tag filters. + @JsonKey(name: r'filters') + final String? filters; + + /// One of types: + /// - [List>] + /// - [String] + /// - [List] + @JsonKey(name: r'facetFilters') + final dynamic facetFilters; + + /// One of types: + /// - [List>] + /// - [String] + /// - [List] + @JsonKey(name: r'optionalFilters') + final dynamic optionalFilters; + + /// One of types: + /// - [List>] + /// - [String] + /// - [List] + @JsonKey(name: r'numericFilters') + final dynamic numericFilters; + + /// One of types: + /// - [List>] + /// - [String] + /// - [List] + @JsonKey(name: r'tagFilters') + final dynamic tagFilters; + + /// Determines how to calculate [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores). If `false`, maximum score is kept. If `true`, score is summed. + @JsonKey(name: r'sumOrFiltersScores') + final bool? sumOrFiltersScores; + + /// Returns [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts), their facet values, and the number of matching facet values. + @JsonKey(name: r'facets') + final List? facets; + + /// Maximum number of facet values to return for each facet. + @JsonKey(name: r'maxValuesPerFacet') + final int? maxValuesPerFacet; + + /// Forces faceting to be applied after [de-duplication](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/) (with the distinct feature). Alternatively, the `afterDistinct` [modifier](https://www.algolia.com/doc/api-reference/api-parameters/attributesForFaceting/#modifiers) of `attributesForFaceting` allows for more granular control. + @JsonKey(name: r'facetingAfterDistinct') + final bool? facetingAfterDistinct; + + /// Controls how facet values are fetched. + @JsonKey(name: r'sortFacetValuesBy') + final String? sortFacetValuesBy; + + /// Page to retrieve (the first page is `0`, not `1`). + @JsonKey(name: r'page') + final int? page; + + /// Specifies the offset of the first hit to return. > **Note**: Using `page` and `hitsPerPage` is the recommended method for [paging results](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/). However, you can use `offset` and `length` to implement [an alternative approach to paging](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/#retrieving-a-subset-of-records-with-offset-and-length). + @JsonKey(name: r'offset') + final int? offset; + + /// Sets the number of hits to retrieve (for use with `offset`). > **Note**: Using `page` and `hitsPerPage` is the recommended method for [paging results](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/). However, you can use `offset` and `length` to implement [an alternative approach to paging](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/#retrieving-a-subset-of-records-with-offset-and-length). + // minimum: 1 + // maximum: 1000 + @JsonKey(name: r'length') + final int? length; + + /// Search for entries [around a central location](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filter-around-a-central-point), enabling a geographical search within a circular area. + @JsonKey(name: r'aroundLatLng') + final String? aroundLatLng; + + /// Search for entries around a location. The location is automatically computed from the requester's IP address. + @JsonKey(name: r'aroundLatLngViaIP') + final bool? aroundLatLngViaIP; + + /// One of types: + /// - [AroundRadiusAll] + /// - [int] + @JsonKey(name: r'aroundRadius') + final dynamic aroundRadius; + + /// Precision of a geographical search (in meters), to [group results that are more or less the same distance from a central point](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/in-depth/geo-ranking-precision/). + @JsonKey(name: r'aroundPrecision') + final int? aroundPrecision; + + /// Minimum radius (in meters) used for a geographical search when `aroundRadius` isn't set. + // minimum: 1 + @JsonKey(name: r'minimumAroundRadius') + final int? minimumAroundRadius; + + /// Search inside a [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas) (in geographical coordinates). + @JsonKey(name: r'insideBoundingBox') + final List? insideBoundingBox; + + /// Search inside a [polygon](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas) (in geographical coordinates). + @JsonKey(name: r'insidePolygon') + final List? insidePolygon; + + /// Changes the default values of parameters that work best for a natural language query, such as `ignorePlurals`, `removeStopWords`, `removeWordsIfNoResults`, `analyticsTags`, and `ruleContexts`. These parameters work well together when the query consists of fuller natural language strings instead of keywords, for example when processing voice search queries. + @JsonKey(name: r'naturalLanguages') + final List? naturalLanguages; + + /// Assigns [rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) to search queries. + @JsonKey(name: r'ruleContexts') + final List? ruleContexts; + + /// Defines how much [Personalization affects results](https://www.algolia.com/doc/guides/personalization/personalizing-results/in-depth/configuring-personalization/#understanding-personalization-impact). + @JsonKey(name: r'personalizationImpact') + final int? personalizationImpact; + + /// Associates a [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/) with the current search. + @JsonKey(name: r'userToken') + final String? userToken; + + /// Incidates whether the search response includes [detailed ranking information](https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/understanding-the-api-response/#ranking-information). + @JsonKey(name: r'getRankingInfo') + final bool? getRankingInfo; + + /// Indicates whether a query ID parameter is included in the search response. This is required for [tracking click and conversion events](https://www.algolia.com/doc/guides/sending-events/concepts/event-types/#events-related-to-algolia-requests). + @JsonKey(name: r'clickAnalytics') + final bool? clickAnalytics; + + /// Indicates whether this query will be included in [analytics](https://www.algolia.com/doc/guides/search-analytics/guides/exclude-queries/). + @JsonKey(name: r'analytics') + final bool? analytics; + + /// Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/). + @JsonKey(name: r'analyticsTags') + final List? analyticsTags; + + /// Whether to include or exclude a query from the processing-time percentile computation. + @JsonKey(name: r'percentileComputation') + final bool? percentileComputation; + + /// Incidates whether this search will be considered in A/B testing. + @JsonKey(name: r'enableABTest') + final bool? enableABTest; + + /// Indicates whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). + @JsonKey(name: r'enableReRanking') + final bool? enableReRanking; + + /// One of types: + /// - [List>] + /// - [String] + /// - [List] + @JsonKey(name: r'reRankingApplyFilter') + final dynamic reRankingApplyFilter; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BaseSearchParams && + other.query == query && + other.similarQuery == similarQuery && + other.filters == filters && + other.facetFilters == facetFilters && + other.optionalFilters == optionalFilters && + other.numericFilters == numericFilters && + other.tagFilters == tagFilters && + other.sumOrFiltersScores == sumOrFiltersScores && + other.facets == facets && + other.maxValuesPerFacet == maxValuesPerFacet && + other.facetingAfterDistinct == facetingAfterDistinct && + other.sortFacetValuesBy == sortFacetValuesBy && + other.page == page && + other.offset == offset && + other.length == length && + other.aroundLatLng == aroundLatLng && + other.aroundLatLngViaIP == aroundLatLngViaIP && + other.aroundRadius == aroundRadius && + other.aroundPrecision == aroundPrecision && + other.minimumAroundRadius == minimumAroundRadius && + other.insideBoundingBox == insideBoundingBox && + other.insidePolygon == insidePolygon && + other.naturalLanguages == naturalLanguages && + other.ruleContexts == ruleContexts && + other.personalizationImpact == personalizationImpact && + other.userToken == userToken && + other.getRankingInfo == getRankingInfo && + other.clickAnalytics == clickAnalytics && + other.analytics == analytics && + other.analyticsTags == analyticsTags && + other.percentileComputation == percentileComputation && + other.enableABTest == enableABTest && + other.enableReRanking == enableReRanking && + other.reRankingApplyFilter == reRankingApplyFilter; + + @override + int get hashCode => + query.hashCode + + similarQuery.hashCode + + filters.hashCode + + facetFilters.hashCode + + optionalFilters.hashCode + + numericFilters.hashCode + + tagFilters.hashCode + + sumOrFiltersScores.hashCode + + facets.hashCode + + maxValuesPerFacet.hashCode + + facetingAfterDistinct.hashCode + + sortFacetValuesBy.hashCode + + page.hashCode + + offset.hashCode + + length.hashCode + + aroundLatLng.hashCode + + aroundLatLngViaIP.hashCode + + aroundRadius.hashCode + + aroundPrecision.hashCode + + minimumAroundRadius.hashCode + + insideBoundingBox.hashCode + + insidePolygon.hashCode + + naturalLanguages.hashCode + + ruleContexts.hashCode + + personalizationImpact.hashCode + + userToken.hashCode + + getRankingInfo.hashCode + + clickAnalytics.hashCode + + analytics.hashCode + + analyticsTags.hashCode + + percentileComputation.hashCode + + enableABTest.hashCode + + enableReRanking.hashCode + + (reRankingApplyFilter == null ? 0 : reRankingApplyFilter.hashCode); + + factory BaseSearchParams.fromJson(Map json) => + _$BaseSearchParamsFromJson(json); + + Map toJson() => _$BaseSearchParamsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_params.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_params.g.dart new file mode 100644 index 0000000000..96e200f90a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_params.g.dart @@ -0,0 +1,120 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'base_search_params.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BaseSearchParams _$BaseSearchParamsFromJson(Map json) => + $checkedCreate( + 'BaseSearchParams', + json, + ($checkedConvert) { + final val = BaseSearchParams( + query: $checkedConvert('query', (v) => v as String?), + similarQuery: $checkedConvert('similarQuery', (v) => v as String?), + filters: $checkedConvert('filters', (v) => v as String?), + facetFilters: $checkedConvert('facetFilters', (v) => v), + optionalFilters: $checkedConvert('optionalFilters', (v) => v), + numericFilters: $checkedConvert('numericFilters', (v) => v), + tagFilters: $checkedConvert('tagFilters', (v) => v), + sumOrFiltersScores: + $checkedConvert('sumOrFiltersScores', (v) => v as bool?), + facets: $checkedConvert('facets', + (v) => (v as List?)?.map((e) => e as String).toList()), + maxValuesPerFacet: + $checkedConvert('maxValuesPerFacet', (v) => v as int?), + facetingAfterDistinct: + $checkedConvert('facetingAfterDistinct', (v) => v as bool?), + sortFacetValuesBy: + $checkedConvert('sortFacetValuesBy', (v) => v as String?), + page: $checkedConvert('page', (v) => v as int?), + offset: $checkedConvert('offset', (v) => v as int?), + length: $checkedConvert('length', (v) => v as int?), + aroundLatLng: $checkedConvert('aroundLatLng', (v) => v as String?), + aroundLatLngViaIP: + $checkedConvert('aroundLatLngViaIP', (v) => v as bool?), + aroundRadius: $checkedConvert('aroundRadius', (v) => v), + aroundPrecision: $checkedConvert('aroundPrecision', (v) => v as int?), + minimumAroundRadius: + $checkedConvert('minimumAroundRadius', (v) => v as int?), + insideBoundingBox: $checkedConvert( + 'insideBoundingBox', + (v) => (v as List?) + ?.map((e) => (e as num).toDouble()) + .toList()), + insidePolygon: $checkedConvert( + 'insidePolygon', + (v) => (v as List?) + ?.map((e) => (e as num).toDouble()) + .toList()), + naturalLanguages: $checkedConvert('naturalLanguages', + (v) => (v as List?)?.map((e) => e as String).toList()), + ruleContexts: $checkedConvert('ruleContexts', + (v) => (v as List?)?.map((e) => e as String).toList()), + personalizationImpact: + $checkedConvert('personalizationImpact', (v) => v as int?), + userToken: $checkedConvert('userToken', (v) => v as String?), + getRankingInfo: $checkedConvert('getRankingInfo', (v) => v as bool?), + clickAnalytics: $checkedConvert('clickAnalytics', (v) => v as bool?), + analytics: $checkedConvert('analytics', (v) => v as bool?), + analyticsTags: $checkedConvert('analyticsTags', + (v) => (v as List?)?.map((e) => e as String).toList()), + percentileComputation: + $checkedConvert('percentileComputation', (v) => v as bool?), + enableABTest: $checkedConvert('enableABTest', (v) => v as bool?), + enableReRanking: + $checkedConvert('enableReRanking', (v) => v as bool?), + reRankingApplyFilter: + $checkedConvert('reRankingApplyFilter', (v) => v), + ); + return val; + }, + ); + +Map _$BaseSearchParamsToJson(BaseSearchParams instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('query', instance.query); + writeNotNull('similarQuery', instance.similarQuery); + writeNotNull('filters', instance.filters); + writeNotNull('facetFilters', instance.facetFilters); + writeNotNull('optionalFilters', instance.optionalFilters); + writeNotNull('numericFilters', instance.numericFilters); + writeNotNull('tagFilters', instance.tagFilters); + writeNotNull('sumOrFiltersScores', instance.sumOrFiltersScores); + writeNotNull('facets', instance.facets); + writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); + writeNotNull('facetingAfterDistinct', instance.facetingAfterDistinct); + writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); + writeNotNull('page', instance.page); + writeNotNull('offset', instance.offset); + writeNotNull('length', instance.length); + writeNotNull('aroundLatLng', instance.aroundLatLng); + writeNotNull('aroundLatLngViaIP', instance.aroundLatLngViaIP); + writeNotNull('aroundRadius', instance.aroundRadius); + writeNotNull('aroundPrecision', instance.aroundPrecision); + writeNotNull('minimumAroundRadius', instance.minimumAroundRadius); + writeNotNull('insideBoundingBox', instance.insideBoundingBox); + writeNotNull('insidePolygon', instance.insidePolygon); + writeNotNull('naturalLanguages', instance.naturalLanguages); + writeNotNull('ruleContexts', instance.ruleContexts); + writeNotNull('personalizationImpact', instance.personalizationImpact); + writeNotNull('userToken', instance.userToken); + writeNotNull('getRankingInfo', instance.getRankingInfo); + writeNotNull('clickAnalytics', instance.clickAnalytics); + writeNotNull('analytics', instance.analytics); + writeNotNull('analyticsTags', instance.analyticsTags); + writeNotNull('percentileComputation', instance.percentileComputation); + writeNotNull('enableABTest', instance.enableABTest); + writeNotNull('enableReRanking', instance.enableReRanking); + writeNotNull('reRankingApplyFilter', instance.reRankingApplyFilter); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_params_without_query.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_params_without_query.dart new file mode 100644 index 0000000000..4dc6cebbfb --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_params_without_query.dart @@ -0,0 +1,282 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'base_search_params_without_query.g.dart'; + +@JsonSerializable() +final class BaseSearchParamsWithoutQuery { + /// Returns a new [BaseSearchParamsWithoutQuery] instance. + const BaseSearchParamsWithoutQuery({ + this.similarQuery, + this.filters, + this.facetFilters, + this.optionalFilters, + this.numericFilters, + this.tagFilters, + this.sumOrFiltersScores, + this.facets, + this.maxValuesPerFacet, + this.facetingAfterDistinct, + this.sortFacetValuesBy, + this.page, + this.offset, + this.length, + this.aroundLatLng, + this.aroundLatLngViaIP, + this.aroundRadius, + this.aroundPrecision, + this.minimumAroundRadius, + this.insideBoundingBox, + this.insidePolygon, + this.naturalLanguages, + this.ruleContexts, + this.personalizationImpact, + this.userToken, + this.getRankingInfo, + this.clickAnalytics, + this.analytics, + this.analyticsTags, + this.percentileComputation, + this.enableABTest, + this.enableReRanking, + this.reRankingApplyFilter, + }); + + /// Overrides the query parameter and performs a more generic search. + @JsonKey(name: r'similarQuery') + final String? similarQuery; + + /// [Filter](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/) the query with numeric, facet, or tag filters. + @JsonKey(name: r'filters') + final String? filters; + + /// One of types: + /// - [List>] + /// - [String] + /// - [List] + @JsonKey(name: r'facetFilters') + final dynamic facetFilters; + + /// One of types: + /// - [List>] + /// - [String] + /// - [List] + @JsonKey(name: r'optionalFilters') + final dynamic optionalFilters; + + /// One of types: + /// - [List>] + /// - [String] + /// - [List] + @JsonKey(name: r'numericFilters') + final dynamic numericFilters; + + /// One of types: + /// - [List>] + /// - [String] + /// - [List] + @JsonKey(name: r'tagFilters') + final dynamic tagFilters; + + /// Determines how to calculate [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores). If `false`, maximum score is kept. If `true`, score is summed. + @JsonKey(name: r'sumOrFiltersScores') + final bool? sumOrFiltersScores; + + /// Returns [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts), their facet values, and the number of matching facet values. + @JsonKey(name: r'facets') + final List? facets; + + /// Maximum number of facet values to return for each facet. + @JsonKey(name: r'maxValuesPerFacet') + final int? maxValuesPerFacet; + + /// Forces faceting to be applied after [de-duplication](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/) (with the distinct feature). Alternatively, the `afterDistinct` [modifier](https://www.algolia.com/doc/api-reference/api-parameters/attributesForFaceting/#modifiers) of `attributesForFaceting` allows for more granular control. + @JsonKey(name: r'facetingAfterDistinct') + final bool? facetingAfterDistinct; + + /// Controls how facet values are fetched. + @JsonKey(name: r'sortFacetValuesBy') + final String? sortFacetValuesBy; + + /// Page to retrieve (the first page is `0`, not `1`). + @JsonKey(name: r'page') + final int? page; + + /// Specifies the offset of the first hit to return. > **Note**: Using `page` and `hitsPerPage` is the recommended method for [paging results](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/). However, you can use `offset` and `length` to implement [an alternative approach to paging](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/#retrieving-a-subset-of-records-with-offset-and-length). + @JsonKey(name: r'offset') + final int? offset; + + /// Sets the number of hits to retrieve (for use with `offset`). > **Note**: Using `page` and `hitsPerPage` is the recommended method for [paging results](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/). However, you can use `offset` and `length` to implement [an alternative approach to paging](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/#retrieving-a-subset-of-records-with-offset-and-length). + // minimum: 1 + // maximum: 1000 + @JsonKey(name: r'length') + final int? length; + + /// Search for entries [around a central location](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filter-around-a-central-point), enabling a geographical search within a circular area. + @JsonKey(name: r'aroundLatLng') + final String? aroundLatLng; + + /// Search for entries around a location. The location is automatically computed from the requester's IP address. + @JsonKey(name: r'aroundLatLngViaIP') + final bool? aroundLatLngViaIP; + + /// One of types: + /// - [AroundRadiusAll] + /// - [int] + @JsonKey(name: r'aroundRadius') + final dynamic aroundRadius; + + /// Precision of a geographical search (in meters), to [group results that are more or less the same distance from a central point](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/in-depth/geo-ranking-precision/). + @JsonKey(name: r'aroundPrecision') + final int? aroundPrecision; + + /// Minimum radius (in meters) used for a geographical search when `aroundRadius` isn't set. + // minimum: 1 + @JsonKey(name: r'minimumAroundRadius') + final int? minimumAroundRadius; + + /// Search inside a [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas) (in geographical coordinates). + @JsonKey(name: r'insideBoundingBox') + final List? insideBoundingBox; + + /// Search inside a [polygon](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas) (in geographical coordinates). + @JsonKey(name: r'insidePolygon') + final List? insidePolygon; + + /// Changes the default values of parameters that work best for a natural language query, such as `ignorePlurals`, `removeStopWords`, `removeWordsIfNoResults`, `analyticsTags`, and `ruleContexts`. These parameters work well together when the query consists of fuller natural language strings instead of keywords, for example when processing voice search queries. + @JsonKey(name: r'naturalLanguages') + final List? naturalLanguages; + + /// Assigns [rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) to search queries. + @JsonKey(name: r'ruleContexts') + final List? ruleContexts; + + /// Defines how much [Personalization affects results](https://www.algolia.com/doc/guides/personalization/personalizing-results/in-depth/configuring-personalization/#understanding-personalization-impact). + @JsonKey(name: r'personalizationImpact') + final int? personalizationImpact; + + /// Associates a [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/) with the current search. + @JsonKey(name: r'userToken') + final String? userToken; + + /// Incidates whether the search response includes [detailed ranking information](https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/understanding-the-api-response/#ranking-information). + @JsonKey(name: r'getRankingInfo') + final bool? getRankingInfo; + + /// Indicates whether a query ID parameter is included in the search response. This is required for [tracking click and conversion events](https://www.algolia.com/doc/guides/sending-events/concepts/event-types/#events-related-to-algolia-requests). + @JsonKey(name: r'clickAnalytics') + final bool? clickAnalytics; + + /// Indicates whether this query will be included in [analytics](https://www.algolia.com/doc/guides/search-analytics/guides/exclude-queries/). + @JsonKey(name: r'analytics') + final bool? analytics; + + /// Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/). + @JsonKey(name: r'analyticsTags') + final List? analyticsTags; + + /// Whether to include or exclude a query from the processing-time percentile computation. + @JsonKey(name: r'percentileComputation') + final bool? percentileComputation; + + /// Incidates whether this search will be considered in A/B testing. + @JsonKey(name: r'enableABTest') + final bool? enableABTest; + + /// Indicates whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). + @JsonKey(name: r'enableReRanking') + final bool? enableReRanking; + + /// One of types: + /// - [List>] + /// - [String] + /// - [List] + @JsonKey(name: r'reRankingApplyFilter') + final dynamic reRankingApplyFilter; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BaseSearchParamsWithoutQuery && + other.similarQuery == similarQuery && + other.filters == filters && + other.facetFilters == facetFilters && + other.optionalFilters == optionalFilters && + other.numericFilters == numericFilters && + other.tagFilters == tagFilters && + other.sumOrFiltersScores == sumOrFiltersScores && + other.facets == facets && + other.maxValuesPerFacet == maxValuesPerFacet && + other.facetingAfterDistinct == facetingAfterDistinct && + other.sortFacetValuesBy == sortFacetValuesBy && + other.page == page && + other.offset == offset && + other.length == length && + other.aroundLatLng == aroundLatLng && + other.aroundLatLngViaIP == aroundLatLngViaIP && + other.aroundRadius == aroundRadius && + other.aroundPrecision == aroundPrecision && + other.minimumAroundRadius == minimumAroundRadius && + other.insideBoundingBox == insideBoundingBox && + other.insidePolygon == insidePolygon && + other.naturalLanguages == naturalLanguages && + other.ruleContexts == ruleContexts && + other.personalizationImpact == personalizationImpact && + other.userToken == userToken && + other.getRankingInfo == getRankingInfo && + other.clickAnalytics == clickAnalytics && + other.analytics == analytics && + other.analyticsTags == analyticsTags && + other.percentileComputation == percentileComputation && + other.enableABTest == enableABTest && + other.enableReRanking == enableReRanking && + other.reRankingApplyFilter == reRankingApplyFilter; + + @override + int get hashCode => + similarQuery.hashCode + + filters.hashCode + + facetFilters.hashCode + + optionalFilters.hashCode + + numericFilters.hashCode + + tagFilters.hashCode + + sumOrFiltersScores.hashCode + + facets.hashCode + + maxValuesPerFacet.hashCode + + facetingAfterDistinct.hashCode + + sortFacetValuesBy.hashCode + + page.hashCode + + offset.hashCode + + length.hashCode + + aroundLatLng.hashCode + + aroundLatLngViaIP.hashCode + + aroundRadius.hashCode + + aroundPrecision.hashCode + + minimumAroundRadius.hashCode + + insideBoundingBox.hashCode + + insidePolygon.hashCode + + naturalLanguages.hashCode + + ruleContexts.hashCode + + personalizationImpact.hashCode + + userToken.hashCode + + getRankingInfo.hashCode + + clickAnalytics.hashCode + + analytics.hashCode + + analyticsTags.hashCode + + percentileComputation.hashCode + + enableABTest.hashCode + + enableReRanking.hashCode + + (reRankingApplyFilter == null ? 0 : reRankingApplyFilter.hashCode); + + factory BaseSearchParamsWithoutQuery.fromJson(Map json) => + _$BaseSearchParamsWithoutQueryFromJson(json); + + Map toJson() => _$BaseSearchParamsWithoutQueryToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_params_without_query.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_params_without_query.g.dart new file mode 100644 index 0000000000..5e49b24127 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_params_without_query.g.dart @@ -0,0 +1,120 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'base_search_params_without_query.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BaseSearchParamsWithoutQuery _$BaseSearchParamsWithoutQueryFromJson( + Map json) => + $checkedCreate( + 'BaseSearchParamsWithoutQuery', + json, + ($checkedConvert) { + final val = BaseSearchParamsWithoutQuery( + similarQuery: $checkedConvert('similarQuery', (v) => v as String?), + filters: $checkedConvert('filters', (v) => v as String?), + facetFilters: $checkedConvert('facetFilters', (v) => v), + optionalFilters: $checkedConvert('optionalFilters', (v) => v), + numericFilters: $checkedConvert('numericFilters', (v) => v), + tagFilters: $checkedConvert('tagFilters', (v) => v), + sumOrFiltersScores: + $checkedConvert('sumOrFiltersScores', (v) => v as bool?), + facets: $checkedConvert('facets', + (v) => (v as List?)?.map((e) => e as String).toList()), + maxValuesPerFacet: + $checkedConvert('maxValuesPerFacet', (v) => v as int?), + facetingAfterDistinct: + $checkedConvert('facetingAfterDistinct', (v) => v as bool?), + sortFacetValuesBy: + $checkedConvert('sortFacetValuesBy', (v) => v as String?), + page: $checkedConvert('page', (v) => v as int?), + offset: $checkedConvert('offset', (v) => v as int?), + length: $checkedConvert('length', (v) => v as int?), + aroundLatLng: $checkedConvert('aroundLatLng', (v) => v as String?), + aroundLatLngViaIP: + $checkedConvert('aroundLatLngViaIP', (v) => v as bool?), + aroundRadius: $checkedConvert('aroundRadius', (v) => v), + aroundPrecision: $checkedConvert('aroundPrecision', (v) => v as int?), + minimumAroundRadius: + $checkedConvert('minimumAroundRadius', (v) => v as int?), + insideBoundingBox: $checkedConvert( + 'insideBoundingBox', + (v) => (v as List?) + ?.map((e) => (e as num).toDouble()) + .toList()), + insidePolygon: $checkedConvert( + 'insidePolygon', + (v) => (v as List?) + ?.map((e) => (e as num).toDouble()) + .toList()), + naturalLanguages: $checkedConvert('naturalLanguages', + (v) => (v as List?)?.map((e) => e as String).toList()), + ruleContexts: $checkedConvert('ruleContexts', + (v) => (v as List?)?.map((e) => e as String).toList()), + personalizationImpact: + $checkedConvert('personalizationImpact', (v) => v as int?), + userToken: $checkedConvert('userToken', (v) => v as String?), + getRankingInfo: $checkedConvert('getRankingInfo', (v) => v as bool?), + clickAnalytics: $checkedConvert('clickAnalytics', (v) => v as bool?), + analytics: $checkedConvert('analytics', (v) => v as bool?), + analyticsTags: $checkedConvert('analyticsTags', + (v) => (v as List?)?.map((e) => e as String).toList()), + percentileComputation: + $checkedConvert('percentileComputation', (v) => v as bool?), + enableABTest: $checkedConvert('enableABTest', (v) => v as bool?), + enableReRanking: + $checkedConvert('enableReRanking', (v) => v as bool?), + reRankingApplyFilter: + $checkedConvert('reRankingApplyFilter', (v) => v), + ); + return val; + }, + ); + +Map _$BaseSearchParamsWithoutQueryToJson( + BaseSearchParamsWithoutQuery instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('similarQuery', instance.similarQuery); + writeNotNull('filters', instance.filters); + writeNotNull('facetFilters', instance.facetFilters); + writeNotNull('optionalFilters', instance.optionalFilters); + writeNotNull('numericFilters', instance.numericFilters); + writeNotNull('tagFilters', instance.tagFilters); + writeNotNull('sumOrFiltersScores', instance.sumOrFiltersScores); + writeNotNull('facets', instance.facets); + writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); + writeNotNull('facetingAfterDistinct', instance.facetingAfterDistinct); + writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); + writeNotNull('page', instance.page); + writeNotNull('offset', instance.offset); + writeNotNull('length', instance.length); + writeNotNull('aroundLatLng', instance.aroundLatLng); + writeNotNull('aroundLatLngViaIP', instance.aroundLatLngViaIP); + writeNotNull('aroundRadius', instance.aroundRadius); + writeNotNull('aroundPrecision', instance.aroundPrecision); + writeNotNull('minimumAroundRadius', instance.minimumAroundRadius); + writeNotNull('insideBoundingBox', instance.insideBoundingBox); + writeNotNull('insidePolygon', instance.insidePolygon); + writeNotNull('naturalLanguages', instance.naturalLanguages); + writeNotNull('ruleContexts', instance.ruleContexts); + writeNotNull('personalizationImpact', instance.personalizationImpact); + writeNotNull('userToken', instance.userToken); + writeNotNull('getRankingInfo', instance.getRankingInfo); + writeNotNull('clickAnalytics', instance.clickAnalytics); + writeNotNull('analytics', instance.analytics); + writeNotNull('analyticsTags', instance.analyticsTags); + writeNotNull('percentileComputation', instance.percentileComputation); + writeNotNull('enableABTest', instance.enableABTest); + writeNotNull('enableReRanking', instance.enableReRanking); + writeNotNull('reRankingApplyFilter', instance.reRankingApplyFilter); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_response.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_response.dart new file mode 100644 index 0000000000..f7cdfb7573 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_response.dart @@ -0,0 +1,217 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/base_search_response_redirect.dart'; +import 'package:algolia_client_recommend/src/model/facets_stats.dart'; +import 'package:algolia_client_recommend/src/model/rendering_content.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'base_search_response.g.dart'; + +@JsonSerializable() +final class BaseSearchResponse { + /// Returns a new [BaseSearchResponse] instance. + const BaseSearchResponse({ + this.abTestID, + this.abTestVariantID, + this.aroundLatLng, + this.automaticRadius, + this.exhaustiveFacetsCount, + required this.exhaustiveNbHits, + this.exhaustiveTypo, + this.facets, + this.facetsStats, + required this.hitsPerPage, + this.index, + this.indexUsed, + this.message, + required this.nbHits, + required this.nbPages, + this.nbSortedHits, + required this.page, + required this.params, + this.redirect, + this.parsedQuery, + required this.processingTimeMS, + required this.query, + this.queryAfterRemoval, + this.serverUsed, + this.userData, + this.renderingContent, + }); + + /// A/B test ID. This is only included in the response for indices that are part of an A/B test. + @JsonKey(name: r'abTestID') + final int? abTestID; + + /// Variant ID. This is only included in the response for indices that are part of an A/B test. + // minimum: 1 + @JsonKey(name: r'abTestVariantID') + final int? abTestVariantID; + + /// Computed geographical location. + @JsonKey(name: r'aroundLatLng') + final String? aroundLatLng; + + /// Automatically-computed radius. + @JsonKey(name: r'automaticRadius') + final String? automaticRadius; + + /// Indicates whether the facet count is exhaustive (exact) or approximate. + @JsonKey(name: r'exhaustiveFacetsCount') + final bool? exhaustiveFacetsCount; + + /// Indicates whether the number of hits `nbHits` is exhaustive (exact) or approximate. + @JsonKey(name: r'exhaustiveNbHits') + final bool exhaustiveNbHits; + + /// Indicates whether the search for typos was exhaustive (exact) or approximate. + @JsonKey(name: r'exhaustiveTypo') + final bool? exhaustiveTypo; + + /// Mapping of each facet name to the corresponding facet counts. + @JsonKey(name: r'facets') + final Map>? facets; + + /// Statistics for numerical facets. + @JsonKey(name: r'facets_stats') + final Map? facetsStats; + + /// Number of hits per page. + // minimum: 1 + // maximum: 1000 + @JsonKey(name: r'hitsPerPage') + final int hitsPerPage; + + /// Index name used for the query. + @JsonKey(name: r'index') + final String? index; + + /// Index name used for the query. During A/B testing, the targeted index isn't always the index used by the query. + @JsonKey(name: r'indexUsed') + final String? indexUsed; + + /// Warnings about the query. + @JsonKey(name: r'message') + final String? message; + + /// Number of hits the search query matched. + @JsonKey(name: r'nbHits') + final int nbHits; + + /// Number of pages of results for the current query. + @JsonKey(name: r'nbPages') + final int nbPages; + + /// Number of hits selected and sorted by the relevant sort algorithm. + @JsonKey(name: r'nbSortedHits') + final int? nbSortedHits; + + /// Page to retrieve (the first page is `0`, not `1`). + @JsonKey(name: r'page') + final int page; + + /// URL-encoded string of all search parameters. + @JsonKey(name: r'params') + final String params; + + @JsonKey(name: r'redirect') + final BaseSearchResponseRedirect? redirect; + + /// Post-[normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/#what-does-normalization-mean) query string that will be searched. + @JsonKey(name: r'parsedQuery') + final String? parsedQuery; + + /// Time the server took to process the request, in milliseconds. + @JsonKey(name: r'processingTimeMS') + final int processingTimeMS; + + /// Text to search for in an index. + @JsonKey(name: r'query') + final String query; + + /// Markup text indicating which parts of the original query have been removed to retrieve a non-empty result set. + @JsonKey(name: r'queryAfterRemoval') + final String? queryAfterRemoval; + + /// Host name of the server that processed the request. + @JsonKey(name: r'serverUsed') + final String? serverUsed; + + /// Lets you store custom data in your indices. + @JsonKey(name: r'userData') + final Object? userData; + + @JsonKey(name: r'renderingContent') + final RenderingContent? renderingContent; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BaseSearchResponse && + other.abTestID == abTestID && + other.abTestVariantID == abTestVariantID && + other.aroundLatLng == aroundLatLng && + other.automaticRadius == automaticRadius && + other.exhaustiveFacetsCount == exhaustiveFacetsCount && + other.exhaustiveNbHits == exhaustiveNbHits && + other.exhaustiveTypo == exhaustiveTypo && + other.facets == facets && + other.facetsStats == facetsStats && + other.hitsPerPage == hitsPerPage && + other.index == index && + other.indexUsed == indexUsed && + other.message == message && + other.nbHits == nbHits && + other.nbPages == nbPages && + other.nbSortedHits == nbSortedHits && + other.page == page && + other.params == params && + other.redirect == redirect && + other.parsedQuery == parsedQuery && + other.processingTimeMS == processingTimeMS && + other.query == query && + other.queryAfterRemoval == queryAfterRemoval && + other.serverUsed == serverUsed && + other.userData == userData && + other.renderingContent == renderingContent; + + @override + int get hashCode => + abTestID.hashCode + + abTestVariantID.hashCode + + aroundLatLng.hashCode + + automaticRadius.hashCode + + exhaustiveFacetsCount.hashCode + + exhaustiveNbHits.hashCode + + exhaustiveTypo.hashCode + + facets.hashCode + + facetsStats.hashCode + + hitsPerPage.hashCode + + index.hashCode + + indexUsed.hashCode + + message.hashCode + + nbHits.hashCode + + nbPages.hashCode + + nbSortedHits.hashCode + + page.hashCode + + params.hashCode + + redirect.hashCode + + parsedQuery.hashCode + + processingTimeMS.hashCode + + query.hashCode + + queryAfterRemoval.hashCode + + serverUsed.hashCode + + userData.hashCode + + renderingContent.hashCode; + + factory BaseSearchResponse.fromJson(Map json) => + _$BaseSearchResponseFromJson(json); + + Map toJson() => _$BaseSearchResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_response.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_response.g.dart new file mode 100644 index 0000000000..be3a5d4ff2 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_response.g.dart @@ -0,0 +1,107 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'base_search_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BaseSearchResponse _$BaseSearchResponseFromJson(Map json) => + $checkedCreate( + 'BaseSearchResponse', + json, + ($checkedConvert) { + final val = BaseSearchResponse( + abTestID: $checkedConvert('abTestID', (v) => v as int?), + abTestVariantID: $checkedConvert('abTestVariantID', (v) => v as int?), + aroundLatLng: $checkedConvert('aroundLatLng', (v) => v as String?), + automaticRadius: + $checkedConvert('automaticRadius', (v) => v as String?), + exhaustiveFacetsCount: + $checkedConvert('exhaustiveFacetsCount', (v) => v as bool?), + exhaustiveNbHits: + $checkedConvert('exhaustiveNbHits', (v) => v as bool), + exhaustiveTypo: $checkedConvert('exhaustiveTypo', (v) => v as bool?), + facets: $checkedConvert( + 'facets', + (v) => (v as Map?)?.map( + (k, e) => MapEntry(k, Map.from(e as Map)), + )), + facetsStats: $checkedConvert( + 'facets_stats', + (v) => (v as Map?)?.map( + (k, e) => MapEntry( + k, FacetsStats.fromJson(e as Map)), + )), + hitsPerPage: $checkedConvert('hitsPerPage', (v) => v as int), + index: $checkedConvert('index', (v) => v as String?), + indexUsed: $checkedConvert('indexUsed', (v) => v as String?), + message: $checkedConvert('message', (v) => v as String?), + nbHits: $checkedConvert('nbHits', (v) => v as int), + nbPages: $checkedConvert('nbPages', (v) => v as int), + nbSortedHits: $checkedConvert('nbSortedHits', (v) => v as int?), + page: $checkedConvert('page', (v) => v as int), + params: $checkedConvert('params', (v) => v as String), + redirect: $checkedConvert( + 'redirect', + (v) => v == null + ? null + : BaseSearchResponseRedirect.fromJson( + v as Map)), + parsedQuery: $checkedConvert('parsedQuery', (v) => v as String?), + processingTimeMS: + $checkedConvert('processingTimeMS', (v) => v as int), + query: $checkedConvert('query', (v) => v as String), + queryAfterRemoval: + $checkedConvert('queryAfterRemoval', (v) => v as String?), + serverUsed: $checkedConvert('serverUsed', (v) => v as String?), + userData: $checkedConvert('userData', (v) => v), + renderingContent: $checkedConvert( + 'renderingContent', + (v) => v == null + ? null + : RenderingContent.fromJson(v as Map)), + ); + return val; + }, + fieldKeyMap: const {'facetsStats': 'facets_stats'}, + ); + +Map _$BaseSearchResponseToJson(BaseSearchResponse instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('abTestID', instance.abTestID); + writeNotNull('abTestVariantID', instance.abTestVariantID); + writeNotNull('aroundLatLng', instance.aroundLatLng); + writeNotNull('automaticRadius', instance.automaticRadius); + writeNotNull('exhaustiveFacetsCount', instance.exhaustiveFacetsCount); + val['exhaustiveNbHits'] = instance.exhaustiveNbHits; + writeNotNull('exhaustiveTypo', instance.exhaustiveTypo); + writeNotNull('facets', instance.facets); + writeNotNull('facets_stats', + instance.facetsStats?.map((k, e) => MapEntry(k, e.toJson()))); + val['hitsPerPage'] = instance.hitsPerPage; + writeNotNull('index', instance.index); + writeNotNull('indexUsed', instance.indexUsed); + writeNotNull('message', instance.message); + val['nbHits'] = instance.nbHits; + val['nbPages'] = instance.nbPages; + writeNotNull('nbSortedHits', instance.nbSortedHits); + val['page'] = instance.page; + val['params'] = instance.params; + writeNotNull('redirect', instance.redirect?.toJson()); + writeNotNull('parsedQuery', instance.parsedQuery); + val['processingTimeMS'] = instance.processingTimeMS; + val['query'] = instance.query; + writeNotNull('queryAfterRemoval', instance.queryAfterRemoval); + writeNotNull('serverUsed', instance.serverUsed); + writeNotNull('userData', instance.userData); + writeNotNull('renderingContent', instance.renderingContent?.toJson()); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_response_redirect.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_response_redirect.dart new file mode 100644 index 0000000000..3a0d567c53 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_response_redirect.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/redirect_rule_index_metadata.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'base_search_response_redirect.g.dart'; + +@JsonSerializable() +final class BaseSearchResponseRedirect { + /// Returns a new [BaseSearchResponseRedirect] instance. + const BaseSearchResponseRedirect({ + this.index, + }); + + @JsonKey(name: r'index') + final List? index; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BaseSearchResponseRedirect && other.index == index; + + @override + int get hashCode => index.hashCode; + + factory BaseSearchResponseRedirect.fromJson(Map json) => + _$BaseSearchResponseRedirectFromJson(json); + + Map toJson() => _$BaseSearchResponseRedirectToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_response_redirect.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_response_redirect.g.dart new file mode 100644 index 0000000000..af32790191 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_search_response_redirect.g.dart @@ -0,0 +1,39 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'base_search_response_redirect.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BaseSearchResponseRedirect _$BaseSearchResponseRedirectFromJson( + Map json) => + $checkedCreate( + 'BaseSearchResponseRedirect', + json, + ($checkedConvert) { + final val = BaseSearchResponseRedirect( + index: $checkedConvert( + 'index', + (v) => (v as List?) + ?.map((e) => RedirectRuleIndexMetadata.fromJson( + e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$BaseSearchResponseRedirectToJson( + BaseSearchResponseRedirect instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('index', instance.index?.map((e) => e.toJson()).toList()); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_trending_request.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_trending_request.dart new file mode 100644 index 0000000000..904ca05eed --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_trending_request.dart @@ -0,0 +1,49 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/trending_models.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'base_trending_request.g.dart'; + +@JsonSerializable() +final class BaseTrendingRequest { + /// Returns a new [BaseTrendingRequest] instance. + const BaseTrendingRequest({ + required this.model, + this.facetName, + this.facetValue, + }); + + @JsonKey(name: r'model') + final TrendingModels model; + + /// Facet name for trending models. + @JsonKey(name: r'facetName') + final String? facetName; + + /// Facet value for trending models. + @JsonKey(name: r'facetValue') + final String? facetValue; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BaseTrendingRequest && + other.model == model && + other.facetName == facetName && + other.facetValue == facetValue; + + @override + int get hashCode => model.hashCode + facetName.hashCode + facetValue.hashCode; + + factory BaseTrendingRequest.fromJson(Map json) => + _$BaseTrendingRequestFromJson(json); + + Map toJson() => _$BaseTrendingRequestToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_trending_request.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_trending_request.g.dart new file mode 100644 index 0000000000..b02184c080 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/base_trending_request.g.dart @@ -0,0 +1,43 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'base_trending_request.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BaseTrendingRequest _$BaseTrendingRequestFromJson(Map json) => + $checkedCreate( + 'BaseTrendingRequest', + json, + ($checkedConvert) { + final val = BaseTrendingRequest( + model: $checkedConvert( + 'model', (v) => $enumDecode(_$TrendingModelsEnumMap, v)), + facetName: $checkedConvert('facetName', (v) => v as String?), + facetValue: $checkedConvert('facetValue', (v) => v as String?), + ); + return val; + }, + ); + +Map _$BaseTrendingRequestToJson(BaseTrendingRequest instance) { + final val = { + 'model': instance.model.toJson(), + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('facetName', instance.facetName); + writeNotNull('facetValue', instance.facetValue); + return val; +} + +const _$TrendingModelsEnumMap = { + TrendingModels.facets: 'trending-facets', + TrendingModels.items: 'trending-items', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/condition.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/condition.dart new file mode 100644 index 0000000000..5374c07485 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/condition.dart @@ -0,0 +1,59 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/anchoring.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'condition.g.dart'; + +@JsonSerializable() +final class Condition { + /// Returns a new [Condition] instance. + const Condition({ + this.pattern, + this.anchoring, + this.alternatives, + this.context, + }); + + /// Query pattern syntax. + @JsonKey(name: r'pattern') + final String? pattern; + + @JsonKey(name: r'anchoring') + final Anchoring? anchoring; + + /// Whether the pattern matches on plurals, synonyms, and typos. + @JsonKey(name: r'alternatives') + final bool? alternatives; + + /// Rule context format: [A-Za-z0-9_-]+). + @JsonKey(name: r'context') + final String? context; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Condition && + other.pattern == pattern && + other.anchoring == anchoring && + other.alternatives == alternatives && + other.context == context; + + @override + int get hashCode => + pattern.hashCode + + anchoring.hashCode + + alternatives.hashCode + + context.hashCode; + + factory Condition.fromJson(Map json) => + _$ConditionFromJson(json); + + Map toJson() => _$ConditionToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/condition.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/condition.g.dart new file mode 100644 index 0000000000..af4d41cf04 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/condition.g.dart @@ -0,0 +1,45 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'condition.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Condition _$ConditionFromJson(Map json) => $checkedCreate( + 'Condition', + json, + ($checkedConvert) { + final val = Condition( + pattern: $checkedConvert('pattern', (v) => v as String?), + anchoring: $checkedConvert( + 'anchoring', (v) => $enumDecodeNullable(_$AnchoringEnumMap, v)), + alternatives: $checkedConvert('alternatives', (v) => v as bool?), + context: $checkedConvert('context', (v) => v as String?), + ); + return val; + }, + ); + +Map _$ConditionToJson(Condition instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('pattern', instance.pattern); + writeNotNull('anchoring', instance.anchoring?.toJson()); + writeNotNull('alternatives', instance.alternatives); + writeNotNull('context', instance.context); + return val; +} + +const _$AnchoringEnumMap = { + Anchoring.is_: 'is', + Anchoring.startsWith: 'startsWith', + Anchoring.endsWith: 'endsWith', + Anchoring.contains: 'contains', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence.dart new file mode 100644 index 0000000000..47fc89270e --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence.dart @@ -0,0 +1,70 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/consequence_hide.dart'; +import 'package:algolia_client_recommend/src/model/consequence_params.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'consequence.g.dart'; + +@JsonSerializable() +final class Consequence { + /// Returns a new [Consequence] instance. + const Consequence({ + this.params, + this.promote, + this.filterPromotes, + this.hide, + this.userData, + }); + + @JsonKey(name: r'params') + final ConsequenceParams? params; + + /// Records to promote. + /// One of types: + /// - [PromoteObjectIDs] + /// - [PromoteObjectID] + @JsonKey(name: r'promote') + final Iterable? promote; + + /// Only use in combination with the `promote` consequence. When `true`, promoted results will be restricted to match the filters of the current search. When `false`, the promoted results will show up regardless of the filters. + @JsonKey(name: r'filterPromotes') + final bool? filterPromotes; + + /// Records to hide. By default, you can hide up to 50 records per rule. + @JsonKey(name: r'hide') + final List? hide; + + /// Custom JSON object that will be appended to the userData array in the response. This object isn't interpreted by the API. It's limited to 1kB of minified JSON. + @JsonKey(name: r'userData') + final Object? userData; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Consequence && + other.params == params && + other.promote == promote && + other.filterPromotes == filterPromotes && + other.hide == hide && + other.userData == userData; + + @override + int get hashCode => + params.hashCode + + promote.hashCode + + filterPromotes.hashCode + + hide.hashCode + + userData.hashCode; + + factory Consequence.fromJson(Map json) => + _$ConsequenceFromJson(json); + + Map toJson() => _$ConsequenceToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence.g.dart new file mode 100644 index 0000000000..8b5c2406dd --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence.g.dart @@ -0,0 +1,48 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'consequence.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Consequence _$ConsequenceFromJson(Map json) => $checkedCreate( + 'Consequence', + json, + ($checkedConvert) { + final val = Consequence( + params: $checkedConvert( + 'params', + (v) => v == null + ? null + : ConsequenceParams.fromJson(v as Map)), + promote: $checkedConvert('promote', (v) => v as List?), + filterPromotes: $checkedConvert('filterPromotes', (v) => v as bool?), + hide: $checkedConvert( + 'hide', + (v) => (v as List?) + ?.map((e) => + ConsequenceHide.fromJson(e as Map)) + .toList()), + userData: $checkedConvert('userData', (v) => v), + ); + return val; + }, + ); + +Map _$ConsequenceToJson(Consequence instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('params', instance.params?.toJson()); + writeNotNull('promote', instance.promote?.toList()); + writeNotNull('filterPromotes', instance.filterPromotes); + writeNotNull('hide', instance.hide?.map((e) => e.toJson()).toList()); + writeNotNull('userData', instance.userData); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_hide.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_hide.dart new file mode 100644 index 0000000000..4e18b0bf37 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_hide.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'consequence_hide.g.dart'; + +@JsonSerializable() +final class ConsequenceHide { + /// Returns a new [ConsequenceHide] instance. + const ConsequenceHide({ + required this.objectID, + }); + + /// Unique object identifier. + @JsonKey(name: r'objectID') + final String objectID; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ConsequenceHide && other.objectID == objectID; + + @override + int get hashCode => objectID.hashCode; + + factory ConsequenceHide.fromJson(Map json) => + _$ConsequenceHideFromJson(json); + + Map toJson() => _$ConsequenceHideToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_hide.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_hide.g.dart new file mode 100644 index 0000000000..fb61ff035d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_hide.g.dart @@ -0,0 +1,24 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'consequence_hide.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ConsequenceHide _$ConsequenceHideFromJson(Map json) => + $checkedCreate( + 'ConsequenceHide', + json, + ($checkedConvert) { + final val = ConsequenceHide( + objectID: $checkedConvert('objectID', (v) => v as String), + ); + return val; + }, + ); + +Map _$ConsequenceHideToJson(ConsequenceHide instance) => + { + 'objectID': instance.objectID, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_params.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_params.dart new file mode 100644 index 0000000000..75691ccff0 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_params.dart @@ -0,0 +1,642 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/query_type.dart'; +import 'package:algolia_client_recommend/src/model/alternatives_as_exact.dart'; +import 'package:algolia_client_recommend/src/model/index_settings_as_search_params_semantic_search.dart'; +import 'package:algolia_client_recommend/src/model/advanced_syntax_features.dart'; +import 'package:algolia_client_recommend/src/model/remove_words_if_no_results.dart'; +import 'package:algolia_client_recommend/src/model/exact_on_single_word_query.dart'; +import 'package:algolia_client_recommend/src/model/mode.dart'; +import 'package:algolia_client_recommend/src/model/rendering_content.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'consequence_params.g.dart'; + +@JsonSerializable() +final class ConsequenceParams { + /// Returns a new [ConsequenceParams] instance. + const ConsequenceParams({ + this.similarQuery, + this.filters, + this.facetFilters, + this.optionalFilters, + this.numericFilters, + this.tagFilters, + this.sumOrFiltersScores, + this.facets, + this.maxValuesPerFacet, + this.facetingAfterDistinct, + this.sortFacetValuesBy, + this.page, + this.offset, + this.length, + this.aroundLatLng, + this.aroundLatLngViaIP, + this.aroundRadius, + this.aroundPrecision, + this.minimumAroundRadius, + this.insideBoundingBox, + this.insidePolygon, + this.naturalLanguages, + this.ruleContexts, + this.personalizationImpact, + this.userToken, + this.getRankingInfo, + this.clickAnalytics, + this.analytics, + this.analyticsTags, + this.percentileComputation, + this.enableABTest, + this.enableReRanking, + this.reRankingApplyFilter, + this.attributesForFaceting, + this.attributesToRetrieve, + this.restrictSearchableAttributes, + this.ranking, + this.customRanking, + this.relevancyStrictness, + this.attributesToHighlight, + this.attributesToSnippet, + this.highlightPreTag, + this.highlightPostTag, + this.snippetEllipsisText, + this.restrictHighlightAndSnippetArrays, + this.hitsPerPage, + this.minWordSizefor1Typo, + this.minWordSizefor2Typos, + this.typoTolerance, + this.allowTyposOnNumericTokens, + this.disableTypoToleranceOnAttributes, + this.ignorePlurals, + this.removeStopWords, + this.keepDiacriticsOnCharacters, + this.queryLanguages, + this.decompoundQuery, + this.enableRules, + this.enablePersonalization, + this.queryType, + this.removeWordsIfNoResults, + this.mode, + this.semanticSearch, + this.advancedSyntax, + this.optionalWords, + this.disableExactOnAttributes, + this.exactOnSingleWordQuery, + this.alternativesAsExact, + this.advancedSyntaxFeatures, + this.explain, + this.distinct, + this.attributeForDistinct, + this.synonyms, + this.replaceSynonymsInHighlight, + this.minProximity, + this.responseFields, + this.maxFacetHits, + this.attributeCriteriaComputedByMinProximity, + this.renderingContent, + this.query, + this.automaticFacetFilters, + this.automaticOptionalFacetFilters, + }); + + /// Overrides the query parameter and performs a more generic search. + @JsonKey(name: r'similarQuery') + final String? similarQuery; + + /// [Filter](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/) the query with numeric, facet, or tag filters. + @JsonKey(name: r'filters') + final String? filters; + + /// One of types: + /// - [List>] + /// - [String] + /// - [List] + @JsonKey(name: r'facetFilters') + final dynamic facetFilters; + + /// One of types: + /// - [List>] + /// - [String] + /// - [List] + @JsonKey(name: r'optionalFilters') + final dynamic optionalFilters; + + /// One of types: + /// - [List>] + /// - [String] + /// - [List] + @JsonKey(name: r'numericFilters') + final dynamic numericFilters; + + /// One of types: + /// - [List>] + /// - [String] + /// - [List] + @JsonKey(name: r'tagFilters') + final dynamic tagFilters; + + /// Determines how to calculate [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores). If `false`, maximum score is kept. If `true`, score is summed. + @JsonKey(name: r'sumOrFiltersScores') + final bool? sumOrFiltersScores; + + /// Returns [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts), their facet values, and the number of matching facet values. + @JsonKey(name: r'facets') + final List? facets; + + /// Maximum number of facet values to return for each facet. + @JsonKey(name: r'maxValuesPerFacet') + final int? maxValuesPerFacet; + + /// Forces faceting to be applied after [de-duplication](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/) (with the distinct feature). Alternatively, the `afterDistinct` [modifier](https://www.algolia.com/doc/api-reference/api-parameters/attributesForFaceting/#modifiers) of `attributesForFaceting` allows for more granular control. + @JsonKey(name: r'facetingAfterDistinct') + final bool? facetingAfterDistinct; + + /// Controls how facet values are fetched. + @JsonKey(name: r'sortFacetValuesBy') + final String? sortFacetValuesBy; + + /// Page to retrieve (the first page is `0`, not `1`). + @JsonKey(name: r'page') + final int? page; + + /// Specifies the offset of the first hit to return. > **Note**: Using `page` and `hitsPerPage` is the recommended method for [paging results](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/). However, you can use `offset` and `length` to implement [an alternative approach to paging](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/#retrieving-a-subset-of-records-with-offset-and-length). + @JsonKey(name: r'offset') + final int? offset; + + /// Sets the number of hits to retrieve (for use with `offset`). > **Note**: Using `page` and `hitsPerPage` is the recommended method for [paging results](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/). However, you can use `offset` and `length` to implement [an alternative approach to paging](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/#retrieving-a-subset-of-records-with-offset-and-length). + // minimum: 1 + // maximum: 1000 + @JsonKey(name: r'length') + final int? length; + + /// Search for entries [around a central location](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filter-around-a-central-point), enabling a geographical search within a circular area. + @JsonKey(name: r'aroundLatLng') + final String? aroundLatLng; + + /// Search for entries around a location. The location is automatically computed from the requester's IP address. + @JsonKey(name: r'aroundLatLngViaIP') + final bool? aroundLatLngViaIP; + + /// One of types: + /// - [AroundRadiusAll] + /// - [int] + @JsonKey(name: r'aroundRadius') + final dynamic aroundRadius; + + /// Precision of a geographical search (in meters), to [group results that are more or less the same distance from a central point](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/in-depth/geo-ranking-precision/). + @JsonKey(name: r'aroundPrecision') + final int? aroundPrecision; + + /// Minimum radius (in meters) used for a geographical search when `aroundRadius` isn't set. + // minimum: 1 + @JsonKey(name: r'minimumAroundRadius') + final int? minimumAroundRadius; + + /// Search inside a [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas) (in geographical coordinates). + @JsonKey(name: r'insideBoundingBox') + final List? insideBoundingBox; + + /// Search inside a [polygon](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas) (in geographical coordinates). + @JsonKey(name: r'insidePolygon') + final List? insidePolygon; + + /// Changes the default values of parameters that work best for a natural language query, such as `ignorePlurals`, `removeStopWords`, `removeWordsIfNoResults`, `analyticsTags`, and `ruleContexts`. These parameters work well together when the query consists of fuller natural language strings instead of keywords, for example when processing voice search queries. + @JsonKey(name: r'naturalLanguages') + final List? naturalLanguages; + + /// Assigns [rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) to search queries. + @JsonKey(name: r'ruleContexts') + final List? ruleContexts; + + /// Defines how much [Personalization affects results](https://www.algolia.com/doc/guides/personalization/personalizing-results/in-depth/configuring-personalization/#understanding-personalization-impact). + @JsonKey(name: r'personalizationImpact') + final int? personalizationImpact; + + /// Associates a [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/) with the current search. + @JsonKey(name: r'userToken') + final String? userToken; + + /// Incidates whether the search response includes [detailed ranking information](https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/understanding-the-api-response/#ranking-information). + @JsonKey(name: r'getRankingInfo') + final bool? getRankingInfo; + + /// Indicates whether a query ID parameter is included in the search response. This is required for [tracking click and conversion events](https://www.algolia.com/doc/guides/sending-events/concepts/event-types/#events-related-to-algolia-requests). + @JsonKey(name: r'clickAnalytics') + final bool? clickAnalytics; + + /// Indicates whether this query will be included in [analytics](https://www.algolia.com/doc/guides/search-analytics/guides/exclude-queries/). + @JsonKey(name: r'analytics') + final bool? analytics; + + /// Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/). + @JsonKey(name: r'analyticsTags') + final List? analyticsTags; + + /// Whether to include or exclude a query from the processing-time percentile computation. + @JsonKey(name: r'percentileComputation') + final bool? percentileComputation; + + /// Incidates whether this search will be considered in A/B testing. + @JsonKey(name: r'enableABTest') + final bool? enableABTest; + + /// Indicates whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). + @JsonKey(name: r'enableReRanking') + final bool? enableReRanking; + + /// One of types: + /// - [List>] + /// - [String] + /// - [List] + @JsonKey(name: r'reRankingApplyFilter') + final dynamic reRankingApplyFilter; + + /// Attributes used for [faceting](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/) and the [modifiers](https://www.algolia.com/doc/api-reference/api-parameters/attributesForFaceting/#modifiers) that can be applied: `filterOnly`, `searchable`, and `afterDistinct`. + @JsonKey(name: r'attributesForFaceting') + final List? attributesForFaceting; + + /// Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. By default, the response includes all attributes. + @JsonKey(name: r'attributesToRetrieve') + final List? attributesToRetrieve; + + /// Restricts a query to only look at a subset of your [searchable attributes](https://www.algolia.com/doc/guides/managing-results/must-do/searchable-attributes/). + @JsonKey(name: r'restrictSearchableAttributes') + final List? restrictSearchableAttributes; + + /// Determines the order in which Algolia [returns your results](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/). + @JsonKey(name: r'ranking') + final List? ranking; + + /// Specifies the [Custom ranking criterion](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Use the `asc` and `desc` modifiers to specify the ranking order: ascending or descending. + @JsonKey(name: r'customRanking') + final List? customRanking; + + /// Relevancy threshold below which less relevant results aren't included in the results. + @JsonKey(name: r'relevancyStrictness') + final int? relevancyStrictness; + + /// Attributes to highlight. Strings that match the search query in the attributes are highlighted by surrounding them with HTML tags (`highlightPreTag` and `highlightPostTag`). + @JsonKey(name: r'attributesToHighlight') + final List? attributesToHighlight; + + /// Attributes to _snippet_. 'Snippeting' is shortening the attribute to a certain number of words. If not specified, the attribute is shortened to the 10 words around the matching string but you can specify the number. For example: `body:20`. + @JsonKey(name: r'attributesToSnippet') + final List? attributesToSnippet; + + /// HTML string to insert before the highlighted parts in all highlight and snippet results. + @JsonKey(name: r'highlightPreTag') + final String? highlightPreTag; + + /// HTML string to insert after the highlighted parts in all highlight and snippet results. + @JsonKey(name: r'highlightPostTag') + final String? highlightPostTag; + + /// String used as an ellipsis indicator when a snippet is truncated. + @JsonKey(name: r'snippetEllipsisText') + final String? snippetEllipsisText; + + /// Restrict highlighting and snippeting to items that matched the query. + @JsonKey(name: r'restrictHighlightAndSnippetArrays') + final bool? restrictHighlightAndSnippetArrays; + + /// Number of hits per page. + // minimum: 1 + // maximum: 1000 + @JsonKey(name: r'hitsPerPage') + final int? hitsPerPage; + + /// Minimum number of characters a word in the query string must contain to accept matches with [one typo](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos). + @JsonKey(name: r'minWordSizefor1Typo') + final int? minWordSizefor1Typo; + + /// Minimum number of characters a word in the query string must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos). + @JsonKey(name: r'minWordSizefor2Typos') + final int? minWordSizefor2Typos; + + /// One of types: + /// - [TypoToleranceEnum] + /// - [bool] + @JsonKey(name: r'typoTolerance') + final dynamic typoTolerance; + + /// Whether to allow typos on numbers (\"numeric tokens\") in the query string. + @JsonKey(name: r'allowTyposOnNumericTokens') + final bool? allowTyposOnNumericTokens; + + /// Attributes for which you want to turn off [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/). + @JsonKey(name: r'disableTypoToleranceOnAttributes') + final List? disableTypoToleranceOnAttributes; + + /// One of types: + /// - [bool] + /// - [List] + @JsonKey(name: r'ignorePlurals') + final dynamic ignorePlurals; + + /// One of types: + /// - [bool] + /// - [List] + @JsonKey(name: r'removeStopWords') + final dynamic removeStopWords; + + /// Characters that the engine shouldn't automatically [normalize](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/). + @JsonKey(name: r'keepDiacriticsOnCharacters') + final String? keepDiacriticsOnCharacters; + + /// Sets your user's search language. This adjusts language-specific settings and features such as `ignorePlurals`, `removeStopWords`, and [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) word detection. + @JsonKey(name: r'queryLanguages') + final List? queryLanguages; + + /// [Splits compound words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#splitting-compound-words) into their component word parts in the query. + @JsonKey(name: r'decompoundQuery') + final bool? decompoundQuery; + + /// Incidates whether [Rules](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/) are enabled. + @JsonKey(name: r'enableRules') + final bool? enableRules; + + /// Incidates whether [Personalization](https://www.algolia.com/doc/guides/personalization/what-is-personalization/) is enabled. + @JsonKey(name: r'enablePersonalization') + final bool? enablePersonalization; + + @JsonKey(name: r'queryType') + final QueryType? queryType; + + @JsonKey(name: r'removeWordsIfNoResults') + final RemoveWordsIfNoResults? removeWordsIfNoResults; + + @JsonKey(name: r'mode') + final Mode? mode; + + @JsonKey(name: r'semanticSearch') + final IndexSettingsAsSearchParamsSemanticSearch? semanticSearch; + + /// Enables the [advanced query syntax](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/#advanced-syntax). + @JsonKey(name: r'advancedSyntax') + final bool? advancedSyntax; + + /// Words which should be considered [optional](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words) when found in a query. + @JsonKey(name: r'optionalWords') + final List? optionalWords; + + /// Attributes for which you want to [turn off the exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). + @JsonKey(name: r'disableExactOnAttributes') + final List? disableExactOnAttributes; + + @JsonKey(name: r'exactOnSingleWordQuery') + final ExactOnSingleWordQuery? exactOnSingleWordQuery; + + /// Alternatives that should be considered an exact match by [the exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). + @JsonKey(name: r'alternativesAsExact') + final List? alternativesAsExact; + + /// Allows you to specify which advanced syntax features are active when `advancedSyntax` is enabled. + @JsonKey(name: r'advancedSyntaxFeatures') + final List? advancedSyntaxFeatures; + + /// Enriches the API's response with information about how the query was processed. + @JsonKey(name: r'explain') + final List? explain; + + /// One of types: + /// - [bool] + /// - [int] + @JsonKey(name: r'distinct') + final dynamic distinct; + + /// Name of the deduplication attribute to be used with Algolia's [_distinct_ feature](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/#introducing-algolias-distinct-feature). + @JsonKey(name: r'attributeForDistinct') + final String? attributeForDistinct; + + /// Whether to take into account an index's synonyms for a particular search. + @JsonKey(name: r'synonyms') + final bool? synonyms; + + /// Whether to highlight and snippet the original word that matches the synonym or the synonym itself. + @JsonKey(name: r'replaceSynonymsInHighlight') + final bool? replaceSynonymsInHighlight; + + /// Precision of the [proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity). + // minimum: 1 + // maximum: 7 + @JsonKey(name: r'minProximity') + final int? minProximity; + + /// Attributes to include in the API response for search and browse queries. + @JsonKey(name: r'responseFields') + final List? responseFields; + + /// Maximum number of facet hits to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). + // maximum: 100 + @JsonKey(name: r'maxFacetHits') + final int? maxFacetHits; + + /// When the [Attribute criterion is ranked above Proximity](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#attribute-and-proximity-combinations) in your ranking formula, Proximity is used to select which searchable attribute is matched in the Attribute ranking stage. + @JsonKey(name: r'attributeCriteriaComputedByMinProximity') + final bool? attributeCriteriaComputedByMinProximity; + + @JsonKey(name: r'renderingContent') + final RenderingContent? renderingContent; + + /// One of types: + /// - [ConsequenceQueryObject] + /// - [String] + @JsonKey(name: r'query') + final dynamic query; + + /// One of types: + /// - [List] + /// - [List] + @JsonKey(name: r'automaticFacetFilters') + final dynamic automaticFacetFilters; + + /// One of types: + /// - [List] + /// - [List] + @JsonKey(name: r'automaticOptionalFacetFilters') + final dynamic automaticOptionalFacetFilters; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ConsequenceParams && + other.similarQuery == similarQuery && + other.filters == filters && + other.facetFilters == facetFilters && + other.optionalFilters == optionalFilters && + other.numericFilters == numericFilters && + other.tagFilters == tagFilters && + other.sumOrFiltersScores == sumOrFiltersScores && + other.facets == facets && + other.maxValuesPerFacet == maxValuesPerFacet && + other.facetingAfterDistinct == facetingAfterDistinct && + other.sortFacetValuesBy == sortFacetValuesBy && + other.page == page && + other.offset == offset && + other.length == length && + other.aroundLatLng == aroundLatLng && + other.aroundLatLngViaIP == aroundLatLngViaIP && + other.aroundRadius == aroundRadius && + other.aroundPrecision == aroundPrecision && + other.minimumAroundRadius == minimumAroundRadius && + other.insideBoundingBox == insideBoundingBox && + other.insidePolygon == insidePolygon && + other.naturalLanguages == naturalLanguages && + other.ruleContexts == ruleContexts && + other.personalizationImpact == personalizationImpact && + other.userToken == userToken && + other.getRankingInfo == getRankingInfo && + other.clickAnalytics == clickAnalytics && + other.analytics == analytics && + other.analyticsTags == analyticsTags && + other.percentileComputation == percentileComputation && + other.enableABTest == enableABTest && + other.enableReRanking == enableReRanking && + other.reRankingApplyFilter == reRankingApplyFilter && + other.attributesForFaceting == attributesForFaceting && + other.attributesToRetrieve == attributesToRetrieve && + other.restrictSearchableAttributes == restrictSearchableAttributes && + other.ranking == ranking && + other.customRanking == customRanking && + other.relevancyStrictness == relevancyStrictness && + other.attributesToHighlight == attributesToHighlight && + other.attributesToSnippet == attributesToSnippet && + other.highlightPreTag == highlightPreTag && + other.highlightPostTag == highlightPostTag && + other.snippetEllipsisText == snippetEllipsisText && + other.restrictHighlightAndSnippetArrays == + restrictHighlightAndSnippetArrays && + other.hitsPerPage == hitsPerPage && + other.minWordSizefor1Typo == minWordSizefor1Typo && + other.minWordSizefor2Typos == minWordSizefor2Typos && + other.typoTolerance == typoTolerance && + other.allowTyposOnNumericTokens == allowTyposOnNumericTokens && + other.disableTypoToleranceOnAttributes == + disableTypoToleranceOnAttributes && + other.ignorePlurals == ignorePlurals && + other.removeStopWords == removeStopWords && + other.keepDiacriticsOnCharacters == keepDiacriticsOnCharacters && + other.queryLanguages == queryLanguages && + other.decompoundQuery == decompoundQuery && + other.enableRules == enableRules && + other.enablePersonalization == enablePersonalization && + other.queryType == queryType && + other.removeWordsIfNoResults == removeWordsIfNoResults && + other.mode == mode && + other.semanticSearch == semanticSearch && + other.advancedSyntax == advancedSyntax && + other.optionalWords == optionalWords && + other.disableExactOnAttributes == disableExactOnAttributes && + other.exactOnSingleWordQuery == exactOnSingleWordQuery && + other.alternativesAsExact == alternativesAsExact && + other.advancedSyntaxFeatures == advancedSyntaxFeatures && + other.explain == explain && + other.distinct == distinct && + other.attributeForDistinct == attributeForDistinct && + other.synonyms == synonyms && + other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && + other.minProximity == minProximity && + other.responseFields == responseFields && + other.maxFacetHits == maxFacetHits && + other.attributeCriteriaComputedByMinProximity == + attributeCriteriaComputedByMinProximity && + other.renderingContent == renderingContent && + other.query == query && + other.automaticFacetFilters == automaticFacetFilters && + other.automaticOptionalFacetFilters == automaticOptionalFacetFilters; + + @override + int get hashCode => + similarQuery.hashCode + + filters.hashCode + + facetFilters.hashCode + + optionalFilters.hashCode + + numericFilters.hashCode + + tagFilters.hashCode + + sumOrFiltersScores.hashCode + + facets.hashCode + + maxValuesPerFacet.hashCode + + facetingAfterDistinct.hashCode + + sortFacetValuesBy.hashCode + + page.hashCode + + offset.hashCode + + length.hashCode + + aroundLatLng.hashCode + + aroundLatLngViaIP.hashCode + + aroundRadius.hashCode + + aroundPrecision.hashCode + + minimumAroundRadius.hashCode + + insideBoundingBox.hashCode + + insidePolygon.hashCode + + naturalLanguages.hashCode + + ruleContexts.hashCode + + personalizationImpact.hashCode + + userToken.hashCode + + getRankingInfo.hashCode + + clickAnalytics.hashCode + + analytics.hashCode + + analyticsTags.hashCode + + percentileComputation.hashCode + + enableABTest.hashCode + + enableReRanking.hashCode + + (reRankingApplyFilter == null ? 0 : reRankingApplyFilter.hashCode) + + attributesForFaceting.hashCode + + attributesToRetrieve.hashCode + + restrictSearchableAttributes.hashCode + + ranking.hashCode + + customRanking.hashCode + + relevancyStrictness.hashCode + + attributesToHighlight.hashCode + + attributesToSnippet.hashCode + + highlightPreTag.hashCode + + highlightPostTag.hashCode + + snippetEllipsisText.hashCode + + restrictHighlightAndSnippetArrays.hashCode + + hitsPerPage.hashCode + + minWordSizefor1Typo.hashCode + + minWordSizefor2Typos.hashCode + + typoTolerance.hashCode + + allowTyposOnNumericTokens.hashCode + + disableTypoToleranceOnAttributes.hashCode + + ignorePlurals.hashCode + + removeStopWords.hashCode + + keepDiacriticsOnCharacters.hashCode + + queryLanguages.hashCode + + decompoundQuery.hashCode + + enableRules.hashCode + + enablePersonalization.hashCode + + queryType.hashCode + + removeWordsIfNoResults.hashCode + + mode.hashCode + + semanticSearch.hashCode + + advancedSyntax.hashCode + + optionalWords.hashCode + + disableExactOnAttributes.hashCode + + exactOnSingleWordQuery.hashCode + + alternativesAsExact.hashCode + + advancedSyntaxFeatures.hashCode + + explain.hashCode + + distinct.hashCode + + attributeForDistinct.hashCode + + synonyms.hashCode + + replaceSynonymsInHighlight.hashCode + + minProximity.hashCode + + responseFields.hashCode + + maxFacetHits.hashCode + + attributeCriteriaComputedByMinProximity.hashCode + + renderingContent.hashCode + + query.hashCode + + automaticFacetFilters.hashCode + + automaticOptionalFacetFilters.hashCode; + + factory ConsequenceParams.fromJson(Map json) => + _$ConsequenceParamsFromJson(json); + + Map toJson() => _$ConsequenceParamsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_params.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_params.g.dart new file mode 100644 index 0000000000..a377852200 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_params.g.dart @@ -0,0 +1,312 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'consequence_params.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ConsequenceParams _$ConsequenceParamsFromJson(Map json) => + $checkedCreate( + 'ConsequenceParams', + json, + ($checkedConvert) { + final val = ConsequenceParams( + similarQuery: $checkedConvert('similarQuery', (v) => v as String?), + filters: $checkedConvert('filters', (v) => v as String?), + facetFilters: $checkedConvert('facetFilters', (v) => v), + optionalFilters: $checkedConvert('optionalFilters', (v) => v), + numericFilters: $checkedConvert('numericFilters', (v) => v), + tagFilters: $checkedConvert('tagFilters', (v) => v), + sumOrFiltersScores: + $checkedConvert('sumOrFiltersScores', (v) => v as bool?), + facets: $checkedConvert('facets', + (v) => (v as List?)?.map((e) => e as String).toList()), + maxValuesPerFacet: + $checkedConvert('maxValuesPerFacet', (v) => v as int?), + facetingAfterDistinct: + $checkedConvert('facetingAfterDistinct', (v) => v as bool?), + sortFacetValuesBy: + $checkedConvert('sortFacetValuesBy', (v) => v as String?), + page: $checkedConvert('page', (v) => v as int?), + offset: $checkedConvert('offset', (v) => v as int?), + length: $checkedConvert('length', (v) => v as int?), + aroundLatLng: $checkedConvert('aroundLatLng', (v) => v as String?), + aroundLatLngViaIP: + $checkedConvert('aroundLatLngViaIP', (v) => v as bool?), + aroundRadius: $checkedConvert('aroundRadius', (v) => v), + aroundPrecision: $checkedConvert('aroundPrecision', (v) => v as int?), + minimumAroundRadius: + $checkedConvert('minimumAroundRadius', (v) => v as int?), + insideBoundingBox: $checkedConvert( + 'insideBoundingBox', + (v) => (v as List?) + ?.map((e) => (e as num).toDouble()) + .toList()), + insidePolygon: $checkedConvert( + 'insidePolygon', + (v) => (v as List?) + ?.map((e) => (e as num).toDouble()) + .toList()), + naturalLanguages: $checkedConvert('naturalLanguages', + (v) => (v as List?)?.map((e) => e as String).toList()), + ruleContexts: $checkedConvert('ruleContexts', + (v) => (v as List?)?.map((e) => e as String).toList()), + personalizationImpact: + $checkedConvert('personalizationImpact', (v) => v as int?), + userToken: $checkedConvert('userToken', (v) => v as String?), + getRankingInfo: $checkedConvert('getRankingInfo', (v) => v as bool?), + clickAnalytics: $checkedConvert('clickAnalytics', (v) => v as bool?), + analytics: $checkedConvert('analytics', (v) => v as bool?), + analyticsTags: $checkedConvert('analyticsTags', + (v) => (v as List?)?.map((e) => e as String).toList()), + percentileComputation: + $checkedConvert('percentileComputation', (v) => v as bool?), + enableABTest: $checkedConvert('enableABTest', (v) => v as bool?), + enableReRanking: + $checkedConvert('enableReRanking', (v) => v as bool?), + reRankingApplyFilter: + $checkedConvert('reRankingApplyFilter', (v) => v), + attributesForFaceting: $checkedConvert('attributesForFaceting', + (v) => (v as List?)?.map((e) => e as String).toList()), + attributesToRetrieve: $checkedConvert('attributesToRetrieve', + (v) => (v as List?)?.map((e) => e as String).toList()), + restrictSearchableAttributes: $checkedConvert( + 'restrictSearchableAttributes', + (v) => (v as List?)?.map((e) => e as String).toList()), + ranking: $checkedConvert('ranking', + (v) => (v as List?)?.map((e) => e as String).toList()), + customRanking: $checkedConvert('customRanking', + (v) => (v as List?)?.map((e) => e as String).toList()), + relevancyStrictness: + $checkedConvert('relevancyStrictness', (v) => v as int?), + attributesToHighlight: $checkedConvert('attributesToHighlight', + (v) => (v as List?)?.map((e) => e as String).toList()), + attributesToSnippet: $checkedConvert('attributesToSnippet', + (v) => (v as List?)?.map((e) => e as String).toList()), + highlightPreTag: + $checkedConvert('highlightPreTag', (v) => v as String?), + highlightPostTag: + $checkedConvert('highlightPostTag', (v) => v as String?), + snippetEllipsisText: + $checkedConvert('snippetEllipsisText', (v) => v as String?), + restrictHighlightAndSnippetArrays: $checkedConvert( + 'restrictHighlightAndSnippetArrays', (v) => v as bool?), + hitsPerPage: $checkedConvert('hitsPerPage', (v) => v as int?), + minWordSizefor1Typo: + $checkedConvert('minWordSizefor1Typo', (v) => v as int?), + minWordSizefor2Typos: + $checkedConvert('minWordSizefor2Typos', (v) => v as int?), + typoTolerance: $checkedConvert('typoTolerance', (v) => v), + allowTyposOnNumericTokens: + $checkedConvert('allowTyposOnNumericTokens', (v) => v as bool?), + disableTypoToleranceOnAttributes: $checkedConvert( + 'disableTypoToleranceOnAttributes', + (v) => (v as List?)?.map((e) => e as String).toList()), + ignorePlurals: $checkedConvert('ignorePlurals', (v) => v), + removeStopWords: $checkedConvert('removeStopWords', (v) => v), + keepDiacriticsOnCharacters: $checkedConvert( + 'keepDiacriticsOnCharacters', (v) => v as String?), + queryLanguages: $checkedConvert('queryLanguages', + (v) => (v as List?)?.map((e) => e as String).toList()), + decompoundQuery: + $checkedConvert('decompoundQuery', (v) => v as bool?), + enableRules: $checkedConvert('enableRules', (v) => v as bool?), + enablePersonalization: + $checkedConvert('enablePersonalization', (v) => v as bool?), + queryType: $checkedConvert( + 'queryType', (v) => $enumDecodeNullable(_$QueryTypeEnumMap, v)), + removeWordsIfNoResults: $checkedConvert('removeWordsIfNoResults', + (v) => $enumDecodeNullable(_$RemoveWordsIfNoResultsEnumMap, v)), + mode: $checkedConvert( + 'mode', (v) => $enumDecodeNullable(_$ModeEnumMap, v)), + semanticSearch: $checkedConvert( + 'semanticSearch', + (v) => v == null + ? null + : IndexSettingsAsSearchParamsSemanticSearch.fromJson( + v as Map)), + advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), + optionalWords: $checkedConvert('optionalWords', + (v) => (v as List?)?.map((e) => e as String).toList()), + disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', + (v) => (v as List?)?.map((e) => e as String).toList()), + exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', + (v) => $enumDecodeNullable(_$ExactOnSingleWordQueryEnumMap, v)), + alternativesAsExact: $checkedConvert( + 'alternativesAsExact', + (v) => (v as List?) + ?.map((e) => $enumDecode(_$AlternativesAsExactEnumMap, e)) + .toList()), + advancedSyntaxFeatures: $checkedConvert( + 'advancedSyntaxFeatures', + (v) => (v as List?) + ?.map((e) => $enumDecode(_$AdvancedSyntaxFeaturesEnumMap, e)) + .toList()), + explain: $checkedConvert('explain', + (v) => (v as List?)?.map((e) => e as String).toList()), + distinct: $checkedConvert('distinct', (v) => v), + attributeForDistinct: + $checkedConvert('attributeForDistinct', (v) => v as String?), + synonyms: $checkedConvert('synonyms', (v) => v as bool?), + replaceSynonymsInHighlight: + $checkedConvert('replaceSynonymsInHighlight', (v) => v as bool?), + minProximity: $checkedConvert('minProximity', (v) => v as int?), + responseFields: $checkedConvert('responseFields', + (v) => (v as List?)?.map((e) => e as String).toList()), + maxFacetHits: $checkedConvert('maxFacetHits', (v) => v as int?), + attributeCriteriaComputedByMinProximity: $checkedConvert( + 'attributeCriteriaComputedByMinProximity', (v) => v as bool?), + renderingContent: $checkedConvert( + 'renderingContent', + (v) => v == null + ? null + : RenderingContent.fromJson(v as Map)), + query: $checkedConvert('query', (v) => v), + automaticFacetFilters: + $checkedConvert('automaticFacetFilters', (v) => v), + automaticOptionalFacetFilters: + $checkedConvert('automaticOptionalFacetFilters', (v) => v), + ); + return val; + }, + ); + +Map _$ConsequenceParamsToJson(ConsequenceParams instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('similarQuery', instance.similarQuery); + writeNotNull('filters', instance.filters); + writeNotNull('facetFilters', instance.facetFilters); + writeNotNull('optionalFilters', instance.optionalFilters); + writeNotNull('numericFilters', instance.numericFilters); + writeNotNull('tagFilters', instance.tagFilters); + writeNotNull('sumOrFiltersScores', instance.sumOrFiltersScores); + writeNotNull('facets', instance.facets); + writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); + writeNotNull('facetingAfterDistinct', instance.facetingAfterDistinct); + writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); + writeNotNull('page', instance.page); + writeNotNull('offset', instance.offset); + writeNotNull('length', instance.length); + writeNotNull('aroundLatLng', instance.aroundLatLng); + writeNotNull('aroundLatLngViaIP', instance.aroundLatLngViaIP); + writeNotNull('aroundRadius', instance.aroundRadius); + writeNotNull('aroundPrecision', instance.aroundPrecision); + writeNotNull('minimumAroundRadius', instance.minimumAroundRadius); + writeNotNull('insideBoundingBox', instance.insideBoundingBox); + writeNotNull('insidePolygon', instance.insidePolygon); + writeNotNull('naturalLanguages', instance.naturalLanguages); + writeNotNull('ruleContexts', instance.ruleContexts); + writeNotNull('personalizationImpact', instance.personalizationImpact); + writeNotNull('userToken', instance.userToken); + writeNotNull('getRankingInfo', instance.getRankingInfo); + writeNotNull('clickAnalytics', instance.clickAnalytics); + writeNotNull('analytics', instance.analytics); + writeNotNull('analyticsTags', instance.analyticsTags); + writeNotNull('percentileComputation', instance.percentileComputation); + writeNotNull('enableABTest', instance.enableABTest); + writeNotNull('enableReRanking', instance.enableReRanking); + writeNotNull('reRankingApplyFilter', instance.reRankingApplyFilter); + writeNotNull('attributesForFaceting', instance.attributesForFaceting); + writeNotNull('attributesToRetrieve', instance.attributesToRetrieve); + writeNotNull( + 'restrictSearchableAttributes', instance.restrictSearchableAttributes); + writeNotNull('ranking', instance.ranking); + writeNotNull('customRanking', instance.customRanking); + writeNotNull('relevancyStrictness', instance.relevancyStrictness); + writeNotNull('attributesToHighlight', instance.attributesToHighlight); + writeNotNull('attributesToSnippet', instance.attributesToSnippet); + writeNotNull('highlightPreTag', instance.highlightPreTag); + writeNotNull('highlightPostTag', instance.highlightPostTag); + writeNotNull('snippetEllipsisText', instance.snippetEllipsisText); + writeNotNull('restrictHighlightAndSnippetArrays', + instance.restrictHighlightAndSnippetArrays); + writeNotNull('hitsPerPage', instance.hitsPerPage); + writeNotNull('minWordSizefor1Typo', instance.minWordSizefor1Typo); + writeNotNull('minWordSizefor2Typos', instance.minWordSizefor2Typos); + writeNotNull('typoTolerance', instance.typoTolerance); + writeNotNull('allowTyposOnNumericTokens', instance.allowTyposOnNumericTokens); + writeNotNull('disableTypoToleranceOnAttributes', + instance.disableTypoToleranceOnAttributes); + writeNotNull('ignorePlurals', instance.ignorePlurals); + writeNotNull('removeStopWords', instance.removeStopWords); + writeNotNull( + 'keepDiacriticsOnCharacters', instance.keepDiacriticsOnCharacters); + writeNotNull('queryLanguages', instance.queryLanguages); + writeNotNull('decompoundQuery', instance.decompoundQuery); + writeNotNull('enableRules', instance.enableRules); + writeNotNull('enablePersonalization', instance.enablePersonalization); + writeNotNull('queryType', instance.queryType?.toJson()); + writeNotNull( + 'removeWordsIfNoResults', instance.removeWordsIfNoResults?.toJson()); + writeNotNull('mode', instance.mode?.toJson()); + writeNotNull('semanticSearch', instance.semanticSearch?.toJson()); + writeNotNull('advancedSyntax', instance.advancedSyntax); + writeNotNull('optionalWords', instance.optionalWords); + writeNotNull('disableExactOnAttributes', instance.disableExactOnAttributes); + writeNotNull( + 'exactOnSingleWordQuery', instance.exactOnSingleWordQuery?.toJson()); + writeNotNull('alternativesAsExact', + instance.alternativesAsExact?.map((e) => e.toJson()).toList()); + writeNotNull('advancedSyntaxFeatures', + instance.advancedSyntaxFeatures?.map((e) => e.toJson()).toList()); + writeNotNull('explain', instance.explain); + writeNotNull('distinct', instance.distinct); + writeNotNull('attributeForDistinct', instance.attributeForDistinct); + writeNotNull('synonyms', instance.synonyms); + writeNotNull( + 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); + writeNotNull('minProximity', instance.minProximity); + writeNotNull('responseFields', instance.responseFields); + writeNotNull('maxFacetHits', instance.maxFacetHits); + writeNotNull('attributeCriteriaComputedByMinProximity', + instance.attributeCriteriaComputedByMinProximity); + writeNotNull('renderingContent', instance.renderingContent?.toJson()); + writeNotNull('query', instance.query); + writeNotNull('automaticFacetFilters', instance.automaticFacetFilters); + writeNotNull( + 'automaticOptionalFacetFilters', instance.automaticOptionalFacetFilters); + return val; +} + +const _$QueryTypeEnumMap = { + QueryType.prefixLast: 'prefixLast', + QueryType.prefixAll: 'prefixAll', + QueryType.prefixNone: 'prefixNone', +}; + +const _$RemoveWordsIfNoResultsEnumMap = { + RemoveWordsIfNoResults.none: 'none', + RemoveWordsIfNoResults.lastWords: 'lastWords', + RemoveWordsIfNoResults.firstWords: 'firstWords', + RemoveWordsIfNoResults.allOptional: 'allOptional', +}; + +const _$ModeEnumMap = { + Mode.neuralSearch: 'neuralSearch', + Mode.keywordSearch: 'keywordSearch', +}; + +const _$ExactOnSingleWordQueryEnumMap = { + ExactOnSingleWordQuery.attribute: 'attribute', + ExactOnSingleWordQuery.none: 'none', + ExactOnSingleWordQuery.word: 'word', +}; + +const _$AlternativesAsExactEnumMap = { + AlternativesAsExact.ignorePlurals: 'ignorePlurals', + AlternativesAsExact.singleWordSynonym: 'singleWordSynonym', + AlternativesAsExact.multiWordsSynonym: 'multiWordsSynonym', +}; + +const _$AdvancedSyntaxFeaturesEnumMap = { + AdvancedSyntaxFeatures.exactPhrase: 'exactPhrase', + AdvancedSyntaxFeatures.excludeWords: 'excludeWords', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_query_object.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_query_object.dart new file mode 100644 index 0000000000..e9c3414dc3 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_query_object.dart @@ -0,0 +1,44 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/edit.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'consequence_query_object.g.dart'; + +@JsonSerializable() +final class ConsequenceQueryObject { + /// Returns a new [ConsequenceQueryObject] instance. + const ConsequenceQueryObject({ + this.remove, + this.edits, + }); + + /// Words to remove. + @JsonKey(name: r'remove') + final List? remove; + + /// Edits to apply. + @JsonKey(name: r'edits') + final List? edits; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ConsequenceQueryObject && + other.remove == remove && + other.edits == edits; + + @override + int get hashCode => remove.hashCode + edits.hashCode; + + factory ConsequenceQueryObject.fromJson(Map json) => + _$ConsequenceQueryObjectFromJson(json); + + Map toJson() => _$ConsequenceQueryObjectToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_query_object.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_query_object.g.dart new file mode 100644 index 0000000000..aa28153209 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/consequence_query_object.g.dart @@ -0,0 +1,41 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'consequence_query_object.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ConsequenceQueryObject _$ConsequenceQueryObjectFromJson( + Map json) => + $checkedCreate( + 'ConsequenceQueryObject', + json, + ($checkedConvert) { + final val = ConsequenceQueryObject( + remove: $checkedConvert('remove', + (v) => (v as List?)?.map((e) => e as String).toList()), + edits: $checkedConvert( + 'edits', + (v) => (v as List?) + ?.map((e) => Edit.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$ConsequenceQueryObjectToJson( + ConsequenceQueryObject instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('remove', instance.remove); + writeNotNull('edits', instance.edits?.map((e) => e.toJson()).toList()); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/deleted_at_response.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/deleted_at_response.dart new file mode 100644 index 0000000000..01f12160ab --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/deleted_at_response.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'deleted_at_response.g.dart'; + +@JsonSerializable() +final class DeletedAtResponse { + /// Returns a new [DeletedAtResponse] instance. + const DeletedAtResponse({ + required this.taskID, + required this.deletedAt, + }); + + /// Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run immediately. You can check the task's progress with the `task` operation and this `taskID`. + @JsonKey(name: r'taskID') + final int taskID; + + /// Timestamp of deletion in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. + @JsonKey(name: r'deletedAt') + final String deletedAt; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is DeletedAtResponse && + other.taskID == taskID && + other.deletedAt == deletedAt; + + @override + int get hashCode => taskID.hashCode + deletedAt.hashCode; + + factory DeletedAtResponse.fromJson(Map json) => + _$DeletedAtResponseFromJson(json); + + Map toJson() => _$DeletedAtResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/deleted_at_response.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/deleted_at_response.g.dart new file mode 100644 index 0000000000..4364a2c8e9 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/deleted_at_response.g.dart @@ -0,0 +1,26 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'deleted_at_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +DeletedAtResponse _$DeletedAtResponseFromJson(Map json) => + $checkedCreate( + 'DeletedAtResponse', + json, + ($checkedConvert) { + final val = DeletedAtResponse( + taskID: $checkedConvert('taskID', (v) => v as int), + deletedAt: $checkedConvert('deletedAt', (v) => v as String), + ); + return val; + }, + ); + +Map _$DeletedAtResponseToJson(DeletedAtResponse instance) => + { + 'taskID': instance.taskID, + 'deletedAt': instance.deletedAt, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/edit.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/edit.dart new file mode 100644 index 0000000000..f7c95f5632 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/edit.dart @@ -0,0 +1,48 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/edit_type.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'edit.g.dart'; + +@JsonSerializable() +final class Edit { + /// Returns a new [Edit] instance. + const Edit({ + this.type, + this.delete, + this.insert, + }); + + @JsonKey(name: r'type') + final EditType? type; + + /// Text or patterns to remove from the query string. + @JsonKey(name: r'delete') + final String? delete; + + /// Text that should be inserted in place of the removed text inside the query string. + @JsonKey(name: r'insert') + final String? insert; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Edit && + other.type == type && + other.delete == delete && + other.insert == insert; + + @override + int get hashCode => type.hashCode + delete.hashCode + insert.hashCode; + + factory Edit.fromJson(Map json) => _$EditFromJson(json); + + Map toJson() => _$EditToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/edit.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/edit.g.dart new file mode 100644 index 0000000000..d372df8f3d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/edit.g.dart @@ -0,0 +1,41 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'edit.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Edit _$EditFromJson(Map json) => $checkedCreate( + 'Edit', + json, + ($checkedConvert) { + final val = Edit( + type: $checkedConvert( + 'type', (v) => $enumDecodeNullable(_$EditTypeEnumMap, v)), + delete: $checkedConvert('delete', (v) => v as String?), + insert: $checkedConvert('insert', (v) => v as String?), + ); + return val; + }, + ); + +Map _$EditToJson(Edit instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('type', instance.type?.toJson()); + writeNotNull('delete', instance.delete); + writeNotNull('insert', instance.insert); + return val; +} + +const _$EditTypeEnumMap = { + EditType.remove: 'remove', + EditType.replace: 'replace', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/edit_type.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/edit_type.dart new file mode 100644 index 0000000000..c92cf5fe56 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/edit_type.dart @@ -0,0 +1,28 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Type of edit. +@JsonEnum(valueField: 'raw') +enum EditType { + /// Type of edit. + remove(r'remove'), + + /// Type of edit. + replace(r'replace'); + + const EditType(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static EditType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/error_base.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/error_base.dart new file mode 100644 index 0000000000..df5d4ade57 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/error_base.dart @@ -0,0 +1,47 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:collection/collection.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'error_base.g.dart'; + +@JsonSerializable(createFieldMap: true) +final class ErrorBase extends DelegatingMap { + /// Returns a new [ErrorBase] instance. + const ErrorBase({ + this.message, + Map additionalProperties = const {}, + }) : super(additionalProperties); + + @JsonKey(name: r'message') + final String? message; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ErrorBase && + other.message == message && + const MapEquality().equals(this, this); + + @override + int get hashCode => + message.hashCode + const MapEquality().hash(this); + + factory ErrorBase.fromJson(Map json) { + final instance = _$ErrorBaseFromJson(json); + final additionalProperties = Map.from(json) + ..removeWhere((key, value) => _$ErrorBaseFieldMap.containsKey(key)); + return ErrorBase( + message: instance.message, + additionalProperties: additionalProperties, + ); + } + + Map toJson() => _$ErrorBaseToJson(this)..addAll(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/error_base.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/error_base.g.dart new file mode 100644 index 0000000000..f796166fb2 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/error_base.g.dart @@ -0,0 +1,35 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'error_base.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ErrorBase _$ErrorBaseFromJson(Map json) => $checkedCreate( + 'ErrorBase', + json, + ($checkedConvert) { + final val = ErrorBase( + message: $checkedConvert('message', (v) => v as String?), + ); + return val; + }, + ); + +const _$ErrorBaseFieldMap = { + 'message': 'message', +}; + +Map _$ErrorBaseToJson(ErrorBase instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('message', instance.message); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/exact_on_single_word_query.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/exact_on_single_word_query.dart new file mode 100644 index 0000000000..022f5acb46 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/exact_on_single_word_query.dart @@ -0,0 +1,31 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Determines how the [Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes) is computed when the query contains only one word. +@JsonEnum(valueField: 'raw') +enum ExactOnSingleWordQuery { + /// Determines how the [Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes) is computed when the query contains only one word. + attribute(r'attribute'), + + /// Determines how the [Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes) is computed when the query contains only one word. + none(r'none'), + + /// Determines how the [Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes) is computed when the query contains only one word. + word(r'word'); + + const ExactOnSingleWordQuery(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static ExactOnSingleWordQuery fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facet_ordering.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facet_ordering.dart new file mode 100644 index 0000000000..fadebb234e --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facet_ordering.dart @@ -0,0 +1,44 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/value.dart'; +import 'package:algolia_client_recommend/src/model/facets.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'facet_ordering.g.dart'; + +@JsonSerializable() +final class FacetOrdering { + /// Returns a new [FacetOrdering] instance. + const FacetOrdering({ + this.facets, + this.values, + }); + + @JsonKey(name: r'facets') + final Facets? facets; + + /// Ordering of facet values within an individual facet. + @JsonKey(name: r'values') + final Map? values; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FacetOrdering && + other.facets == facets && + other.values == values; + + @override + int get hashCode => facets.hashCode + values.hashCode; + + factory FacetOrdering.fromJson(Map json) => + _$FacetOrderingFromJson(json); + + Map toJson() => _$FacetOrderingToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facet_ordering.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facet_ordering.g.dart new file mode 100644 index 0000000000..233ac9b8a0 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facet_ordering.g.dart @@ -0,0 +1,44 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'facet_ordering.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +FacetOrdering _$FacetOrderingFromJson(Map json) => + $checkedCreate( + 'FacetOrdering', + json, + ($checkedConvert) { + final val = FacetOrdering( + facets: $checkedConvert( + 'facets', + (v) => v == null + ? null + : Facets.fromJson(v as Map)), + values: $checkedConvert( + 'values', + (v) => (v as Map?)?.map( + (k, e) => + MapEntry(k, Value.fromJson(e as Map)), + )), + ); + return val; + }, + ); + +Map _$FacetOrderingToJson(FacetOrdering instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('facets', instance.facets?.toJson()); + writeNotNull( + 'values', instance.values?.map((k, e) => MapEntry(k, e.toJson()))); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facets.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facets.dart new file mode 100644 index 0000000000..13e8ee4efd --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facets.dart @@ -0,0 +1,34 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'facets.g.dart'; + +@JsonSerializable() +final class Facets { + /// Returns a new [Facets] instance. + const Facets({ + this.order, + }); + + /// Pinned order of facet lists. + @JsonKey(name: r'order') + final List? order; + + @override + bool operator ==(Object other) => + identical(this, other) || other is Facets && other.order == order; + + @override + int get hashCode => order.hashCode; + + factory Facets.fromJson(Map json) => _$FacetsFromJson(json); + + Map toJson() => _$FacetsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facets.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facets.g.dart new file mode 100644 index 0000000000..fa11c39ed6 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facets.g.dart @@ -0,0 +1,32 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'facets.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Facets _$FacetsFromJson(Map json) => $checkedCreate( + 'Facets', + json, + ($checkedConvert) { + final val = Facets( + order: $checkedConvert('order', + (v) => (v as List?)?.map((e) => e as String).toList()), + ); + return val; + }, + ); + +Map _$FacetsToJson(Facets instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('order', instance.order); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facets_stats.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facets_stats.dart new file mode 100644 index 0000000000..cae3b6da7a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facets_stats.dart @@ -0,0 +1,55 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'facets_stats.g.dart'; + +@JsonSerializable() +final class FacetsStats { + /// Returns a new [FacetsStats] instance. + const FacetsStats({ + this.min, + this.max, + this.avg, + this.sum, + }); + + /// Minimum value in the results. + @JsonKey(name: r'min') + final double? min; + + /// Maximum value in the results. + @JsonKey(name: r'max') + final double? max; + + /// Average facet value in the results. + @JsonKey(name: r'avg') + final double? avg; + + /// Sum of all values in the results. + @JsonKey(name: r'sum') + final double? sum; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FacetsStats && + other.min == min && + other.max == max && + other.avg == avg && + other.sum == sum; + + @override + int get hashCode => min.hashCode + max.hashCode + avg.hashCode + sum.hashCode; + + factory FacetsStats.fromJson(Map json) => + _$FacetsStatsFromJson(json); + + Map toJson() => _$FacetsStatsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facets_stats.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facets_stats.g.dart new file mode 100644 index 0000000000..378abf9fda --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/facets_stats.g.dart @@ -0,0 +1,37 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'facets_stats.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +FacetsStats _$FacetsStatsFromJson(Map json) => $checkedCreate( + 'FacetsStats', + json, + ($checkedConvert) { + final val = FacetsStats( + min: $checkedConvert('min', (v) => (v as num?)?.toDouble()), + max: $checkedConvert('max', (v) => (v as num?)?.toDouble()), + avg: $checkedConvert('avg', (v) => (v as num?)?.toDouble()), + sum: $checkedConvert('sum', (v) => (v as num?)?.toDouble()), + ); + return val; + }, + ); + +Map _$FacetsStatsToJson(FacetsStats instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('min', instance.min); + writeNotNull('max', instance.max); + writeNotNull('avg', instance.avg); + writeNotNull('sum', instance.sum); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommend_task_response.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommend_task_response.dart new file mode 100644 index 0000000000..28ff97d9d2 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommend_task_response.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/task_status.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_recommend_task_response.g.dart'; + +@JsonSerializable() +final class GetRecommendTaskResponse { + /// Returns a new [GetRecommendTaskResponse] instance. + const GetRecommendTaskResponse({ + required this.status, + }); + + @JsonKey(name: r'status') + final TaskStatus status; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetRecommendTaskResponse && other.status == status; + + @override + int get hashCode => status.hashCode; + + factory GetRecommendTaskResponse.fromJson(Map json) => + _$GetRecommendTaskResponseFromJson(json); + + Map toJson() => _$GetRecommendTaskResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommend_task_response.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommend_task_response.g.dart new file mode 100644 index 0000000000..24d1d596d5 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommend_task_response.g.dart @@ -0,0 +1,32 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_recommend_task_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetRecommendTaskResponse _$GetRecommendTaskResponseFromJson( + Map json) => + $checkedCreate( + 'GetRecommendTaskResponse', + json, + ($checkedConvert) { + final val = GetRecommendTaskResponse( + status: $checkedConvert( + 'status', (v) => $enumDecode(_$TaskStatusEnumMap, v)), + ); + return val; + }, + ); + +Map _$GetRecommendTaskResponseToJson( + GetRecommendTaskResponse instance) => + { + 'status': instance.status.toJson(), + }; + +const _$TaskStatusEnumMap = { + TaskStatus.published: 'published', + TaskStatus.notPublished: 'notPublished', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_params.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_params.dart new file mode 100644 index 0000000000..bfa9b7d6b9 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_params.dart @@ -0,0 +1,39 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_recommendations_params.g.dart'; + +@JsonSerializable() +final class GetRecommendationsParams { + /// Returns a new [GetRecommendationsParams] instance. + const GetRecommendationsParams({ + required this.requests, + }); + + /// Request parameters depend on the model (recommendations or trending). + /// One of types: + /// - [RecommendationRequest] + /// - [TrendingRequest] + @JsonKey(name: r'requests') + final Iterable requests; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetRecommendationsParams && other.requests == requests; + + @override + int get hashCode => requests.hashCode; + + factory GetRecommendationsParams.fromJson(Map json) => + _$GetRecommendationsParamsFromJson(json); + + Map toJson() => _$GetRecommendationsParamsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_params.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_params.g.dart new file mode 100644 index 0000000000..2c6573ece0 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_params.g.dart @@ -0,0 +1,26 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_recommendations_params.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetRecommendationsParams _$GetRecommendationsParamsFromJson( + Map json) => + $checkedCreate( + 'GetRecommendationsParams', + json, + ($checkedConvert) { + final val = GetRecommendationsParams( + requests: $checkedConvert('requests', (v) => v as List), + ); + return val; + }, + ); + +Map _$GetRecommendationsParamsToJson( + GetRecommendationsParams instance) => + { + 'requests': instance.requests.toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_response.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_response.dart new file mode 100644 index 0000000000..0715ac5f49 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_response.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/recommendations_response.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'get_recommendations_response.g.dart'; + +@JsonSerializable() +final class GetRecommendationsResponse { + /// Returns a new [GetRecommendationsResponse] instance. + const GetRecommendationsResponse({ + this.results, + }); + + @JsonKey(name: r'results') + final List? results; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GetRecommendationsResponse && other.results == results; + + @override + int get hashCode => results.hashCode; + + factory GetRecommendationsResponse.fromJson(Map json) => + _$GetRecommendationsResponseFromJson(json); + + Map toJson() => _$GetRecommendationsResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_response.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_response.g.dart new file mode 100644 index 0000000000..f50c5e72f5 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_response.g.dart @@ -0,0 +1,39 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'get_recommendations_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GetRecommendationsResponse _$GetRecommendationsResponseFromJson( + Map json) => + $checkedCreate( + 'GetRecommendationsResponse', + json, + ($checkedConvert) { + final val = GetRecommendationsResponse( + results: $checkedConvert( + 'results', + (v) => (v as List?) + ?.map((e) => RecommendationsResponse.fromJson( + e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$GetRecommendationsResponseToJson( + GetRecommendationsResponse instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('results', instance.results?.map((e) => e.toJson()).toList()); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/highlight_result_option.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/highlight_result_option.dart new file mode 100644 index 0000000000..4fa2ffb204 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/highlight_result_option.dart @@ -0,0 +1,59 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/match_level.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'highlight_result_option.g.dart'; + +@JsonSerializable() +final class HighlightResultOption { + /// Returns a new [HighlightResultOption] instance. + const HighlightResultOption({ + required this.value, + required this.matchLevel, + required this.matchedWords, + this.fullyHighlighted, + }); + + /// Markup text with `facetQuery` matches highlighted. + @JsonKey(name: r'value') + final String value; + + @JsonKey(name: r'matchLevel') + final MatchLevel matchLevel; + + /// List of words from the query that matched the object. + @JsonKey(name: r'matchedWords') + final List matchedWords; + + /// Whether the entire attribute value is highlighted. + @JsonKey(name: r'fullyHighlighted') + final bool? fullyHighlighted; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is HighlightResultOption && + other.value == value && + other.matchLevel == matchLevel && + other.matchedWords == matchedWords && + other.fullyHighlighted == fullyHighlighted; + + @override + int get hashCode => + value.hashCode + + matchLevel.hashCode + + matchedWords.hashCode + + fullyHighlighted.hashCode; + + factory HighlightResultOption.fromJson(Map json) => + _$HighlightResultOptionFromJson(json); + + Map toJson() => _$HighlightResultOptionToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/highlight_result_option.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/highlight_result_option.g.dart new file mode 100644 index 0000000000..ec168a5fe5 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/highlight_result_option.g.dart @@ -0,0 +1,50 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'highlight_result_option.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +HighlightResultOption _$HighlightResultOptionFromJson( + Map json) => + $checkedCreate( + 'HighlightResultOption', + json, + ($checkedConvert) { + final val = HighlightResultOption( + value: $checkedConvert('value', (v) => v as String), + matchLevel: $checkedConvert( + 'matchLevel', (v) => $enumDecode(_$MatchLevelEnumMap, v)), + matchedWords: $checkedConvert('matchedWords', + (v) => (v as List).map((e) => e as String).toList()), + fullyHighlighted: + $checkedConvert('fullyHighlighted', (v) => v as bool?), + ); + return val; + }, + ); + +Map _$HighlightResultOptionToJson( + HighlightResultOption instance) { + final val = { + 'value': instance.value, + 'matchLevel': instance.matchLevel.toJson(), + 'matchedWords': instance.matchedWords, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('fullyHighlighted', instance.fullyHighlighted); + return val; +} + +const _$MatchLevelEnumMap = { + MatchLevel.none: 'none', + MatchLevel.partial: 'partial', + MatchLevel.full: 'full', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/index_settings_as_search_params.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/index_settings_as_search_params.dart new file mode 100644 index 0000000000..87157a4c83 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/index_settings_as_search_params.dart @@ -0,0 +1,364 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/index_settings_as_search_params_semantic_search.dart'; +import 'package:algolia_client_recommend/src/model/query_type.dart'; +import 'package:algolia_client_recommend/src/model/advanced_syntax_features.dart'; +import 'package:algolia_client_recommend/src/model/alternatives_as_exact.dart'; +import 'package:algolia_client_recommend/src/model/remove_words_if_no_results.dart'; +import 'package:algolia_client_recommend/src/model/exact_on_single_word_query.dart'; +import 'package:algolia_client_recommend/src/model/mode.dart'; +import 'package:algolia_client_recommend/src/model/rendering_content.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'index_settings_as_search_params.g.dart'; + +@JsonSerializable() +final class IndexSettingsAsSearchParams { + /// Returns a new [IndexSettingsAsSearchParams] instance. + const IndexSettingsAsSearchParams({ + this.attributesForFaceting, + this.attributesToRetrieve, + this.restrictSearchableAttributes, + this.ranking, + this.customRanking, + this.relevancyStrictness, + this.attributesToHighlight, + this.attributesToSnippet, + this.highlightPreTag, + this.highlightPostTag, + this.snippetEllipsisText, + this.restrictHighlightAndSnippetArrays, + this.hitsPerPage, + this.minWordSizefor1Typo, + this.minWordSizefor2Typos, + this.typoTolerance, + this.allowTyposOnNumericTokens, + this.disableTypoToleranceOnAttributes, + this.ignorePlurals, + this.removeStopWords, + this.keepDiacriticsOnCharacters, + this.queryLanguages, + this.decompoundQuery, + this.enableRules, + this.enablePersonalization, + this.queryType, + this.removeWordsIfNoResults, + this.mode, + this.semanticSearch, + this.advancedSyntax, + this.optionalWords, + this.disableExactOnAttributes, + this.exactOnSingleWordQuery, + this.alternativesAsExact, + this.advancedSyntaxFeatures, + this.explain, + this.distinct, + this.attributeForDistinct, + this.synonyms, + this.replaceSynonymsInHighlight, + this.minProximity, + this.responseFields, + this.maxFacetHits, + this.attributeCriteriaComputedByMinProximity, + this.renderingContent, + }); + + /// Attributes used for [faceting](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/) and the [modifiers](https://www.algolia.com/doc/api-reference/api-parameters/attributesForFaceting/#modifiers) that can be applied: `filterOnly`, `searchable`, and `afterDistinct`. + @JsonKey(name: r'attributesForFaceting') + final List? attributesForFaceting; + + /// Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. By default, the response includes all attributes. + @JsonKey(name: r'attributesToRetrieve') + final List? attributesToRetrieve; + + /// Restricts a query to only look at a subset of your [searchable attributes](https://www.algolia.com/doc/guides/managing-results/must-do/searchable-attributes/). + @JsonKey(name: r'restrictSearchableAttributes') + final List? restrictSearchableAttributes; + + /// Determines the order in which Algolia [returns your results](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/). + @JsonKey(name: r'ranking') + final List? ranking; + + /// Specifies the [Custom ranking criterion](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Use the `asc` and `desc` modifiers to specify the ranking order: ascending or descending. + @JsonKey(name: r'customRanking') + final List? customRanking; + + /// Relevancy threshold below which less relevant results aren't included in the results. + @JsonKey(name: r'relevancyStrictness') + final int? relevancyStrictness; + + /// Attributes to highlight. Strings that match the search query in the attributes are highlighted by surrounding them with HTML tags (`highlightPreTag` and `highlightPostTag`). + @JsonKey(name: r'attributesToHighlight') + final List? attributesToHighlight; + + /// Attributes to _snippet_. 'Snippeting' is shortening the attribute to a certain number of words. If not specified, the attribute is shortened to the 10 words around the matching string but you can specify the number. For example: `body:20`. + @JsonKey(name: r'attributesToSnippet') + final List? attributesToSnippet; + + /// HTML string to insert before the highlighted parts in all highlight and snippet results. + @JsonKey(name: r'highlightPreTag') + final String? highlightPreTag; + + /// HTML string to insert after the highlighted parts in all highlight and snippet results. + @JsonKey(name: r'highlightPostTag') + final String? highlightPostTag; + + /// String used as an ellipsis indicator when a snippet is truncated. + @JsonKey(name: r'snippetEllipsisText') + final String? snippetEllipsisText; + + /// Restrict highlighting and snippeting to items that matched the query. + @JsonKey(name: r'restrictHighlightAndSnippetArrays') + final bool? restrictHighlightAndSnippetArrays; + + /// Number of hits per page. + // minimum: 1 + // maximum: 1000 + @JsonKey(name: r'hitsPerPage') + final int? hitsPerPage; + + /// Minimum number of characters a word in the query string must contain to accept matches with [one typo](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos). + @JsonKey(name: r'minWordSizefor1Typo') + final int? minWordSizefor1Typo; + + /// Minimum number of characters a word in the query string must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos). + @JsonKey(name: r'minWordSizefor2Typos') + final int? minWordSizefor2Typos; + + /// One of types: + /// - [TypoToleranceEnum] + /// - [bool] + @JsonKey(name: r'typoTolerance') + final dynamic typoTolerance; + + /// Whether to allow typos on numbers (\"numeric tokens\") in the query string. + @JsonKey(name: r'allowTyposOnNumericTokens') + final bool? allowTyposOnNumericTokens; + + /// Attributes for which you want to turn off [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/). + @JsonKey(name: r'disableTypoToleranceOnAttributes') + final List? disableTypoToleranceOnAttributes; + + /// One of types: + /// - [bool] + /// - [List] + @JsonKey(name: r'ignorePlurals') + final dynamic ignorePlurals; + + /// One of types: + /// - [bool] + /// - [List] + @JsonKey(name: r'removeStopWords') + final dynamic removeStopWords; + + /// Characters that the engine shouldn't automatically [normalize](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/). + @JsonKey(name: r'keepDiacriticsOnCharacters') + final String? keepDiacriticsOnCharacters; + + /// Sets your user's search language. This adjusts language-specific settings and features such as `ignorePlurals`, `removeStopWords`, and [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) word detection. + @JsonKey(name: r'queryLanguages') + final List? queryLanguages; + + /// [Splits compound words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#splitting-compound-words) into their component word parts in the query. + @JsonKey(name: r'decompoundQuery') + final bool? decompoundQuery; + + /// Incidates whether [Rules](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/) are enabled. + @JsonKey(name: r'enableRules') + final bool? enableRules; + + /// Incidates whether [Personalization](https://www.algolia.com/doc/guides/personalization/what-is-personalization/) is enabled. + @JsonKey(name: r'enablePersonalization') + final bool? enablePersonalization; + + @JsonKey(name: r'queryType') + final QueryType? queryType; + + @JsonKey(name: r'removeWordsIfNoResults') + final RemoveWordsIfNoResults? removeWordsIfNoResults; + + @JsonKey(name: r'mode') + final Mode? mode; + + @JsonKey(name: r'semanticSearch') + final IndexSettingsAsSearchParamsSemanticSearch? semanticSearch; + + /// Enables the [advanced query syntax](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/#advanced-syntax). + @JsonKey(name: r'advancedSyntax') + final bool? advancedSyntax; + + /// Words which should be considered [optional](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words) when found in a query. + @JsonKey(name: r'optionalWords') + final List? optionalWords; + + /// Attributes for which you want to [turn off the exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). + @JsonKey(name: r'disableExactOnAttributes') + final List? disableExactOnAttributes; + + @JsonKey(name: r'exactOnSingleWordQuery') + final ExactOnSingleWordQuery? exactOnSingleWordQuery; + + /// Alternatives that should be considered an exact match by [the exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). + @JsonKey(name: r'alternativesAsExact') + final List? alternativesAsExact; + + /// Allows you to specify which advanced syntax features are active when `advancedSyntax` is enabled. + @JsonKey(name: r'advancedSyntaxFeatures') + final List? advancedSyntaxFeatures; + + /// Enriches the API's response with information about how the query was processed. + @JsonKey(name: r'explain') + final List? explain; + + /// One of types: + /// - [bool] + /// - [int] + @JsonKey(name: r'distinct') + final dynamic distinct; + + /// Name of the deduplication attribute to be used with Algolia's [_distinct_ feature](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/#introducing-algolias-distinct-feature). + @JsonKey(name: r'attributeForDistinct') + final String? attributeForDistinct; + + /// Whether to take into account an index's synonyms for a particular search. + @JsonKey(name: r'synonyms') + final bool? synonyms; + + /// Whether to highlight and snippet the original word that matches the synonym or the synonym itself. + @JsonKey(name: r'replaceSynonymsInHighlight') + final bool? replaceSynonymsInHighlight; + + /// Precision of the [proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity). + // minimum: 1 + // maximum: 7 + @JsonKey(name: r'minProximity') + final int? minProximity; + + /// Attributes to include in the API response for search and browse queries. + @JsonKey(name: r'responseFields') + final List? responseFields; + + /// Maximum number of facet hits to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). + // maximum: 100 + @JsonKey(name: r'maxFacetHits') + final int? maxFacetHits; + + /// When the [Attribute criterion is ranked above Proximity](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#attribute-and-proximity-combinations) in your ranking formula, Proximity is used to select which searchable attribute is matched in the Attribute ranking stage. + @JsonKey(name: r'attributeCriteriaComputedByMinProximity') + final bool? attributeCriteriaComputedByMinProximity; + + @JsonKey(name: r'renderingContent') + final RenderingContent? renderingContent; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is IndexSettingsAsSearchParams && + other.attributesForFaceting == attributesForFaceting && + other.attributesToRetrieve == attributesToRetrieve && + other.restrictSearchableAttributes == restrictSearchableAttributes && + other.ranking == ranking && + other.customRanking == customRanking && + other.relevancyStrictness == relevancyStrictness && + other.attributesToHighlight == attributesToHighlight && + other.attributesToSnippet == attributesToSnippet && + other.highlightPreTag == highlightPreTag && + other.highlightPostTag == highlightPostTag && + other.snippetEllipsisText == snippetEllipsisText && + other.restrictHighlightAndSnippetArrays == + restrictHighlightAndSnippetArrays && + other.hitsPerPage == hitsPerPage && + other.minWordSizefor1Typo == minWordSizefor1Typo && + other.minWordSizefor2Typos == minWordSizefor2Typos && + other.typoTolerance == typoTolerance && + other.allowTyposOnNumericTokens == allowTyposOnNumericTokens && + other.disableTypoToleranceOnAttributes == + disableTypoToleranceOnAttributes && + other.ignorePlurals == ignorePlurals && + other.removeStopWords == removeStopWords && + other.keepDiacriticsOnCharacters == keepDiacriticsOnCharacters && + other.queryLanguages == queryLanguages && + other.decompoundQuery == decompoundQuery && + other.enableRules == enableRules && + other.enablePersonalization == enablePersonalization && + other.queryType == queryType && + other.removeWordsIfNoResults == removeWordsIfNoResults && + other.mode == mode && + other.semanticSearch == semanticSearch && + other.advancedSyntax == advancedSyntax && + other.optionalWords == optionalWords && + other.disableExactOnAttributes == disableExactOnAttributes && + other.exactOnSingleWordQuery == exactOnSingleWordQuery && + other.alternativesAsExact == alternativesAsExact && + other.advancedSyntaxFeatures == advancedSyntaxFeatures && + other.explain == explain && + other.distinct == distinct && + other.attributeForDistinct == attributeForDistinct && + other.synonyms == synonyms && + other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && + other.minProximity == minProximity && + other.responseFields == responseFields && + other.maxFacetHits == maxFacetHits && + other.attributeCriteriaComputedByMinProximity == + attributeCriteriaComputedByMinProximity && + other.renderingContent == renderingContent; + + @override + int get hashCode => + attributesForFaceting.hashCode + + attributesToRetrieve.hashCode + + restrictSearchableAttributes.hashCode + + ranking.hashCode + + customRanking.hashCode + + relevancyStrictness.hashCode + + attributesToHighlight.hashCode + + attributesToSnippet.hashCode + + highlightPreTag.hashCode + + highlightPostTag.hashCode + + snippetEllipsisText.hashCode + + restrictHighlightAndSnippetArrays.hashCode + + hitsPerPage.hashCode + + minWordSizefor1Typo.hashCode + + minWordSizefor2Typos.hashCode + + typoTolerance.hashCode + + allowTyposOnNumericTokens.hashCode + + disableTypoToleranceOnAttributes.hashCode + + ignorePlurals.hashCode + + removeStopWords.hashCode + + keepDiacriticsOnCharacters.hashCode + + queryLanguages.hashCode + + decompoundQuery.hashCode + + enableRules.hashCode + + enablePersonalization.hashCode + + queryType.hashCode + + removeWordsIfNoResults.hashCode + + mode.hashCode + + semanticSearch.hashCode + + advancedSyntax.hashCode + + optionalWords.hashCode + + disableExactOnAttributes.hashCode + + exactOnSingleWordQuery.hashCode + + alternativesAsExact.hashCode + + advancedSyntaxFeatures.hashCode + + explain.hashCode + + distinct.hashCode + + attributeForDistinct.hashCode + + synonyms.hashCode + + replaceSynonymsInHighlight.hashCode + + minProximity.hashCode + + responseFields.hashCode + + maxFacetHits.hashCode + + attributeCriteriaComputedByMinProximity.hashCode + + renderingContent.hashCode; + + factory IndexSettingsAsSearchParams.fromJson(Map json) => + _$IndexSettingsAsSearchParamsFromJson(json); + + Map toJson() => _$IndexSettingsAsSearchParamsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/index_settings_as_search_params.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/index_settings_as_search_params.g.dart new file mode 100644 index 0000000000..0f6c73fe3a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/index_settings_as_search_params.g.dart @@ -0,0 +1,217 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'index_settings_as_search_params.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +IndexSettingsAsSearchParams _$IndexSettingsAsSearchParamsFromJson( + Map json) => + $checkedCreate( + 'IndexSettingsAsSearchParams', + json, + ($checkedConvert) { + final val = IndexSettingsAsSearchParams( + attributesForFaceting: $checkedConvert('attributesForFaceting', + (v) => (v as List?)?.map((e) => e as String).toList()), + attributesToRetrieve: $checkedConvert('attributesToRetrieve', + (v) => (v as List?)?.map((e) => e as String).toList()), + restrictSearchableAttributes: $checkedConvert( + 'restrictSearchableAttributes', + (v) => (v as List?)?.map((e) => e as String).toList()), + ranking: $checkedConvert('ranking', + (v) => (v as List?)?.map((e) => e as String).toList()), + customRanking: $checkedConvert('customRanking', + (v) => (v as List?)?.map((e) => e as String).toList()), + relevancyStrictness: + $checkedConvert('relevancyStrictness', (v) => v as int?), + attributesToHighlight: $checkedConvert('attributesToHighlight', + (v) => (v as List?)?.map((e) => e as String).toList()), + attributesToSnippet: $checkedConvert('attributesToSnippet', + (v) => (v as List?)?.map((e) => e as String).toList()), + highlightPreTag: + $checkedConvert('highlightPreTag', (v) => v as String?), + highlightPostTag: + $checkedConvert('highlightPostTag', (v) => v as String?), + snippetEllipsisText: + $checkedConvert('snippetEllipsisText', (v) => v as String?), + restrictHighlightAndSnippetArrays: $checkedConvert( + 'restrictHighlightAndSnippetArrays', (v) => v as bool?), + hitsPerPage: $checkedConvert('hitsPerPage', (v) => v as int?), + minWordSizefor1Typo: + $checkedConvert('minWordSizefor1Typo', (v) => v as int?), + minWordSizefor2Typos: + $checkedConvert('minWordSizefor2Typos', (v) => v as int?), + typoTolerance: $checkedConvert('typoTolerance', (v) => v), + allowTyposOnNumericTokens: + $checkedConvert('allowTyposOnNumericTokens', (v) => v as bool?), + disableTypoToleranceOnAttributes: $checkedConvert( + 'disableTypoToleranceOnAttributes', + (v) => (v as List?)?.map((e) => e as String).toList()), + ignorePlurals: $checkedConvert('ignorePlurals', (v) => v), + removeStopWords: $checkedConvert('removeStopWords', (v) => v), + keepDiacriticsOnCharacters: $checkedConvert( + 'keepDiacriticsOnCharacters', (v) => v as String?), + queryLanguages: $checkedConvert('queryLanguages', + (v) => (v as List?)?.map((e) => e as String).toList()), + decompoundQuery: + $checkedConvert('decompoundQuery', (v) => v as bool?), + enableRules: $checkedConvert('enableRules', (v) => v as bool?), + enablePersonalization: + $checkedConvert('enablePersonalization', (v) => v as bool?), + queryType: $checkedConvert( + 'queryType', (v) => $enumDecodeNullable(_$QueryTypeEnumMap, v)), + removeWordsIfNoResults: $checkedConvert('removeWordsIfNoResults', + (v) => $enumDecodeNullable(_$RemoveWordsIfNoResultsEnumMap, v)), + mode: $checkedConvert( + 'mode', (v) => $enumDecodeNullable(_$ModeEnumMap, v)), + semanticSearch: $checkedConvert( + 'semanticSearch', + (v) => v == null + ? null + : IndexSettingsAsSearchParamsSemanticSearch.fromJson( + v as Map)), + advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), + optionalWords: $checkedConvert('optionalWords', + (v) => (v as List?)?.map((e) => e as String).toList()), + disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', + (v) => (v as List?)?.map((e) => e as String).toList()), + exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', + (v) => $enumDecodeNullable(_$ExactOnSingleWordQueryEnumMap, v)), + alternativesAsExact: $checkedConvert( + 'alternativesAsExact', + (v) => (v as List?) + ?.map((e) => $enumDecode(_$AlternativesAsExactEnumMap, e)) + .toList()), + advancedSyntaxFeatures: $checkedConvert( + 'advancedSyntaxFeatures', + (v) => (v as List?) + ?.map((e) => $enumDecode(_$AdvancedSyntaxFeaturesEnumMap, e)) + .toList()), + explain: $checkedConvert('explain', + (v) => (v as List?)?.map((e) => e as String).toList()), + distinct: $checkedConvert('distinct', (v) => v), + attributeForDistinct: + $checkedConvert('attributeForDistinct', (v) => v as String?), + synonyms: $checkedConvert('synonyms', (v) => v as bool?), + replaceSynonymsInHighlight: + $checkedConvert('replaceSynonymsInHighlight', (v) => v as bool?), + minProximity: $checkedConvert('minProximity', (v) => v as int?), + responseFields: $checkedConvert('responseFields', + (v) => (v as List?)?.map((e) => e as String).toList()), + maxFacetHits: $checkedConvert('maxFacetHits', (v) => v as int?), + attributeCriteriaComputedByMinProximity: $checkedConvert( + 'attributeCriteriaComputedByMinProximity', (v) => v as bool?), + renderingContent: $checkedConvert( + 'renderingContent', + (v) => v == null + ? null + : RenderingContent.fromJson(v as Map)), + ); + return val; + }, + ); + +Map _$IndexSettingsAsSearchParamsToJson( + IndexSettingsAsSearchParams instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('attributesForFaceting', instance.attributesForFaceting); + writeNotNull('attributesToRetrieve', instance.attributesToRetrieve); + writeNotNull( + 'restrictSearchableAttributes', instance.restrictSearchableAttributes); + writeNotNull('ranking', instance.ranking); + writeNotNull('customRanking', instance.customRanking); + writeNotNull('relevancyStrictness', instance.relevancyStrictness); + writeNotNull('attributesToHighlight', instance.attributesToHighlight); + writeNotNull('attributesToSnippet', instance.attributesToSnippet); + writeNotNull('highlightPreTag', instance.highlightPreTag); + writeNotNull('highlightPostTag', instance.highlightPostTag); + writeNotNull('snippetEllipsisText', instance.snippetEllipsisText); + writeNotNull('restrictHighlightAndSnippetArrays', + instance.restrictHighlightAndSnippetArrays); + writeNotNull('hitsPerPage', instance.hitsPerPage); + writeNotNull('minWordSizefor1Typo', instance.minWordSizefor1Typo); + writeNotNull('minWordSizefor2Typos', instance.minWordSizefor2Typos); + writeNotNull('typoTolerance', instance.typoTolerance); + writeNotNull('allowTyposOnNumericTokens', instance.allowTyposOnNumericTokens); + writeNotNull('disableTypoToleranceOnAttributes', + instance.disableTypoToleranceOnAttributes); + writeNotNull('ignorePlurals', instance.ignorePlurals); + writeNotNull('removeStopWords', instance.removeStopWords); + writeNotNull( + 'keepDiacriticsOnCharacters', instance.keepDiacriticsOnCharacters); + writeNotNull('queryLanguages', instance.queryLanguages); + writeNotNull('decompoundQuery', instance.decompoundQuery); + writeNotNull('enableRules', instance.enableRules); + writeNotNull('enablePersonalization', instance.enablePersonalization); + writeNotNull('queryType', instance.queryType?.toJson()); + writeNotNull( + 'removeWordsIfNoResults', instance.removeWordsIfNoResults?.toJson()); + writeNotNull('mode', instance.mode?.toJson()); + writeNotNull('semanticSearch', instance.semanticSearch?.toJson()); + writeNotNull('advancedSyntax', instance.advancedSyntax); + writeNotNull('optionalWords', instance.optionalWords); + writeNotNull('disableExactOnAttributes', instance.disableExactOnAttributes); + writeNotNull( + 'exactOnSingleWordQuery', instance.exactOnSingleWordQuery?.toJson()); + writeNotNull('alternativesAsExact', + instance.alternativesAsExact?.map((e) => e.toJson()).toList()); + writeNotNull('advancedSyntaxFeatures', + instance.advancedSyntaxFeatures?.map((e) => e.toJson()).toList()); + writeNotNull('explain', instance.explain); + writeNotNull('distinct', instance.distinct); + writeNotNull('attributeForDistinct', instance.attributeForDistinct); + writeNotNull('synonyms', instance.synonyms); + writeNotNull( + 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); + writeNotNull('minProximity', instance.minProximity); + writeNotNull('responseFields', instance.responseFields); + writeNotNull('maxFacetHits', instance.maxFacetHits); + writeNotNull('attributeCriteriaComputedByMinProximity', + instance.attributeCriteriaComputedByMinProximity); + writeNotNull('renderingContent', instance.renderingContent?.toJson()); + return val; +} + +const _$QueryTypeEnumMap = { + QueryType.prefixLast: 'prefixLast', + QueryType.prefixAll: 'prefixAll', + QueryType.prefixNone: 'prefixNone', +}; + +const _$RemoveWordsIfNoResultsEnumMap = { + RemoveWordsIfNoResults.none: 'none', + RemoveWordsIfNoResults.lastWords: 'lastWords', + RemoveWordsIfNoResults.firstWords: 'firstWords', + RemoveWordsIfNoResults.allOptional: 'allOptional', +}; + +const _$ModeEnumMap = { + Mode.neuralSearch: 'neuralSearch', + Mode.keywordSearch: 'keywordSearch', +}; + +const _$ExactOnSingleWordQueryEnumMap = { + ExactOnSingleWordQuery.attribute: 'attribute', + ExactOnSingleWordQuery.none: 'none', + ExactOnSingleWordQuery.word: 'word', +}; + +const _$AlternativesAsExactEnumMap = { + AlternativesAsExact.ignorePlurals: 'ignorePlurals', + AlternativesAsExact.singleWordSynonym: 'singleWordSynonym', + AlternativesAsExact.multiWordsSynonym: 'multiWordsSynonym', +}; + +const _$AdvancedSyntaxFeaturesEnumMap = { + AdvancedSyntaxFeatures.exactPhrase: 'exactPhrase', + AdvancedSyntaxFeatures.excludeWords: 'excludeWords', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/index_settings_as_search_params_semantic_search.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/index_settings_as_search_params_semantic_search.dart new file mode 100644 index 0000000000..bf96e0231c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/index_settings_as_search_params_semantic_search.dart @@ -0,0 +1,39 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'index_settings_as_search_params_semantic_search.g.dart'; + +@JsonSerializable() +final class IndexSettingsAsSearchParamsSemanticSearch { + /// Returns a new [IndexSettingsAsSearchParamsSemanticSearch] instance. + const IndexSettingsAsSearchParamsSemanticSearch({ + this.eventSources, + }); + + /// Indices from which to collect click and conversion events. If null, the current index and replica group will be used as the event source. + @JsonKey(name: r'eventSources') + final List? eventSources; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is IndexSettingsAsSearchParamsSemanticSearch && + other.eventSources == eventSources; + + @override + int get hashCode => (eventSources == null ? 0 : eventSources.hashCode); + + factory IndexSettingsAsSearchParamsSemanticSearch.fromJson( + Map json) => + _$IndexSettingsAsSearchParamsSemanticSearchFromJson(json); + + Map toJson() => + _$IndexSettingsAsSearchParamsSemanticSearchToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/index_settings_as_search_params_semantic_search.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/index_settings_as_search_params_semantic_search.g.dart new file mode 100644 index 0000000000..11891f95e1 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/index_settings_as_search_params_semantic_search.g.dart @@ -0,0 +1,38 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'index_settings_as_search_params_semantic_search.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +IndexSettingsAsSearchParamsSemanticSearch + _$IndexSettingsAsSearchParamsSemanticSearchFromJson( + Map json) => + $checkedCreate( + 'IndexSettingsAsSearchParamsSemanticSearch', + json, + ($checkedConvert) { + final val = IndexSettingsAsSearchParamsSemanticSearch( + eventSources: $checkedConvert( + 'eventSources', + (v) => + (v as List?)?.map((e) => e as String).toList()), + ); + return val; + }, + ); + +Map _$IndexSettingsAsSearchParamsSemanticSearchToJson( + IndexSettingsAsSearchParamsSemanticSearch instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('eventSources', instance.eventSources); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/match_level.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/match_level.dart new file mode 100644 index 0000000000..efdd963b5f --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/match_level.dart @@ -0,0 +1,31 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Indicates how well the attribute matched the search query. +@JsonEnum(valueField: 'raw') +enum MatchLevel { + /// Indicates how well the attribute matched the search query. + none(r'none'), + + /// Indicates how well the attribute matched the search query. + partial(r'partial'), + + /// Indicates how well the attribute matched the search query. + full(r'full'); + + const MatchLevel(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static MatchLevel fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/matched_geo_location.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/matched_geo_location.dart new file mode 100644 index 0000000000..43a4d4738f --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/matched_geo_location.dart @@ -0,0 +1,49 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'matched_geo_location.g.dart'; + +@JsonSerializable() +final class MatchedGeoLocation { + /// Returns a new [MatchedGeoLocation] instance. + const MatchedGeoLocation({ + this.lat, + this.lng, + this.distance, + }); + + /// Latitude of the matched location. + @JsonKey(name: r'lat') + final double? lat; + + /// Longitude of the matched location. + @JsonKey(name: r'lng') + final double? lng; + + /// Distance between the matched location and the search location (in meters). + @JsonKey(name: r'distance') + final int? distance; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is MatchedGeoLocation && + other.lat == lat && + other.lng == lng && + other.distance == distance; + + @override + int get hashCode => lat.hashCode + lng.hashCode + distance.hashCode; + + factory MatchedGeoLocation.fromJson(Map json) => + _$MatchedGeoLocationFromJson(json); + + Map toJson() => _$MatchedGeoLocationToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/matched_geo_location.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/matched_geo_location.g.dart new file mode 100644 index 0000000000..2c68bc3020 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/matched_geo_location.g.dart @@ -0,0 +1,36 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'matched_geo_location.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +MatchedGeoLocation _$MatchedGeoLocationFromJson(Map json) => + $checkedCreate( + 'MatchedGeoLocation', + json, + ($checkedConvert) { + final val = MatchedGeoLocation( + lat: $checkedConvert('lat', (v) => (v as num?)?.toDouble()), + lng: $checkedConvert('lng', (v) => (v as num?)?.toDouble()), + distance: $checkedConvert('distance', (v) => v as int?), + ); + return val; + }, + ); + +Map _$MatchedGeoLocationToJson(MatchedGeoLocation instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('lat', instance.lat); + writeNotNull('lng', instance.lng); + writeNotNull('distance', instance.distance); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/mode.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/mode.dart new file mode 100644 index 0000000000..44ac83d064 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/mode.dart @@ -0,0 +1,28 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Search mode the index will use to query for results. +@JsonEnum(valueField: 'raw') +enum Mode { + /// Search mode the index will use to query for results. + neuralSearch(r'neuralSearch'), + + /// Search mode the index will use to query for results. + keywordSearch(r'keywordSearch'); + + const Mode(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static Mode fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/params.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/params.dart new file mode 100644 index 0000000000..779d6cd839 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/params.dart @@ -0,0 +1,65 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/rendering_content.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'params.g.dart'; + +@JsonSerializable() +final class Params { + /// Returns a new [Params] instance. + const Params({ + this.query, + this.automaticFacetFilters, + this.automaticOptionalFacetFilters, + this.renderingContent, + }); + + /// One of types: + /// - [ConsequenceQueryObject] + /// - [String] + @JsonKey(name: r'query') + final dynamic query; + + /// One of types: + /// - [List] + /// - [List] + @JsonKey(name: r'automaticFacetFilters') + final dynamic automaticFacetFilters; + + /// One of types: + /// - [List] + /// - [List] + @JsonKey(name: r'automaticOptionalFacetFilters') + final dynamic automaticOptionalFacetFilters; + + @JsonKey(name: r'renderingContent') + final RenderingContent? renderingContent; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Params && + other.query == query && + other.automaticFacetFilters == automaticFacetFilters && + other.automaticOptionalFacetFilters == + automaticOptionalFacetFilters && + other.renderingContent == renderingContent; + + @override + int get hashCode => + query.hashCode + + automaticFacetFilters.hashCode + + automaticOptionalFacetFilters.hashCode + + renderingContent.hashCode; + + factory Params.fromJson(Map json) => _$ParamsFromJson(json); + + Map toJson() => _$ParamsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/params.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/params.g.dart new file mode 100644 index 0000000000..74d4e6c61a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/params.g.dart @@ -0,0 +1,44 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'params.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Params _$ParamsFromJson(Map json) => $checkedCreate( + 'Params', + json, + ($checkedConvert) { + final val = Params( + query: $checkedConvert('query', (v) => v), + automaticFacetFilters: + $checkedConvert('automaticFacetFilters', (v) => v), + automaticOptionalFacetFilters: + $checkedConvert('automaticOptionalFacetFilters', (v) => v), + renderingContent: $checkedConvert( + 'renderingContent', + (v) => v == null + ? null + : RenderingContent.fromJson(v as Map)), + ); + return val; + }, + ); + +Map _$ParamsToJson(Params instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('query', instance.query); + writeNotNull('automaticFacetFilters', instance.automaticFacetFilters); + writeNotNull( + 'automaticOptionalFacetFilters', instance.automaticOptionalFacetFilters); + writeNotNull('renderingContent', instance.renderingContent?.toJson()); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/personalization.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/personalization.dart new file mode 100644 index 0000000000..c336d9fb49 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/personalization.dart @@ -0,0 +1,50 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'personalization.g.dart'; + +@JsonSerializable() +final class Personalization { + /// Returns a new [Personalization] instance. + const Personalization({ + this.filtersScore, + this.rankingScore, + this.score, + }); + + /// The score of the filters. + @JsonKey(name: r'filtersScore') + final int? filtersScore; + + /// The score of the ranking. + @JsonKey(name: r'rankingScore') + final int? rankingScore; + + /// The score of the event. + @JsonKey(name: r'score') + final int? score; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Personalization && + other.filtersScore == filtersScore && + other.rankingScore == rankingScore && + other.score == score; + + @override + int get hashCode => + filtersScore.hashCode + rankingScore.hashCode + score.hashCode; + + factory Personalization.fromJson(Map json) => + _$PersonalizationFromJson(json); + + Map toJson() => _$PersonalizationToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/personalization.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/personalization.g.dart new file mode 100644 index 0000000000..b448c563ab --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/personalization.g.dart @@ -0,0 +1,36 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'personalization.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Personalization _$PersonalizationFromJson(Map json) => + $checkedCreate( + 'Personalization', + json, + ($checkedConvert) { + final val = Personalization( + filtersScore: $checkedConvert('filtersScore', (v) => v as int?), + rankingScore: $checkedConvert('rankingScore', (v) => v as int?), + score: $checkedConvert('score', (v) => v as int?), + ); + return val; + }, + ); + +Map _$PersonalizationToJson(Personalization instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('filtersScore', instance.filtersScore); + writeNotNull('rankingScore', instance.rankingScore); + writeNotNull('score', instance.score); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/promote_object_id.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/promote_object_id.dart new file mode 100644 index 0000000000..28d18ca9d9 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/promote_object_id.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'promote_object_id.g.dart'; + +@JsonSerializable() +final class PromoteObjectID { + /// Returns a new [PromoteObjectID] instance. + const PromoteObjectID({ + required this.objectID, + required this.position, + }); + + /// Unique identifier of the record to promote. + @JsonKey(name: r'objectID') + final String objectID; + + /// The position to promote the records to. If you pass objectIDs, the records are placed at this position as a group. For example, if you pronmote four objectIDs to position 0, the records take the first four positions. + @JsonKey(name: r'position') + final int position; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PromoteObjectID && + other.objectID == objectID && + other.position == position; + + @override + int get hashCode => objectID.hashCode + position.hashCode; + + factory PromoteObjectID.fromJson(Map json) => + _$PromoteObjectIDFromJson(json); + + Map toJson() => _$PromoteObjectIDToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/promote_object_id.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/promote_object_id.g.dart new file mode 100644 index 0000000000..d32db19dc3 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/promote_object_id.g.dart @@ -0,0 +1,26 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'promote_object_id.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PromoteObjectID _$PromoteObjectIDFromJson(Map json) => + $checkedCreate( + 'PromoteObjectID', + json, + ($checkedConvert) { + final val = PromoteObjectID( + objectID: $checkedConvert('objectID', (v) => v as String), + position: $checkedConvert('position', (v) => v as int), + ); + return val; + }, + ); + +Map _$PromoteObjectIDToJson(PromoteObjectID instance) => + { + 'objectID': instance.objectID, + 'position': instance.position, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/promote_object_ids.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/promote_object_ids.dart new file mode 100644 index 0000000000..869301b009 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/promote_object_ids.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'promote_object_ids.g.dart'; + +@JsonSerializable() +final class PromoteObjectIDs { + /// Returns a new [PromoteObjectIDs] instance. + const PromoteObjectIDs({ + required this.objectIDs, + required this.position, + }); + + /// Unique identifiers of the records to promote. + @JsonKey(name: r'objectIDs') + final List objectIDs; + + /// The position to promote the records to. If you pass objectIDs, the records are placed at this position as a group. For example, if you pronmote four objectIDs to position 0, the records take the first four positions. + @JsonKey(name: r'position') + final int position; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PromoteObjectIDs && + other.objectIDs == objectIDs && + other.position == position; + + @override + int get hashCode => objectIDs.hashCode + position.hashCode; + + factory PromoteObjectIDs.fromJson(Map json) => + _$PromoteObjectIDsFromJson(json); + + Map toJson() => _$PromoteObjectIDsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/promote_object_ids.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/promote_object_ids.g.dart new file mode 100644 index 0000000000..9798334a93 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/promote_object_ids.g.dart @@ -0,0 +1,27 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'promote_object_ids.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PromoteObjectIDs _$PromoteObjectIDsFromJson(Map json) => + $checkedCreate( + 'PromoteObjectIDs', + json, + ($checkedConvert) { + final val = PromoteObjectIDs( + objectIDs: $checkedConvert('objectIDs', + (v) => (v as List).map((e) => e as String).toList()), + position: $checkedConvert('position', (v) => v as int), + ); + return val; + }, + ); + +Map _$PromoteObjectIDsToJson(PromoteObjectIDs instance) => + { + 'objectIDs': instance.objectIDs, + 'position': instance.position, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/query_type.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/query_type.dart new file mode 100644 index 0000000000..ef7b47d661 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/query_type.dart @@ -0,0 +1,31 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Determines how query words are [interpreted as prefixes](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/prefix-searching/). +@JsonEnum(valueField: 'raw') +enum QueryType { + /// Determines how query words are [interpreted as prefixes](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/prefix-searching/). + prefixLast(r'prefixLast'), + + /// Determines how query words are [interpreted as prefixes](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/prefix-searching/). + prefixAll(r'prefixAll'), + + /// Determines how query words are [interpreted as prefixes](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/prefix-searching/). + prefixNone(r'prefixNone'); + + const QueryType(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static QueryType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/ranking_info.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/ranking_info.dart new file mode 100644 index 0000000000..1a24f87e7c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/ranking_info.dart @@ -0,0 +1,122 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/matched_geo_location.dart'; +import 'package:algolia_client_recommend/src/model/personalization.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'ranking_info.g.dart'; + +@JsonSerializable() +final class RankingInfo { + /// Returns a new [RankingInfo] instance. + const RankingInfo({ + required this.filters, + required this.firstMatchedWord, + required this.geoDistance, + this.geoPrecision, + this.matchedGeoLocation, + this.personalization, + required this.nbExactWords, + required this.nbTypos, + required this.promoted, + this.proximityDistance, + required this.userScore, + required this.words, + this.promotedByReRanking, + }); + + /// This field is reserved for advanced usage. + @JsonKey(name: r'filters') + final int filters; + + /// Position of the most important matched attribute in the attributes to index list. + @JsonKey(name: r'firstMatchedWord') + final int firstMatchedWord; + + /// 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). + @JsonKey(name: r'geoDistance') + final int geoDistance; + + /// Precision used when computing the geo distance, in meters. + @JsonKey(name: r'geoPrecision') + final int? geoPrecision; + + @JsonKey(name: r'matchedGeoLocation') + final MatchedGeoLocation? matchedGeoLocation; + + @JsonKey(name: r'personalization') + final Personalization? personalization; + + /// Number of exactly matched words. + @JsonKey(name: r'nbExactWords') + final int nbExactWords; + + /// Number of typos encountered when matching the record. + @JsonKey(name: r'nbTypos') + final int nbTypos; + + /// Present and set to true if a Rule promoted the hit. + @JsonKey(name: r'promoted') + final bool promoted; + + /// When the query contains more than one word, the sum of the distances between matched words (in meters). + @JsonKey(name: r'proximityDistance') + final int? proximityDistance; + + /// Custom ranking for the object, expressed as a single integer value. + @JsonKey(name: r'userScore') + final int userScore; + + /// Number of matched words, including prefixes and typos. + @JsonKey(name: r'words') + final int words; + + /// Wether the record are promoted by the re-ranking strategy. + @JsonKey(name: r'promotedByReRanking') + final bool? promotedByReRanking; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is RankingInfo && + other.filters == filters && + other.firstMatchedWord == firstMatchedWord && + other.geoDistance == geoDistance && + other.geoPrecision == geoPrecision && + other.matchedGeoLocation == matchedGeoLocation && + other.personalization == personalization && + other.nbExactWords == nbExactWords && + other.nbTypos == nbTypos && + other.promoted == promoted && + other.proximityDistance == proximityDistance && + other.userScore == userScore && + other.words == words && + other.promotedByReRanking == promotedByReRanking; + + @override + int get hashCode => + filters.hashCode + + firstMatchedWord.hashCode + + geoDistance.hashCode + + geoPrecision.hashCode + + matchedGeoLocation.hashCode + + personalization.hashCode + + nbExactWords.hashCode + + nbTypos.hashCode + + promoted.hashCode + + proximityDistance.hashCode + + userScore.hashCode + + words.hashCode + + promotedByReRanking.hashCode; + + factory RankingInfo.fromJson(Map json) => + _$RankingInfoFromJson(json); + + Map toJson() => _$RankingInfoToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/ranking_info.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/ranking_info.g.dart new file mode 100644 index 0000000000..08785da0a0 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/ranking_info.g.dart @@ -0,0 +1,67 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'ranking_info.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +RankingInfo _$RankingInfoFromJson(Map json) => $checkedCreate( + 'RankingInfo', + json, + ($checkedConvert) { + final val = RankingInfo( + filters: $checkedConvert('filters', (v) => v as int), + firstMatchedWord: + $checkedConvert('firstMatchedWord', (v) => v as int), + geoDistance: $checkedConvert('geoDistance', (v) => v as int), + geoPrecision: $checkedConvert('geoPrecision', (v) => v as int?), + matchedGeoLocation: $checkedConvert( + 'matchedGeoLocation', + (v) => v == null + ? null + : MatchedGeoLocation.fromJson(v as Map)), + personalization: $checkedConvert( + 'personalization', + (v) => v == null + ? null + : Personalization.fromJson(v as Map)), + nbExactWords: $checkedConvert('nbExactWords', (v) => v as int), + nbTypos: $checkedConvert('nbTypos', (v) => v as int), + promoted: $checkedConvert('promoted', (v) => v as bool), + proximityDistance: + $checkedConvert('proximityDistance', (v) => v as int?), + userScore: $checkedConvert('userScore', (v) => v as int), + words: $checkedConvert('words', (v) => v as int), + promotedByReRanking: + $checkedConvert('promotedByReRanking', (v) => v as bool?), + ); + return val; + }, + ); + +Map _$RankingInfoToJson(RankingInfo instance) { + final val = { + 'filters': instance.filters, + 'firstMatchedWord': instance.firstMatchedWord, + 'geoDistance': instance.geoDistance, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('geoPrecision', instance.geoPrecision); + writeNotNull('matchedGeoLocation', instance.matchedGeoLocation?.toJson()); + writeNotNull('personalization', instance.personalization?.toJson()); + val['nbExactWords'] = instance.nbExactWords; + val['nbTypos'] = instance.nbTypos; + val['promoted'] = instance.promoted; + writeNotNull('proximityDistance', instance.proximityDistance); + val['userScore'] = instance.userScore; + val['words'] = instance.words; + writeNotNull('promotedByReRanking', instance.promotedByReRanking); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_hit.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_hit.dart new file mode 100644 index 0000000000..310d86c1cc --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_hit.dart @@ -0,0 +1,90 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/ranking_info.dart'; + +import 'package:collection/collection.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'recommend_hit.g.dart'; + +@JsonSerializable(createFieldMap: true) +final class RecommendHit extends DelegatingMap { + /// Returns a new [RecommendHit] instance. + const RecommendHit({ + required this.objectID, + this.highlightResult, + this.snippetResult, + this.rankingInfo, + this.distinctSeqID, + required this.score, + Map additionalProperties = const {}, + }) : super(additionalProperties); + + /// Unique object identifier. + @JsonKey(name: r'objectID') + final String objectID; + + /// Show highlighted section and words matched on a query. + @JsonKey(name: r'_highlightResult') + final Map? highlightResult; + + /// Snippeted attributes show parts of the matched attributes. Only returned when attributesToSnippet is non-empty. + @JsonKey(name: r'_snippetResult') + final Map? snippetResult; + + @JsonKey(name: r'_rankingInfo') + final RankingInfo? rankingInfo; + + @JsonKey(name: r'_distinctSeqID') + final int? distinctSeqID; + + /// Recommendation score. + // minimum: 0 + // maximum: 100 + @JsonKey(name: r'_score') + final double score; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is RecommendHit && + other.objectID == objectID && + other.highlightResult == highlightResult && + other.snippetResult == snippetResult && + other.rankingInfo == rankingInfo && + other.distinctSeqID == distinctSeqID && + other.score == score && + const MapEquality().equals(this, this); + + @override + int get hashCode => + objectID.hashCode + + highlightResult.hashCode + + snippetResult.hashCode + + rankingInfo.hashCode + + distinctSeqID.hashCode + + score.hashCode + + const MapEquality().hash(this); + + factory RecommendHit.fromJson(Map json) { + final instance = _$RecommendHitFromJson(json); + final additionalProperties = Map.from(json) + ..removeWhere((key, value) => _$RecommendHitFieldMap.containsKey(key)); + return RecommendHit( + objectID: instance.objectID, + highlightResult: instance.highlightResult, + snippetResult: instance.snippetResult, + rankingInfo: instance.rankingInfo, + distinctSeqID: instance.distinctSeqID, + score: instance.score, + additionalProperties: additionalProperties, + ); + } + + Map toJson() => _$RecommendHitToJson(this)..addAll(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_hit.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_hit.g.dart new file mode 100644 index 0000000000..55dacd4ea7 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_hit.g.dart @@ -0,0 +1,65 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'recommend_hit.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +RecommendHit _$RecommendHitFromJson(Map json) => + $checkedCreate( + 'RecommendHit', + json, + ($checkedConvert) { + final val = RecommendHit( + objectID: $checkedConvert('objectID', (v) => v as String), + highlightResult: $checkedConvert( + '_highlightResult', (v) => v as Map?), + snippetResult: $checkedConvert( + '_snippetResult', (v) => v as Map?), + rankingInfo: $checkedConvert( + '_rankingInfo', + (v) => v == null + ? null + : RankingInfo.fromJson(v as Map)), + distinctSeqID: $checkedConvert('_distinctSeqID', (v) => v as int?), + score: $checkedConvert('_score', (v) => (v as num).toDouble()), + ); + return val; + }, + fieldKeyMap: const { + 'highlightResult': '_highlightResult', + 'snippetResult': '_snippetResult', + 'rankingInfo': '_rankingInfo', + 'distinctSeqID': '_distinctSeqID', + 'score': '_score' + }, + ); + +const _$RecommendHitFieldMap = { + 'objectID': 'objectID', + 'highlightResult': '_highlightResult', + 'snippetResult': '_snippetResult', + 'rankingInfo': '_rankingInfo', + 'distinctSeqID': '_distinctSeqID', + 'score': '_score', +}; + +Map _$RecommendHitToJson(RecommendHit instance) { + final val = { + 'objectID': instance.objectID, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('_highlightResult', instance.highlightResult); + writeNotNull('_snippetResult', instance.snippetResult); + writeNotNull('_rankingInfo', instance.rankingInfo?.toJson()); + writeNotNull('_distinctSeqID', instance.distinctSeqID); + val['_score'] = instance.score; + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_hits.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_hits.dart new file mode 100644 index 0000000000..8e9b92203f --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_hits.dart @@ -0,0 +1,35 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/recommend_hit.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'recommend_hits.g.dart'; + +@JsonSerializable() +final class RecommendHits { + /// Returns a new [RecommendHits] instance. + const RecommendHits({ + required this.hits, + }); + + @JsonKey(name: r'hits') + final List hits; + + @override + bool operator ==(Object other) => + identical(this, other) || other is RecommendHits && other.hits == hits; + + @override + int get hashCode => hits.hashCode; + + factory RecommendHits.fromJson(Map json) => + _$RecommendHitsFromJson(json); + + Map toJson() => _$RecommendHitsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_hits.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_hits.g.dart new file mode 100644 index 0000000000..10eb9fbc45 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_hits.g.dart @@ -0,0 +1,28 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'recommend_hits.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +RecommendHits _$RecommendHitsFromJson(Map json) => + $checkedCreate( + 'RecommendHits', + json, + ($checkedConvert) { + final val = RecommendHits( + hits: $checkedConvert( + 'hits', + (v) => (v as List) + .map((e) => RecommendHit.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$RecommendHitsToJson(RecommendHits instance) => + { + 'hits': instance.hits.map((e) => e.toJson()).toList(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_models.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_models.dart new file mode 100644 index 0000000000..6b8706a22b --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommend_models.dart @@ -0,0 +1,26 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum RecommendModels { + relatedProducts(r'related-products'), + boughtTogether(r'bought-together'), + trendingFacets(r'trending-facets'), + trendingItems(r'trending-items'); + + const RecommendModels(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static RecommendModels fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommendation_models.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommendation_models.dart new file mode 100644 index 0000000000..aeaab986c8 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommendation_models.dart @@ -0,0 +1,28 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Recommendation model. +@JsonEnum(valueField: 'raw') +enum RecommendationModels { + /// Recommendation model. + relatedProducts(r'related-products'), + + /// Recommendation model. + boughtTogether(r'bought-together'); + + const RecommendationModels(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static RecommendationModels fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommendation_request.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommendation_request.dart new file mode 100644 index 0000000000..832a3c3759 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommendation_request.dart @@ -0,0 +1,81 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/recommendation_models.dart'; +import 'package:algolia_client_recommend/src/model/search_params_object.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'recommendation_request.g.dart'; + +@JsonSerializable() +final class RecommendationRequest { + /// Returns a new [RecommendationRequest] instance. + const RecommendationRequest({ + required this.model, + required this.objectID, + required this.indexName, + required this.threshold, + this.maxRecommendations, + this.queryParameters, + this.fallbackParameters, + }); + + @JsonKey(name: r'model') + final RecommendationModels model; + + /// Unique object identifier. + @JsonKey(name: r'objectID') + final String objectID; + + /// Algolia index name. + @JsonKey(name: r'indexName') + final String indexName; + + /// Recommendations with a confidence score lower than `threshold` won't appear in results. > **Note**: Each recommendation has a confidence score of 0 to 100. The closer the score is to 100, the more relevant the recommendations are. + // minimum: 0 + // maximum: 100 + @JsonKey(name: r'threshold') + final int threshold; + + /// Maximum number of recommendations to retrieve. If 0, all recommendations will be returned. + @JsonKey(name: r'maxRecommendations') + final int? maxRecommendations; + + @JsonKey(name: r'queryParameters') + final SearchParamsObject? queryParameters; + + @JsonKey(name: r'fallbackParameters') + final SearchParamsObject? fallbackParameters; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is RecommendationRequest && + other.model == model && + other.objectID == objectID && + other.indexName == indexName && + other.threshold == threshold && + other.maxRecommendations == maxRecommendations && + other.queryParameters == queryParameters && + other.fallbackParameters == fallbackParameters; + + @override + int get hashCode => + model.hashCode + + objectID.hashCode + + indexName.hashCode + + threshold.hashCode + + maxRecommendations.hashCode + + queryParameters.hashCode + + fallbackParameters.hashCode; + + factory RecommendationRequest.fromJson(Map json) => + _$RecommendationRequestFromJson(json); + + Map toJson() => _$RecommendationRequestToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommendation_request.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommendation_request.g.dart new file mode 100644 index 0000000000..e6b132f260 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommendation_request.g.dart @@ -0,0 +1,62 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'recommendation_request.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +RecommendationRequest _$RecommendationRequestFromJson( + Map json) => + $checkedCreate( + 'RecommendationRequest', + json, + ($checkedConvert) { + final val = RecommendationRequest( + model: $checkedConvert( + 'model', (v) => $enumDecode(_$RecommendationModelsEnumMap, v)), + objectID: $checkedConvert('objectID', (v) => v as String), + indexName: $checkedConvert('indexName', (v) => v as String), + threshold: $checkedConvert('threshold', (v) => v as int), + maxRecommendations: + $checkedConvert('maxRecommendations', (v) => v as int?), + queryParameters: $checkedConvert( + 'queryParameters', + (v) => v == null + ? null + : SearchParamsObject.fromJson(v as Map)), + fallbackParameters: $checkedConvert( + 'fallbackParameters', + (v) => v == null + ? null + : SearchParamsObject.fromJson(v as Map)), + ); + return val; + }, + ); + +Map _$RecommendationRequestToJson( + RecommendationRequest instance) { + final val = { + 'model': instance.model.toJson(), + 'objectID': instance.objectID, + 'indexName': instance.indexName, + 'threshold': instance.threshold, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('maxRecommendations', instance.maxRecommendations); + writeNotNull('queryParameters', instance.queryParameters?.toJson()); + writeNotNull('fallbackParameters', instance.fallbackParameters?.toJson()); + return val; +} + +const _$RecommendationModelsEnumMap = { + RecommendationModels.relatedProducts: 'related-products', + RecommendationModels.boughtTogether: 'bought-together', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommendations_response.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommendations_response.dart new file mode 100644 index 0000000000..48c516701d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommendations_response.dart @@ -0,0 +1,224 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/base_search_response_redirect.dart'; +import 'package:algolia_client_recommend/src/model/facets_stats.dart'; +import 'package:algolia_client_recommend/src/model/recommend_hit.dart'; +import 'package:algolia_client_recommend/src/model/rendering_content.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'recommendations_response.g.dart'; + +@JsonSerializable() +final class RecommendationsResponse { + /// Returns a new [RecommendationsResponse] instance. + const RecommendationsResponse({ + this.abTestID, + this.abTestVariantID, + this.aroundLatLng, + this.automaticRadius, + this.exhaustiveFacetsCount, + required this.exhaustiveNbHits, + this.exhaustiveTypo, + this.facets, + this.facetsStats, + required this.hitsPerPage, + this.index, + this.indexUsed, + this.message, + required this.nbHits, + required this.nbPages, + this.nbSortedHits, + required this.page, + required this.params, + this.redirect, + this.parsedQuery, + required this.processingTimeMS, + required this.query, + this.queryAfterRemoval, + this.serverUsed, + this.userData, + this.renderingContent, + required this.hits, + }); + + /// A/B test ID. This is only included in the response for indices that are part of an A/B test. + @JsonKey(name: r'abTestID') + final int? abTestID; + + /// Variant ID. This is only included in the response for indices that are part of an A/B test. + // minimum: 1 + @JsonKey(name: r'abTestVariantID') + final int? abTestVariantID; + + /// Computed geographical location. + @JsonKey(name: r'aroundLatLng') + final String? aroundLatLng; + + /// Automatically-computed radius. + @JsonKey(name: r'automaticRadius') + final String? automaticRadius; + + /// Indicates whether the facet count is exhaustive (exact) or approximate. + @JsonKey(name: r'exhaustiveFacetsCount') + final bool? exhaustiveFacetsCount; + + /// Indicates whether the number of hits `nbHits` is exhaustive (exact) or approximate. + @JsonKey(name: r'exhaustiveNbHits') + final bool exhaustiveNbHits; + + /// Indicates whether the search for typos was exhaustive (exact) or approximate. + @JsonKey(name: r'exhaustiveTypo') + final bool? exhaustiveTypo; + + /// Mapping of each facet name to the corresponding facet counts. + @JsonKey(name: r'facets') + final Map>? facets; + + /// Statistics for numerical facets. + @JsonKey(name: r'facets_stats') + final Map? facetsStats; + + /// Number of hits per page. + // minimum: 1 + // maximum: 1000 + @JsonKey(name: r'hitsPerPage') + final int hitsPerPage; + + /// Index name used for the query. + @JsonKey(name: r'index') + final String? index; + + /// Index name used for the query. During A/B testing, the targeted index isn't always the index used by the query. + @JsonKey(name: r'indexUsed') + final String? indexUsed; + + /// Warnings about the query. + @JsonKey(name: r'message') + final String? message; + + /// Number of hits the search query matched. + @JsonKey(name: r'nbHits') + final int nbHits; + + /// Number of pages of results for the current query. + @JsonKey(name: r'nbPages') + final int nbPages; + + /// Number of hits selected and sorted by the relevant sort algorithm. + @JsonKey(name: r'nbSortedHits') + final int? nbSortedHits; + + /// Page to retrieve (the first page is `0`, not `1`). + @JsonKey(name: r'page') + final int page; + + /// URL-encoded string of all search parameters. + @JsonKey(name: r'params') + final String params; + + @JsonKey(name: r'redirect') + final BaseSearchResponseRedirect? redirect; + + /// Post-[normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/#what-does-normalization-mean) query string that will be searched. + @JsonKey(name: r'parsedQuery') + final String? parsedQuery; + + /// Time the server took to process the request, in milliseconds. + @JsonKey(name: r'processingTimeMS') + final int processingTimeMS; + + /// Text to search for in an index. + @JsonKey(name: r'query') + final String query; + + /// Markup text indicating which parts of the original query have been removed to retrieve a non-empty result set. + @JsonKey(name: r'queryAfterRemoval') + final String? queryAfterRemoval; + + /// Host name of the server that processed the request. + @JsonKey(name: r'serverUsed') + final String? serverUsed; + + /// Lets you store custom data in your indices. + @JsonKey(name: r'userData') + final Object? userData; + + @JsonKey(name: r'renderingContent') + final RenderingContent? renderingContent; + + @JsonKey(name: r'hits') + final List hits; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is RecommendationsResponse && + other.abTestID == abTestID && + other.abTestVariantID == abTestVariantID && + other.aroundLatLng == aroundLatLng && + other.automaticRadius == automaticRadius && + other.exhaustiveFacetsCount == exhaustiveFacetsCount && + other.exhaustiveNbHits == exhaustiveNbHits && + other.exhaustiveTypo == exhaustiveTypo && + other.facets == facets && + other.facetsStats == facetsStats && + other.hitsPerPage == hitsPerPage && + other.index == index && + other.indexUsed == indexUsed && + other.message == message && + other.nbHits == nbHits && + other.nbPages == nbPages && + other.nbSortedHits == nbSortedHits && + other.page == page && + other.params == params && + other.redirect == redirect && + other.parsedQuery == parsedQuery && + other.processingTimeMS == processingTimeMS && + other.query == query && + other.queryAfterRemoval == queryAfterRemoval && + other.serverUsed == serverUsed && + other.userData == userData && + other.renderingContent == renderingContent && + other.hits == hits; + + @override + int get hashCode => + abTestID.hashCode + + abTestVariantID.hashCode + + aroundLatLng.hashCode + + automaticRadius.hashCode + + exhaustiveFacetsCount.hashCode + + exhaustiveNbHits.hashCode + + exhaustiveTypo.hashCode + + facets.hashCode + + facetsStats.hashCode + + hitsPerPage.hashCode + + index.hashCode + + indexUsed.hashCode + + message.hashCode + + nbHits.hashCode + + nbPages.hashCode + + nbSortedHits.hashCode + + page.hashCode + + params.hashCode + + redirect.hashCode + + parsedQuery.hashCode + + processingTimeMS.hashCode + + query.hashCode + + queryAfterRemoval.hashCode + + serverUsed.hashCode + + userData.hashCode + + renderingContent.hashCode + + hits.hashCode; + + factory RecommendationsResponse.fromJson(Map json) => + _$RecommendationsResponseFromJson(json); + + Map toJson() => _$RecommendationsResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommendations_response.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommendations_response.g.dart new file mode 100644 index 0000000000..f7ad5fa84c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommendations_response.g.dart @@ -0,0 +1,115 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'recommendations_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +RecommendationsResponse _$RecommendationsResponseFromJson( + Map json) => + $checkedCreate( + 'RecommendationsResponse', + json, + ($checkedConvert) { + final val = RecommendationsResponse( + abTestID: $checkedConvert('abTestID', (v) => v as int?), + abTestVariantID: $checkedConvert('abTestVariantID', (v) => v as int?), + aroundLatLng: $checkedConvert('aroundLatLng', (v) => v as String?), + automaticRadius: + $checkedConvert('automaticRadius', (v) => v as String?), + exhaustiveFacetsCount: + $checkedConvert('exhaustiveFacetsCount', (v) => v as bool?), + exhaustiveNbHits: + $checkedConvert('exhaustiveNbHits', (v) => v as bool), + exhaustiveTypo: $checkedConvert('exhaustiveTypo', (v) => v as bool?), + facets: $checkedConvert( + 'facets', + (v) => (v as Map?)?.map( + (k, e) => MapEntry(k, Map.from(e as Map)), + )), + facetsStats: $checkedConvert( + 'facets_stats', + (v) => (v as Map?)?.map( + (k, e) => MapEntry( + k, FacetsStats.fromJson(e as Map)), + )), + hitsPerPage: $checkedConvert('hitsPerPage', (v) => v as int), + index: $checkedConvert('index', (v) => v as String?), + indexUsed: $checkedConvert('indexUsed', (v) => v as String?), + message: $checkedConvert('message', (v) => v as String?), + nbHits: $checkedConvert('nbHits', (v) => v as int), + nbPages: $checkedConvert('nbPages', (v) => v as int), + nbSortedHits: $checkedConvert('nbSortedHits', (v) => v as int?), + page: $checkedConvert('page', (v) => v as int), + params: $checkedConvert('params', (v) => v as String), + redirect: $checkedConvert( + 'redirect', + (v) => v == null + ? null + : BaseSearchResponseRedirect.fromJson( + v as Map)), + parsedQuery: $checkedConvert('parsedQuery', (v) => v as String?), + processingTimeMS: + $checkedConvert('processingTimeMS', (v) => v as int), + query: $checkedConvert('query', (v) => v as String), + queryAfterRemoval: + $checkedConvert('queryAfterRemoval', (v) => v as String?), + serverUsed: $checkedConvert('serverUsed', (v) => v as String?), + userData: $checkedConvert('userData', (v) => v), + renderingContent: $checkedConvert( + 'renderingContent', + (v) => v == null + ? null + : RenderingContent.fromJson(v as Map)), + hits: $checkedConvert( + 'hits', + (v) => (v as List) + .map((e) => RecommendHit.fromJson(e as Map)) + .toList()), + ); + return val; + }, + fieldKeyMap: const {'facetsStats': 'facets_stats'}, + ); + +Map _$RecommendationsResponseToJson( + RecommendationsResponse instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('abTestID', instance.abTestID); + writeNotNull('abTestVariantID', instance.abTestVariantID); + writeNotNull('aroundLatLng', instance.aroundLatLng); + writeNotNull('automaticRadius', instance.automaticRadius); + writeNotNull('exhaustiveFacetsCount', instance.exhaustiveFacetsCount); + val['exhaustiveNbHits'] = instance.exhaustiveNbHits; + writeNotNull('exhaustiveTypo', instance.exhaustiveTypo); + writeNotNull('facets', instance.facets); + writeNotNull('facets_stats', + instance.facetsStats?.map((k, e) => MapEntry(k, e.toJson()))); + val['hitsPerPage'] = instance.hitsPerPage; + writeNotNull('index', instance.index); + writeNotNull('indexUsed', instance.indexUsed); + writeNotNull('message', instance.message); + val['nbHits'] = instance.nbHits; + val['nbPages'] = instance.nbPages; + writeNotNull('nbSortedHits', instance.nbSortedHits); + val['page'] = instance.page; + val['params'] = instance.params; + writeNotNull('redirect', instance.redirect?.toJson()); + writeNotNull('parsedQuery', instance.parsedQuery); + val['processingTimeMS'] = instance.processingTimeMS; + val['query'] = instance.query; + writeNotNull('queryAfterRemoval', instance.queryAfterRemoval); + writeNotNull('serverUsed', instance.serverUsed); + writeNotNull('userData', instance.userData); + writeNotNull('renderingContent', instance.renderingContent?.toJson()); + val['hits'] = instance.hits.map((e) => e.toJson()).toList(); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/redirect_rule_index_metadata.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/redirect_rule_index_metadata.dart new file mode 100644 index 0000000000..9ac021c011 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/redirect_rule_index_metadata.dart @@ -0,0 +1,66 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/redirect_rule_index_metadata_data.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'redirect_rule_index_metadata.g.dart'; + +@JsonSerializable() +final class RedirectRuleIndexMetadata { + /// Returns a new [RedirectRuleIndexMetadata] instance. + const RedirectRuleIndexMetadata({ + required this.source, + required this.dest, + required this.reason, + required this.succeed, + required this.data, + }); + + /// Source index for the redirect rule. + @JsonKey(name: r'source') + final String source; + + /// Destination index for the redirect rule. + @JsonKey(name: r'dest') + final String dest; + + /// Reason for the redirect rule. + @JsonKey(name: r'reason') + final String reason; + + /// Redirect rule status. + @JsonKey(name: r'succeed') + final bool succeed; + + @JsonKey(name: r'data') + final RedirectRuleIndexMetadataData data; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is RedirectRuleIndexMetadata && + other.source == source && + other.dest == dest && + other.reason == reason && + other.succeed == succeed && + other.data == data; + + @override + int get hashCode => + source.hashCode + + dest.hashCode + + reason.hashCode + + succeed.hashCode + + data.hashCode; + + factory RedirectRuleIndexMetadata.fromJson(Map json) => + _$RedirectRuleIndexMetadataFromJson(json); + + Map toJson() => _$RedirectRuleIndexMetadataToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/redirect_rule_index_metadata.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/redirect_rule_index_metadata.g.dart new file mode 100644 index 0000000000..d2e1897f87 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/redirect_rule_index_metadata.g.dart @@ -0,0 +1,37 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'redirect_rule_index_metadata.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +RedirectRuleIndexMetadata _$RedirectRuleIndexMetadataFromJson( + Map json) => + $checkedCreate( + 'RedirectRuleIndexMetadata', + json, + ($checkedConvert) { + final val = RedirectRuleIndexMetadata( + source: $checkedConvert('source', (v) => v as String), + dest: $checkedConvert('dest', (v) => v as String), + reason: $checkedConvert('reason', (v) => v as String), + succeed: $checkedConvert('succeed', (v) => v as bool), + data: $checkedConvert( + 'data', + (v) => RedirectRuleIndexMetadataData.fromJson( + v as Map)), + ); + return val; + }, + ); + +Map _$RedirectRuleIndexMetadataToJson( + RedirectRuleIndexMetadata instance) => + { + 'source': instance.source, + 'dest': instance.dest, + 'reason': instance.reason, + 'succeed': instance.succeed, + 'data': instance.data.toJson(), + }; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/redirect_rule_index_metadata_data.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/redirect_rule_index_metadata_data.dart new file mode 100644 index 0000000000..f9bba71211 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/redirect_rule_index_metadata_data.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'redirect_rule_index_metadata_data.g.dart'; + +@JsonSerializable() +final class RedirectRuleIndexMetadataData { + /// Returns a new [RedirectRuleIndexMetadataData] instance. + const RedirectRuleIndexMetadataData({ + required this.ruleObjectID, + }); + + @JsonKey(name: r'ruleObjectID') + final String ruleObjectID; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is RedirectRuleIndexMetadataData && + other.ruleObjectID == ruleObjectID; + + @override + int get hashCode => ruleObjectID.hashCode; + + factory RedirectRuleIndexMetadataData.fromJson(Map json) => + _$RedirectRuleIndexMetadataDataFromJson(json); + + Map toJson() => _$RedirectRuleIndexMetadataDataToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/redirect_rule_index_metadata_data.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/redirect_rule_index_metadata_data.g.dart new file mode 100644 index 0000000000..c994c4ce10 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/redirect_rule_index_metadata_data.g.dart @@ -0,0 +1,26 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'redirect_rule_index_metadata_data.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +RedirectRuleIndexMetadataData _$RedirectRuleIndexMetadataDataFromJson( + Map json) => + $checkedCreate( + 'RedirectRuleIndexMetadataData', + json, + ($checkedConvert) { + final val = RedirectRuleIndexMetadataData( + ruleObjectID: $checkedConvert('ruleObjectID', (v) => v as String), + ); + return val; + }, + ); + +Map _$RedirectRuleIndexMetadataDataToJson( + RedirectRuleIndexMetadataData instance) => + { + 'ruleObjectID': instance.ruleObjectID, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/remove_words_if_no_results.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/remove_words_if_no_results.dart new file mode 100644 index 0000000000..051a2fca14 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/remove_words_if_no_results.dart @@ -0,0 +1,34 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Strategy to [remove words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/in-depth/why-use-remove-words-if-no-results/) from the query when it doesn't match any hits. +@JsonEnum(valueField: 'raw') +enum RemoveWordsIfNoResults { + /// Strategy to [remove words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/in-depth/why-use-remove-words-if-no-results/) from the query when it doesn't match any hits. + none(r'none'), + + /// Strategy to [remove words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/in-depth/why-use-remove-words-if-no-results/) from the query when it doesn't match any hits. + lastWords(r'lastWords'), + + /// Strategy to [remove words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/in-depth/why-use-remove-words-if-no-results/) from the query when it doesn't match any hits. + firstWords(r'firstWords'), + + /// Strategy to [remove words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/in-depth/why-use-remove-words-if-no-results/) from the query when it doesn't match any hits. + allOptional(r'allOptional'); + + const RemoveWordsIfNoResults(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static RemoveWordsIfNoResults fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rendering_content.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rendering_content.dart new file mode 100644 index 0000000000..5eede6d99d --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rendering_content.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/facet_ordering.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'rendering_content.g.dart'; + +@JsonSerializable() +final class RenderingContent { + /// Returns a new [RenderingContent] instance. + const RenderingContent({ + this.facetOrdering, + }); + + @JsonKey(name: r'facetOrdering') + final FacetOrdering? facetOrdering; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is RenderingContent && other.facetOrdering == facetOrdering; + + @override + int get hashCode => facetOrdering.hashCode; + + factory RenderingContent.fromJson(Map json) => + _$RenderingContentFromJson(json); + + Map toJson() => _$RenderingContentToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rendering_content.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rendering_content.g.dart new file mode 100644 index 0000000000..ec9e5919cd --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rendering_content.g.dart @@ -0,0 +1,36 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'rendering_content.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +RenderingContent _$RenderingContentFromJson(Map json) => + $checkedCreate( + 'RenderingContent', + json, + ($checkedConvert) { + final val = RenderingContent( + facetOrdering: $checkedConvert( + 'facetOrdering', + (v) => v == null + ? null + : FacetOrdering.fromJson(v as Map)), + ); + return val; + }, + ); + +Map _$RenderingContentToJson(RenderingContent instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('facetOrdering', instance.facetOrdering?.toJson()); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rule_response.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rule_response.dart new file mode 100644 index 0000000000..46cc5af94c --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rule_response.dart @@ -0,0 +1,74 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/condition.dart'; +import 'package:algolia_client_recommend/src/model/rule_response_metadata.dart'; +import 'package:algolia_client_recommend/src/model/consequence.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'rule_response.g.dart'; + +@JsonSerializable() +final class RuleResponse { + /// Returns a new [RuleResponse] instance. + const RuleResponse({ + this.metadata, + required this.objectID, + this.conditions, + this.consequence, + this.description, + this.enabled, + }); + + @JsonKey(name: r'_metadata') + final RuleResponseMetadata? metadata; + + /// Unique identifier for a rule object. + @JsonKey(name: r'objectID') + final String objectID; + + /// [Conditions](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/#conditions) required to activate a rule. You can use up to 25 conditions per rule. + @JsonKey(name: r'conditions') + final List? conditions; + + @JsonKey(name: r'consequence') + final Consequence? consequence; + + /// Description of the rule's purpose. This can be helpful for display in the Algolia dashboard. + @JsonKey(name: r'description') + final String? description; + + /// Indicates whether to enable the rule. If it isn't enabled, it isn't applied at query time. + @JsonKey(name: r'enabled') + final bool? enabled; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is RuleResponse && + other.metadata == metadata && + other.objectID == objectID && + other.conditions == conditions && + other.consequence == consequence && + other.description == description && + other.enabled == enabled; + + @override + int get hashCode => + metadata.hashCode + + objectID.hashCode + + conditions.hashCode + + consequence.hashCode + + description.hashCode + + enabled.hashCode; + + factory RuleResponse.fromJson(Map json) => + _$RuleResponseFromJson(json); + + Map toJson() => _$RuleResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rule_response.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rule_response.g.dart new file mode 100644 index 0000000000..0d134b77af --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rule_response.g.dart @@ -0,0 +1,56 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'rule_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +RuleResponse _$RuleResponseFromJson(Map json) => + $checkedCreate( + 'RuleResponse', + json, + ($checkedConvert) { + final val = RuleResponse( + metadata: $checkedConvert( + '_metadata', + (v) => v == null + ? null + : RuleResponseMetadata.fromJson(v as Map)), + objectID: $checkedConvert('objectID', (v) => v as String), + conditions: $checkedConvert( + 'conditions', + (v) => (v as List?) + ?.map((e) => Condition.fromJson(e as Map)) + .toList()), + consequence: $checkedConvert( + 'consequence', + (v) => v == null + ? null + : Consequence.fromJson(v as Map)), + description: $checkedConvert('description', (v) => v as String?), + enabled: $checkedConvert('enabled', (v) => v as bool?), + ); + return val; + }, + fieldKeyMap: const {'metadata': '_metadata'}, + ); + +Map _$RuleResponseToJson(RuleResponse instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('_metadata', instance.metadata?.toJson()); + val['objectID'] = instance.objectID; + writeNotNull( + 'conditions', instance.conditions?.map((e) => e.toJson()).toList()); + writeNotNull('consequence', instance.consequence?.toJson()); + writeNotNull('description', instance.description); + writeNotNull('enabled', instance.enabled); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rule_response_metadata.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rule_response_metadata.dart new file mode 100644 index 0000000000..c27bfcfb8a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rule_response_metadata.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'rule_response_metadata.g.dart'; + +@JsonSerializable() +final class RuleResponseMetadata { + /// Returns a new [RuleResponseMetadata] instance. + const RuleResponseMetadata({ + this.lastUpdate, + }); + + /// Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. + @JsonKey(name: r'lastUpdate') + final String? lastUpdate; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is RuleResponseMetadata && other.lastUpdate == lastUpdate; + + @override + int get hashCode => lastUpdate.hashCode; + + factory RuleResponseMetadata.fromJson(Map json) => + _$RuleResponseMetadataFromJson(json); + + Map toJson() => _$RuleResponseMetadataToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rule_response_metadata.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rule_response_metadata.g.dart new file mode 100644 index 0000000000..f1ba476488 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/rule_response_metadata.g.dart @@ -0,0 +1,34 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'rule_response_metadata.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +RuleResponseMetadata _$RuleResponseMetadataFromJson( + Map json) => + $checkedCreate( + 'RuleResponseMetadata', + json, + ($checkedConvert) { + final val = RuleResponseMetadata( + lastUpdate: $checkedConvert('lastUpdate', (v) => v as String?), + ); + return val; + }, + ); + +Map _$RuleResponseMetadataToJson( + RuleResponseMetadata instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('lastUpdate', instance.lastUpdate); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_params_object.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_params_object.dart new file mode 100644 index 0000000000..f62d667072 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_params_object.dart @@ -0,0 +1,622 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/query_type.dart'; +import 'package:algolia_client_recommend/src/model/alternatives_as_exact.dart'; +import 'package:algolia_client_recommend/src/model/index_settings_as_search_params_semantic_search.dart'; +import 'package:algolia_client_recommend/src/model/advanced_syntax_features.dart'; +import 'package:algolia_client_recommend/src/model/remove_words_if_no_results.dart'; +import 'package:algolia_client_recommend/src/model/exact_on_single_word_query.dart'; +import 'package:algolia_client_recommend/src/model/mode.dart'; +import 'package:algolia_client_recommend/src/model/rendering_content.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'search_params_object.g.dart'; + +@JsonSerializable() +final class SearchParamsObject { + /// Returns a new [SearchParamsObject] instance. + const SearchParamsObject({ + this.query, + this.similarQuery, + this.filters, + this.facetFilters, + this.optionalFilters, + this.numericFilters, + this.tagFilters, + this.sumOrFiltersScores, + this.facets, + this.maxValuesPerFacet, + this.facetingAfterDistinct, + this.sortFacetValuesBy, + this.page, + this.offset, + this.length, + this.aroundLatLng, + this.aroundLatLngViaIP, + this.aroundRadius, + this.aroundPrecision, + this.minimumAroundRadius, + this.insideBoundingBox, + this.insidePolygon, + this.naturalLanguages, + this.ruleContexts, + this.personalizationImpact, + this.userToken, + this.getRankingInfo, + this.clickAnalytics, + this.analytics, + this.analyticsTags, + this.percentileComputation, + this.enableABTest, + this.enableReRanking, + this.reRankingApplyFilter, + this.attributesForFaceting, + this.attributesToRetrieve, + this.restrictSearchableAttributes, + this.ranking, + this.customRanking, + this.relevancyStrictness, + this.attributesToHighlight, + this.attributesToSnippet, + this.highlightPreTag, + this.highlightPostTag, + this.snippetEllipsisText, + this.restrictHighlightAndSnippetArrays, + this.hitsPerPage, + this.minWordSizefor1Typo, + this.minWordSizefor2Typos, + this.typoTolerance, + this.allowTyposOnNumericTokens, + this.disableTypoToleranceOnAttributes, + this.ignorePlurals, + this.removeStopWords, + this.keepDiacriticsOnCharacters, + this.queryLanguages, + this.decompoundQuery, + this.enableRules, + this.enablePersonalization, + this.queryType, + this.removeWordsIfNoResults, + this.mode, + this.semanticSearch, + this.advancedSyntax, + this.optionalWords, + this.disableExactOnAttributes, + this.exactOnSingleWordQuery, + this.alternativesAsExact, + this.advancedSyntaxFeatures, + this.explain, + this.distinct, + this.attributeForDistinct, + this.synonyms, + this.replaceSynonymsInHighlight, + this.minProximity, + this.responseFields, + this.maxFacetHits, + this.attributeCriteriaComputedByMinProximity, + this.renderingContent, + }); + + /// Text to search for in an index. + @JsonKey(name: r'query') + final String? query; + + /// Overrides the query parameter and performs a more generic search. + @JsonKey(name: r'similarQuery') + final String? similarQuery; + + /// [Filter](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/) the query with numeric, facet, or tag filters. + @JsonKey(name: r'filters') + final String? filters; + + /// One of types: + /// - [List>] + /// - [String] + /// - [List] + @JsonKey(name: r'facetFilters') + final dynamic facetFilters; + + /// One of types: + /// - [List>] + /// - [String] + /// - [List] + @JsonKey(name: r'optionalFilters') + final dynamic optionalFilters; + + /// One of types: + /// - [List>] + /// - [String] + /// - [List] + @JsonKey(name: r'numericFilters') + final dynamic numericFilters; + + /// One of types: + /// - [List>] + /// - [String] + /// - [List] + @JsonKey(name: r'tagFilters') + final dynamic tagFilters; + + /// Determines how to calculate [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores). If `false`, maximum score is kept. If `true`, score is summed. + @JsonKey(name: r'sumOrFiltersScores') + final bool? sumOrFiltersScores; + + /// Returns [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts), their facet values, and the number of matching facet values. + @JsonKey(name: r'facets') + final List? facets; + + /// Maximum number of facet values to return for each facet. + @JsonKey(name: r'maxValuesPerFacet') + final int? maxValuesPerFacet; + + /// Forces faceting to be applied after [de-duplication](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/) (with the distinct feature). Alternatively, the `afterDistinct` [modifier](https://www.algolia.com/doc/api-reference/api-parameters/attributesForFaceting/#modifiers) of `attributesForFaceting` allows for more granular control. + @JsonKey(name: r'facetingAfterDistinct') + final bool? facetingAfterDistinct; + + /// Controls how facet values are fetched. + @JsonKey(name: r'sortFacetValuesBy') + final String? sortFacetValuesBy; + + /// Page to retrieve (the first page is `0`, not `1`). + @JsonKey(name: r'page') + final int? page; + + /// Specifies the offset of the first hit to return. > **Note**: Using `page` and `hitsPerPage` is the recommended method for [paging results](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/). However, you can use `offset` and `length` to implement [an alternative approach to paging](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/#retrieving-a-subset-of-records-with-offset-and-length). + @JsonKey(name: r'offset') + final int? offset; + + /// Sets the number of hits to retrieve (for use with `offset`). > **Note**: Using `page` and `hitsPerPage` is the recommended method for [paging results](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/). However, you can use `offset` and `length` to implement [an alternative approach to paging](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/#retrieving-a-subset-of-records-with-offset-and-length). + // minimum: 1 + // maximum: 1000 + @JsonKey(name: r'length') + final int? length; + + /// Search for entries [around a central location](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filter-around-a-central-point), enabling a geographical search within a circular area. + @JsonKey(name: r'aroundLatLng') + final String? aroundLatLng; + + /// Search for entries around a location. The location is automatically computed from the requester's IP address. + @JsonKey(name: r'aroundLatLngViaIP') + final bool? aroundLatLngViaIP; + + /// One of types: + /// - [AroundRadiusAll] + /// - [int] + @JsonKey(name: r'aroundRadius') + final dynamic aroundRadius; + + /// Precision of a geographical search (in meters), to [group results that are more or less the same distance from a central point](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/in-depth/geo-ranking-precision/). + @JsonKey(name: r'aroundPrecision') + final int? aroundPrecision; + + /// Minimum radius (in meters) used for a geographical search when `aroundRadius` isn't set. + // minimum: 1 + @JsonKey(name: r'minimumAroundRadius') + final int? minimumAroundRadius; + + /// Search inside a [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas) (in geographical coordinates). + @JsonKey(name: r'insideBoundingBox') + final List? insideBoundingBox; + + /// Search inside a [polygon](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas) (in geographical coordinates). + @JsonKey(name: r'insidePolygon') + final List? insidePolygon; + + /// Changes the default values of parameters that work best for a natural language query, such as `ignorePlurals`, `removeStopWords`, `removeWordsIfNoResults`, `analyticsTags`, and `ruleContexts`. These parameters work well together when the query consists of fuller natural language strings instead of keywords, for example when processing voice search queries. + @JsonKey(name: r'naturalLanguages') + final List? naturalLanguages; + + /// Assigns [rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) to search queries. + @JsonKey(name: r'ruleContexts') + final List? ruleContexts; + + /// Defines how much [Personalization affects results](https://www.algolia.com/doc/guides/personalization/personalizing-results/in-depth/configuring-personalization/#understanding-personalization-impact). + @JsonKey(name: r'personalizationImpact') + final int? personalizationImpact; + + /// Associates a [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/) with the current search. + @JsonKey(name: r'userToken') + final String? userToken; + + /// Incidates whether the search response includes [detailed ranking information](https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/understanding-the-api-response/#ranking-information). + @JsonKey(name: r'getRankingInfo') + final bool? getRankingInfo; + + /// Indicates whether a query ID parameter is included in the search response. This is required for [tracking click and conversion events](https://www.algolia.com/doc/guides/sending-events/concepts/event-types/#events-related-to-algolia-requests). + @JsonKey(name: r'clickAnalytics') + final bool? clickAnalytics; + + /// Indicates whether this query will be included in [analytics](https://www.algolia.com/doc/guides/search-analytics/guides/exclude-queries/). + @JsonKey(name: r'analytics') + final bool? analytics; + + /// Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/). + @JsonKey(name: r'analyticsTags') + final List? analyticsTags; + + /// Whether to include or exclude a query from the processing-time percentile computation. + @JsonKey(name: r'percentileComputation') + final bool? percentileComputation; + + /// Incidates whether this search will be considered in A/B testing. + @JsonKey(name: r'enableABTest') + final bool? enableABTest; + + /// Indicates whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). + @JsonKey(name: r'enableReRanking') + final bool? enableReRanking; + + /// One of types: + /// - [List>] + /// - [String] + /// - [List] + @JsonKey(name: r'reRankingApplyFilter') + final dynamic reRankingApplyFilter; + + /// Attributes used for [faceting](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/) and the [modifiers](https://www.algolia.com/doc/api-reference/api-parameters/attributesForFaceting/#modifiers) that can be applied: `filterOnly`, `searchable`, and `afterDistinct`. + @JsonKey(name: r'attributesForFaceting') + final List? attributesForFaceting; + + /// Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. By default, the response includes all attributes. + @JsonKey(name: r'attributesToRetrieve') + final List? attributesToRetrieve; + + /// Restricts a query to only look at a subset of your [searchable attributes](https://www.algolia.com/doc/guides/managing-results/must-do/searchable-attributes/). + @JsonKey(name: r'restrictSearchableAttributes') + final List? restrictSearchableAttributes; + + /// Determines the order in which Algolia [returns your results](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/). + @JsonKey(name: r'ranking') + final List? ranking; + + /// Specifies the [Custom ranking criterion](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). Use the `asc` and `desc` modifiers to specify the ranking order: ascending or descending. + @JsonKey(name: r'customRanking') + final List? customRanking; + + /// Relevancy threshold below which less relevant results aren't included in the results. + @JsonKey(name: r'relevancyStrictness') + final int? relevancyStrictness; + + /// Attributes to highlight. Strings that match the search query in the attributes are highlighted by surrounding them with HTML tags (`highlightPreTag` and `highlightPostTag`). + @JsonKey(name: r'attributesToHighlight') + final List? attributesToHighlight; + + /// Attributes to _snippet_. 'Snippeting' is shortening the attribute to a certain number of words. If not specified, the attribute is shortened to the 10 words around the matching string but you can specify the number. For example: `body:20`. + @JsonKey(name: r'attributesToSnippet') + final List? attributesToSnippet; + + /// HTML string to insert before the highlighted parts in all highlight and snippet results. + @JsonKey(name: r'highlightPreTag') + final String? highlightPreTag; + + /// HTML string to insert after the highlighted parts in all highlight and snippet results. + @JsonKey(name: r'highlightPostTag') + final String? highlightPostTag; + + /// String used as an ellipsis indicator when a snippet is truncated. + @JsonKey(name: r'snippetEllipsisText') + final String? snippetEllipsisText; + + /// Restrict highlighting and snippeting to items that matched the query. + @JsonKey(name: r'restrictHighlightAndSnippetArrays') + final bool? restrictHighlightAndSnippetArrays; + + /// Number of hits per page. + // minimum: 1 + // maximum: 1000 + @JsonKey(name: r'hitsPerPage') + final int? hitsPerPage; + + /// Minimum number of characters a word in the query string must contain to accept matches with [one typo](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos). + @JsonKey(name: r'minWordSizefor1Typo') + final int? minWordSizefor1Typo; + + /// Minimum number of characters a word in the query string must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos). + @JsonKey(name: r'minWordSizefor2Typos') + final int? minWordSizefor2Typos; + + /// One of types: + /// - [TypoToleranceEnum] + /// - [bool] + @JsonKey(name: r'typoTolerance') + final dynamic typoTolerance; + + /// Whether to allow typos on numbers (\"numeric tokens\") in the query string. + @JsonKey(name: r'allowTyposOnNumericTokens') + final bool? allowTyposOnNumericTokens; + + /// Attributes for which you want to turn off [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/). + @JsonKey(name: r'disableTypoToleranceOnAttributes') + final List? disableTypoToleranceOnAttributes; + + /// One of types: + /// - [bool] + /// - [List] + @JsonKey(name: r'ignorePlurals') + final dynamic ignorePlurals; + + /// One of types: + /// - [bool] + /// - [List] + @JsonKey(name: r'removeStopWords') + final dynamic removeStopWords; + + /// Characters that the engine shouldn't automatically [normalize](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/). + @JsonKey(name: r'keepDiacriticsOnCharacters') + final String? keepDiacriticsOnCharacters; + + /// Sets your user's search language. This adjusts language-specific settings and features such as `ignorePlurals`, `removeStopWords`, and [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) word detection. + @JsonKey(name: r'queryLanguages') + final List? queryLanguages; + + /// [Splits compound words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/#splitting-compound-words) into their component word parts in the query. + @JsonKey(name: r'decompoundQuery') + final bool? decompoundQuery; + + /// Incidates whether [Rules](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/) are enabled. + @JsonKey(name: r'enableRules') + final bool? enableRules; + + /// Incidates whether [Personalization](https://www.algolia.com/doc/guides/personalization/what-is-personalization/) is enabled. + @JsonKey(name: r'enablePersonalization') + final bool? enablePersonalization; + + @JsonKey(name: r'queryType') + final QueryType? queryType; + + @JsonKey(name: r'removeWordsIfNoResults') + final RemoveWordsIfNoResults? removeWordsIfNoResults; + + @JsonKey(name: r'mode') + final Mode? mode; + + @JsonKey(name: r'semanticSearch') + final IndexSettingsAsSearchParamsSemanticSearch? semanticSearch; + + /// Enables the [advanced query syntax](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/#advanced-syntax). + @JsonKey(name: r'advancedSyntax') + final bool? advancedSyntax; + + /// Words which should be considered [optional](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words) when found in a query. + @JsonKey(name: r'optionalWords') + final List? optionalWords; + + /// Attributes for which you want to [turn off the exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). + @JsonKey(name: r'disableExactOnAttributes') + final List? disableExactOnAttributes; + + @JsonKey(name: r'exactOnSingleWordQuery') + final ExactOnSingleWordQuery? exactOnSingleWordQuery; + + /// Alternatives that should be considered an exact match by [the exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes). + @JsonKey(name: r'alternativesAsExact') + final List? alternativesAsExact; + + /// Allows you to specify which advanced syntax features are active when `advancedSyntax` is enabled. + @JsonKey(name: r'advancedSyntaxFeatures') + final List? advancedSyntaxFeatures; + + /// Enriches the API's response with information about how the query was processed. + @JsonKey(name: r'explain') + final List? explain; + + /// One of types: + /// - [bool] + /// - [int] + @JsonKey(name: r'distinct') + final dynamic distinct; + + /// Name of the deduplication attribute to be used with Algolia's [_distinct_ feature](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/#introducing-algolias-distinct-feature). + @JsonKey(name: r'attributeForDistinct') + final String? attributeForDistinct; + + /// Whether to take into account an index's synonyms for a particular search. + @JsonKey(name: r'synonyms') + final bool? synonyms; + + /// Whether to highlight and snippet the original word that matches the synonym or the synonym itself. + @JsonKey(name: r'replaceSynonymsInHighlight') + final bool? replaceSynonymsInHighlight; + + /// Precision of the [proximity ranking criterion](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#proximity). + // minimum: 1 + // maximum: 7 + @JsonKey(name: r'minProximity') + final int? minProximity; + + /// Attributes to include in the API response for search and browse queries. + @JsonKey(name: r'responseFields') + final List? responseFields; + + /// Maximum number of facet hits to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). + // maximum: 100 + @JsonKey(name: r'maxFacetHits') + final int? maxFacetHits; + + /// When the [Attribute criterion is ranked above Proximity](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#attribute-and-proximity-combinations) in your ranking formula, Proximity is used to select which searchable attribute is matched in the Attribute ranking stage. + @JsonKey(name: r'attributeCriteriaComputedByMinProximity') + final bool? attributeCriteriaComputedByMinProximity; + + @JsonKey(name: r'renderingContent') + final RenderingContent? renderingContent; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SearchParamsObject && + other.query == query && + other.similarQuery == similarQuery && + other.filters == filters && + other.facetFilters == facetFilters && + other.optionalFilters == optionalFilters && + other.numericFilters == numericFilters && + other.tagFilters == tagFilters && + other.sumOrFiltersScores == sumOrFiltersScores && + other.facets == facets && + other.maxValuesPerFacet == maxValuesPerFacet && + other.facetingAfterDistinct == facetingAfterDistinct && + other.sortFacetValuesBy == sortFacetValuesBy && + other.page == page && + other.offset == offset && + other.length == length && + other.aroundLatLng == aroundLatLng && + other.aroundLatLngViaIP == aroundLatLngViaIP && + other.aroundRadius == aroundRadius && + other.aroundPrecision == aroundPrecision && + other.minimumAroundRadius == minimumAroundRadius && + other.insideBoundingBox == insideBoundingBox && + other.insidePolygon == insidePolygon && + other.naturalLanguages == naturalLanguages && + other.ruleContexts == ruleContexts && + other.personalizationImpact == personalizationImpact && + other.userToken == userToken && + other.getRankingInfo == getRankingInfo && + other.clickAnalytics == clickAnalytics && + other.analytics == analytics && + other.analyticsTags == analyticsTags && + other.percentileComputation == percentileComputation && + other.enableABTest == enableABTest && + other.enableReRanking == enableReRanking && + other.reRankingApplyFilter == reRankingApplyFilter && + other.attributesForFaceting == attributesForFaceting && + other.attributesToRetrieve == attributesToRetrieve && + other.restrictSearchableAttributes == restrictSearchableAttributes && + other.ranking == ranking && + other.customRanking == customRanking && + other.relevancyStrictness == relevancyStrictness && + other.attributesToHighlight == attributesToHighlight && + other.attributesToSnippet == attributesToSnippet && + other.highlightPreTag == highlightPreTag && + other.highlightPostTag == highlightPostTag && + other.snippetEllipsisText == snippetEllipsisText && + other.restrictHighlightAndSnippetArrays == + restrictHighlightAndSnippetArrays && + other.hitsPerPage == hitsPerPage && + other.minWordSizefor1Typo == minWordSizefor1Typo && + other.minWordSizefor2Typos == minWordSizefor2Typos && + other.typoTolerance == typoTolerance && + other.allowTyposOnNumericTokens == allowTyposOnNumericTokens && + other.disableTypoToleranceOnAttributes == + disableTypoToleranceOnAttributes && + other.ignorePlurals == ignorePlurals && + other.removeStopWords == removeStopWords && + other.keepDiacriticsOnCharacters == keepDiacriticsOnCharacters && + other.queryLanguages == queryLanguages && + other.decompoundQuery == decompoundQuery && + other.enableRules == enableRules && + other.enablePersonalization == enablePersonalization && + other.queryType == queryType && + other.removeWordsIfNoResults == removeWordsIfNoResults && + other.mode == mode && + other.semanticSearch == semanticSearch && + other.advancedSyntax == advancedSyntax && + other.optionalWords == optionalWords && + other.disableExactOnAttributes == disableExactOnAttributes && + other.exactOnSingleWordQuery == exactOnSingleWordQuery && + other.alternativesAsExact == alternativesAsExact && + other.advancedSyntaxFeatures == advancedSyntaxFeatures && + other.explain == explain && + other.distinct == distinct && + other.attributeForDistinct == attributeForDistinct && + other.synonyms == synonyms && + other.replaceSynonymsInHighlight == replaceSynonymsInHighlight && + other.minProximity == minProximity && + other.responseFields == responseFields && + other.maxFacetHits == maxFacetHits && + other.attributeCriteriaComputedByMinProximity == + attributeCriteriaComputedByMinProximity && + other.renderingContent == renderingContent; + + @override + int get hashCode => + query.hashCode + + similarQuery.hashCode + + filters.hashCode + + facetFilters.hashCode + + optionalFilters.hashCode + + numericFilters.hashCode + + tagFilters.hashCode + + sumOrFiltersScores.hashCode + + facets.hashCode + + maxValuesPerFacet.hashCode + + facetingAfterDistinct.hashCode + + sortFacetValuesBy.hashCode + + page.hashCode + + offset.hashCode + + length.hashCode + + aroundLatLng.hashCode + + aroundLatLngViaIP.hashCode + + aroundRadius.hashCode + + aroundPrecision.hashCode + + minimumAroundRadius.hashCode + + insideBoundingBox.hashCode + + insidePolygon.hashCode + + naturalLanguages.hashCode + + ruleContexts.hashCode + + personalizationImpact.hashCode + + userToken.hashCode + + getRankingInfo.hashCode + + clickAnalytics.hashCode + + analytics.hashCode + + analyticsTags.hashCode + + percentileComputation.hashCode + + enableABTest.hashCode + + enableReRanking.hashCode + + (reRankingApplyFilter == null ? 0 : reRankingApplyFilter.hashCode) + + attributesForFaceting.hashCode + + attributesToRetrieve.hashCode + + restrictSearchableAttributes.hashCode + + ranking.hashCode + + customRanking.hashCode + + relevancyStrictness.hashCode + + attributesToHighlight.hashCode + + attributesToSnippet.hashCode + + highlightPreTag.hashCode + + highlightPostTag.hashCode + + snippetEllipsisText.hashCode + + restrictHighlightAndSnippetArrays.hashCode + + hitsPerPage.hashCode + + minWordSizefor1Typo.hashCode + + minWordSizefor2Typos.hashCode + + typoTolerance.hashCode + + allowTyposOnNumericTokens.hashCode + + disableTypoToleranceOnAttributes.hashCode + + ignorePlurals.hashCode + + removeStopWords.hashCode + + keepDiacriticsOnCharacters.hashCode + + queryLanguages.hashCode + + decompoundQuery.hashCode + + enableRules.hashCode + + enablePersonalization.hashCode + + queryType.hashCode + + removeWordsIfNoResults.hashCode + + mode.hashCode + + semanticSearch.hashCode + + advancedSyntax.hashCode + + optionalWords.hashCode + + disableExactOnAttributes.hashCode + + exactOnSingleWordQuery.hashCode + + alternativesAsExact.hashCode + + advancedSyntaxFeatures.hashCode + + explain.hashCode + + distinct.hashCode + + attributeForDistinct.hashCode + + synonyms.hashCode + + replaceSynonymsInHighlight.hashCode + + minProximity.hashCode + + responseFields.hashCode + + maxFacetHits.hashCode + + attributeCriteriaComputedByMinProximity.hashCode + + renderingContent.hashCode; + + factory SearchParamsObject.fromJson(Map json) => + _$SearchParamsObjectFromJson(json); + + Map toJson() => _$SearchParamsObjectToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_params_object.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_params_object.g.dart new file mode 100644 index 0000000000..3c19e675a3 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_params_object.g.dart @@ -0,0 +1,305 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'search_params_object.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SearchParamsObject _$SearchParamsObjectFromJson(Map json) => + $checkedCreate( + 'SearchParamsObject', + json, + ($checkedConvert) { + final val = SearchParamsObject( + query: $checkedConvert('query', (v) => v as String?), + similarQuery: $checkedConvert('similarQuery', (v) => v as String?), + filters: $checkedConvert('filters', (v) => v as String?), + facetFilters: $checkedConvert('facetFilters', (v) => v), + optionalFilters: $checkedConvert('optionalFilters', (v) => v), + numericFilters: $checkedConvert('numericFilters', (v) => v), + tagFilters: $checkedConvert('tagFilters', (v) => v), + sumOrFiltersScores: + $checkedConvert('sumOrFiltersScores', (v) => v as bool?), + facets: $checkedConvert('facets', + (v) => (v as List?)?.map((e) => e as String).toList()), + maxValuesPerFacet: + $checkedConvert('maxValuesPerFacet', (v) => v as int?), + facetingAfterDistinct: + $checkedConvert('facetingAfterDistinct', (v) => v as bool?), + sortFacetValuesBy: + $checkedConvert('sortFacetValuesBy', (v) => v as String?), + page: $checkedConvert('page', (v) => v as int?), + offset: $checkedConvert('offset', (v) => v as int?), + length: $checkedConvert('length', (v) => v as int?), + aroundLatLng: $checkedConvert('aroundLatLng', (v) => v as String?), + aroundLatLngViaIP: + $checkedConvert('aroundLatLngViaIP', (v) => v as bool?), + aroundRadius: $checkedConvert('aroundRadius', (v) => v), + aroundPrecision: $checkedConvert('aroundPrecision', (v) => v as int?), + minimumAroundRadius: + $checkedConvert('minimumAroundRadius', (v) => v as int?), + insideBoundingBox: $checkedConvert( + 'insideBoundingBox', + (v) => (v as List?) + ?.map((e) => (e as num).toDouble()) + .toList()), + insidePolygon: $checkedConvert( + 'insidePolygon', + (v) => (v as List?) + ?.map((e) => (e as num).toDouble()) + .toList()), + naturalLanguages: $checkedConvert('naturalLanguages', + (v) => (v as List?)?.map((e) => e as String).toList()), + ruleContexts: $checkedConvert('ruleContexts', + (v) => (v as List?)?.map((e) => e as String).toList()), + personalizationImpact: + $checkedConvert('personalizationImpact', (v) => v as int?), + userToken: $checkedConvert('userToken', (v) => v as String?), + getRankingInfo: $checkedConvert('getRankingInfo', (v) => v as bool?), + clickAnalytics: $checkedConvert('clickAnalytics', (v) => v as bool?), + analytics: $checkedConvert('analytics', (v) => v as bool?), + analyticsTags: $checkedConvert('analyticsTags', + (v) => (v as List?)?.map((e) => e as String).toList()), + percentileComputation: + $checkedConvert('percentileComputation', (v) => v as bool?), + enableABTest: $checkedConvert('enableABTest', (v) => v as bool?), + enableReRanking: + $checkedConvert('enableReRanking', (v) => v as bool?), + reRankingApplyFilter: + $checkedConvert('reRankingApplyFilter', (v) => v), + attributesForFaceting: $checkedConvert('attributesForFaceting', + (v) => (v as List?)?.map((e) => e as String).toList()), + attributesToRetrieve: $checkedConvert('attributesToRetrieve', + (v) => (v as List?)?.map((e) => e as String).toList()), + restrictSearchableAttributes: $checkedConvert( + 'restrictSearchableAttributes', + (v) => (v as List?)?.map((e) => e as String).toList()), + ranking: $checkedConvert('ranking', + (v) => (v as List?)?.map((e) => e as String).toList()), + customRanking: $checkedConvert('customRanking', + (v) => (v as List?)?.map((e) => e as String).toList()), + relevancyStrictness: + $checkedConvert('relevancyStrictness', (v) => v as int?), + attributesToHighlight: $checkedConvert('attributesToHighlight', + (v) => (v as List?)?.map((e) => e as String).toList()), + attributesToSnippet: $checkedConvert('attributesToSnippet', + (v) => (v as List?)?.map((e) => e as String).toList()), + highlightPreTag: + $checkedConvert('highlightPreTag', (v) => v as String?), + highlightPostTag: + $checkedConvert('highlightPostTag', (v) => v as String?), + snippetEllipsisText: + $checkedConvert('snippetEllipsisText', (v) => v as String?), + restrictHighlightAndSnippetArrays: $checkedConvert( + 'restrictHighlightAndSnippetArrays', (v) => v as bool?), + hitsPerPage: $checkedConvert('hitsPerPage', (v) => v as int?), + minWordSizefor1Typo: + $checkedConvert('minWordSizefor1Typo', (v) => v as int?), + minWordSizefor2Typos: + $checkedConvert('minWordSizefor2Typos', (v) => v as int?), + typoTolerance: $checkedConvert('typoTolerance', (v) => v), + allowTyposOnNumericTokens: + $checkedConvert('allowTyposOnNumericTokens', (v) => v as bool?), + disableTypoToleranceOnAttributes: $checkedConvert( + 'disableTypoToleranceOnAttributes', + (v) => (v as List?)?.map((e) => e as String).toList()), + ignorePlurals: $checkedConvert('ignorePlurals', (v) => v), + removeStopWords: $checkedConvert('removeStopWords', (v) => v), + keepDiacriticsOnCharacters: $checkedConvert( + 'keepDiacriticsOnCharacters', (v) => v as String?), + queryLanguages: $checkedConvert('queryLanguages', + (v) => (v as List?)?.map((e) => e as String).toList()), + decompoundQuery: + $checkedConvert('decompoundQuery', (v) => v as bool?), + enableRules: $checkedConvert('enableRules', (v) => v as bool?), + enablePersonalization: + $checkedConvert('enablePersonalization', (v) => v as bool?), + queryType: $checkedConvert( + 'queryType', (v) => $enumDecodeNullable(_$QueryTypeEnumMap, v)), + removeWordsIfNoResults: $checkedConvert('removeWordsIfNoResults', + (v) => $enumDecodeNullable(_$RemoveWordsIfNoResultsEnumMap, v)), + mode: $checkedConvert( + 'mode', (v) => $enumDecodeNullable(_$ModeEnumMap, v)), + semanticSearch: $checkedConvert( + 'semanticSearch', + (v) => v == null + ? null + : IndexSettingsAsSearchParamsSemanticSearch.fromJson( + v as Map)), + advancedSyntax: $checkedConvert('advancedSyntax', (v) => v as bool?), + optionalWords: $checkedConvert('optionalWords', + (v) => (v as List?)?.map((e) => e as String).toList()), + disableExactOnAttributes: $checkedConvert('disableExactOnAttributes', + (v) => (v as List?)?.map((e) => e as String).toList()), + exactOnSingleWordQuery: $checkedConvert('exactOnSingleWordQuery', + (v) => $enumDecodeNullable(_$ExactOnSingleWordQueryEnumMap, v)), + alternativesAsExact: $checkedConvert( + 'alternativesAsExact', + (v) => (v as List?) + ?.map((e) => $enumDecode(_$AlternativesAsExactEnumMap, e)) + .toList()), + advancedSyntaxFeatures: $checkedConvert( + 'advancedSyntaxFeatures', + (v) => (v as List?) + ?.map((e) => $enumDecode(_$AdvancedSyntaxFeaturesEnumMap, e)) + .toList()), + explain: $checkedConvert('explain', + (v) => (v as List?)?.map((e) => e as String).toList()), + distinct: $checkedConvert('distinct', (v) => v), + attributeForDistinct: + $checkedConvert('attributeForDistinct', (v) => v as String?), + synonyms: $checkedConvert('synonyms', (v) => v as bool?), + replaceSynonymsInHighlight: + $checkedConvert('replaceSynonymsInHighlight', (v) => v as bool?), + minProximity: $checkedConvert('minProximity', (v) => v as int?), + responseFields: $checkedConvert('responseFields', + (v) => (v as List?)?.map((e) => e as String).toList()), + maxFacetHits: $checkedConvert('maxFacetHits', (v) => v as int?), + attributeCriteriaComputedByMinProximity: $checkedConvert( + 'attributeCriteriaComputedByMinProximity', (v) => v as bool?), + renderingContent: $checkedConvert( + 'renderingContent', + (v) => v == null + ? null + : RenderingContent.fromJson(v as Map)), + ); + return val; + }, + ); + +Map _$SearchParamsObjectToJson(SearchParamsObject instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('query', instance.query); + writeNotNull('similarQuery', instance.similarQuery); + writeNotNull('filters', instance.filters); + writeNotNull('facetFilters', instance.facetFilters); + writeNotNull('optionalFilters', instance.optionalFilters); + writeNotNull('numericFilters', instance.numericFilters); + writeNotNull('tagFilters', instance.tagFilters); + writeNotNull('sumOrFiltersScores', instance.sumOrFiltersScores); + writeNotNull('facets', instance.facets); + writeNotNull('maxValuesPerFacet', instance.maxValuesPerFacet); + writeNotNull('facetingAfterDistinct', instance.facetingAfterDistinct); + writeNotNull('sortFacetValuesBy', instance.sortFacetValuesBy); + writeNotNull('page', instance.page); + writeNotNull('offset', instance.offset); + writeNotNull('length', instance.length); + writeNotNull('aroundLatLng', instance.aroundLatLng); + writeNotNull('aroundLatLngViaIP', instance.aroundLatLngViaIP); + writeNotNull('aroundRadius', instance.aroundRadius); + writeNotNull('aroundPrecision', instance.aroundPrecision); + writeNotNull('minimumAroundRadius', instance.minimumAroundRadius); + writeNotNull('insideBoundingBox', instance.insideBoundingBox); + writeNotNull('insidePolygon', instance.insidePolygon); + writeNotNull('naturalLanguages', instance.naturalLanguages); + writeNotNull('ruleContexts', instance.ruleContexts); + writeNotNull('personalizationImpact', instance.personalizationImpact); + writeNotNull('userToken', instance.userToken); + writeNotNull('getRankingInfo', instance.getRankingInfo); + writeNotNull('clickAnalytics', instance.clickAnalytics); + writeNotNull('analytics', instance.analytics); + writeNotNull('analyticsTags', instance.analyticsTags); + writeNotNull('percentileComputation', instance.percentileComputation); + writeNotNull('enableABTest', instance.enableABTest); + writeNotNull('enableReRanking', instance.enableReRanking); + writeNotNull('reRankingApplyFilter', instance.reRankingApplyFilter); + writeNotNull('attributesForFaceting', instance.attributesForFaceting); + writeNotNull('attributesToRetrieve', instance.attributesToRetrieve); + writeNotNull( + 'restrictSearchableAttributes', instance.restrictSearchableAttributes); + writeNotNull('ranking', instance.ranking); + writeNotNull('customRanking', instance.customRanking); + writeNotNull('relevancyStrictness', instance.relevancyStrictness); + writeNotNull('attributesToHighlight', instance.attributesToHighlight); + writeNotNull('attributesToSnippet', instance.attributesToSnippet); + writeNotNull('highlightPreTag', instance.highlightPreTag); + writeNotNull('highlightPostTag', instance.highlightPostTag); + writeNotNull('snippetEllipsisText', instance.snippetEllipsisText); + writeNotNull('restrictHighlightAndSnippetArrays', + instance.restrictHighlightAndSnippetArrays); + writeNotNull('hitsPerPage', instance.hitsPerPage); + writeNotNull('minWordSizefor1Typo', instance.minWordSizefor1Typo); + writeNotNull('minWordSizefor2Typos', instance.minWordSizefor2Typos); + writeNotNull('typoTolerance', instance.typoTolerance); + writeNotNull('allowTyposOnNumericTokens', instance.allowTyposOnNumericTokens); + writeNotNull('disableTypoToleranceOnAttributes', + instance.disableTypoToleranceOnAttributes); + writeNotNull('ignorePlurals', instance.ignorePlurals); + writeNotNull('removeStopWords', instance.removeStopWords); + writeNotNull( + 'keepDiacriticsOnCharacters', instance.keepDiacriticsOnCharacters); + writeNotNull('queryLanguages', instance.queryLanguages); + writeNotNull('decompoundQuery', instance.decompoundQuery); + writeNotNull('enableRules', instance.enableRules); + writeNotNull('enablePersonalization', instance.enablePersonalization); + writeNotNull('queryType', instance.queryType?.toJson()); + writeNotNull( + 'removeWordsIfNoResults', instance.removeWordsIfNoResults?.toJson()); + writeNotNull('mode', instance.mode?.toJson()); + writeNotNull('semanticSearch', instance.semanticSearch?.toJson()); + writeNotNull('advancedSyntax', instance.advancedSyntax); + writeNotNull('optionalWords', instance.optionalWords); + writeNotNull('disableExactOnAttributes', instance.disableExactOnAttributes); + writeNotNull( + 'exactOnSingleWordQuery', instance.exactOnSingleWordQuery?.toJson()); + writeNotNull('alternativesAsExact', + instance.alternativesAsExact?.map((e) => e.toJson()).toList()); + writeNotNull('advancedSyntaxFeatures', + instance.advancedSyntaxFeatures?.map((e) => e.toJson()).toList()); + writeNotNull('explain', instance.explain); + writeNotNull('distinct', instance.distinct); + writeNotNull('attributeForDistinct', instance.attributeForDistinct); + writeNotNull('synonyms', instance.synonyms); + writeNotNull( + 'replaceSynonymsInHighlight', instance.replaceSynonymsInHighlight); + writeNotNull('minProximity', instance.minProximity); + writeNotNull('responseFields', instance.responseFields); + writeNotNull('maxFacetHits', instance.maxFacetHits); + writeNotNull('attributeCriteriaComputedByMinProximity', + instance.attributeCriteriaComputedByMinProximity); + writeNotNull('renderingContent', instance.renderingContent?.toJson()); + return val; +} + +const _$QueryTypeEnumMap = { + QueryType.prefixLast: 'prefixLast', + QueryType.prefixAll: 'prefixAll', + QueryType.prefixNone: 'prefixNone', +}; + +const _$RemoveWordsIfNoResultsEnumMap = { + RemoveWordsIfNoResults.none: 'none', + RemoveWordsIfNoResults.lastWords: 'lastWords', + RemoveWordsIfNoResults.firstWords: 'firstWords', + RemoveWordsIfNoResults.allOptional: 'allOptional', +}; + +const _$ModeEnumMap = { + Mode.neuralSearch: 'neuralSearch', + Mode.keywordSearch: 'keywordSearch', +}; + +const _$ExactOnSingleWordQueryEnumMap = { + ExactOnSingleWordQuery.attribute: 'attribute', + ExactOnSingleWordQuery.none: 'none', + ExactOnSingleWordQuery.word: 'word', +}; + +const _$AlternativesAsExactEnumMap = { + AlternativesAsExact.ignorePlurals: 'ignorePlurals', + AlternativesAsExact.singleWordSynonym: 'singleWordSynonym', + AlternativesAsExact.multiWordsSynonym: 'multiWordsSynonym', +}; + +const _$AdvancedSyntaxFeaturesEnumMap = { + AdvancedSyntaxFeatures.exactPhrase: 'exactPhrase', + AdvancedSyntaxFeatures.excludeWords: 'excludeWords', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_params_query.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_params_query.dart new file mode 100644 index 0000000000..0a48d75102 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_params_query.dart @@ -0,0 +1,36 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'search_params_query.g.dart'; + +@JsonSerializable() +final class SearchParamsQuery { + /// Returns a new [SearchParamsQuery] instance. + const SearchParamsQuery({ + this.query, + }); + + /// Text to search for in an index. + @JsonKey(name: r'query') + final String? query; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SearchParamsQuery && other.query == query; + + @override + int get hashCode => query.hashCode; + + factory SearchParamsQuery.fromJson(Map json) => + _$SearchParamsQueryFromJson(json); + + Map toJson() => _$SearchParamsQueryToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_params_query.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_params_query.g.dart new file mode 100644 index 0000000000..5ba266f845 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_params_query.g.dart @@ -0,0 +1,32 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'search_params_query.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SearchParamsQuery _$SearchParamsQueryFromJson(Map json) => + $checkedCreate( + 'SearchParamsQuery', + json, + ($checkedConvert) { + final val = SearchParamsQuery( + query: $checkedConvert('query', (v) => v as String?), + ); + return val; + }, + ); + +Map _$SearchParamsQueryToJson(SearchParamsQuery instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('query', instance.query); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_recommend_rules_params.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_recommend_rules_params.dart new file mode 100644 index 0000000000..9feeabc85a --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_recommend_rules_params.dart @@ -0,0 +1,76 @@ +// 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. +// ignore_for_file: unused_element + +import 'package:json_annotation/json_annotation.dart'; + +part 'search_recommend_rules_params.g.dart'; + +@JsonSerializable() +final class SearchRecommendRulesParams { + /// Returns a new [SearchRecommendRulesParams] instance. + const SearchRecommendRulesParams({ + this.query, + this.context, + this.page, + this.hitsPerPage, + this.enabled, + this.requestOptions, + }); + + /// Full-text query. + @JsonKey(name: r'query') + final String? query; + + /// Restricts responses to the specified [contextual rule](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#creating-contextual-rules). + @JsonKey(name: r'context') + final String? context; + + /// Requested page (the first page is page 0). + // minimum: 0 + @JsonKey(name: r'page') + final int? page; + + /// Maximum number of hits per page. + // minimum: 1 + // maximum: 1000 + @JsonKey(name: r'hitsPerPage') + final int? hitsPerPage; + + /// Restricts responses to enabled rules. When absent (default), _all_ rules are retrieved. + @JsonKey(name: r'enabled') + final bool? enabled; + + /// Request options to send with the API call. + @JsonKey(name: r'requestOptions') + final List? requestOptions; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SearchRecommendRulesParams && + other.query == query && + other.context == context && + other.page == page && + other.hitsPerPage == hitsPerPage && + other.enabled == enabled && + other.requestOptions == requestOptions; + + @override + int get hashCode => + query.hashCode + + context.hashCode + + page.hashCode + + hitsPerPage.hashCode + + (enabled == null ? 0 : enabled.hashCode) + + requestOptions.hashCode; + + factory SearchRecommendRulesParams.fromJson(Map json) => + _$SearchRecommendRulesParamsFromJson(json); + + Map toJson() => _$SearchRecommendRulesParamsToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_recommend_rules_params.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_recommend_rules_params.g.dart new file mode 100644 index 0000000000..f94ef3ba89 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_recommend_rules_params.g.dart @@ -0,0 +1,45 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'search_recommend_rules_params.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SearchRecommendRulesParams _$SearchRecommendRulesParamsFromJson( + Map json) => + $checkedCreate( + 'SearchRecommendRulesParams', + json, + ($checkedConvert) { + final val = SearchRecommendRulesParams( + query: $checkedConvert('query', (v) => v as String?), + context: $checkedConvert('context', (v) => v as String?), + page: $checkedConvert('page', (v) => v as int?), + hitsPerPage: $checkedConvert('hitsPerPage', (v) => v as int?), + enabled: $checkedConvert('enabled', (v) => v as bool?), + requestOptions: $checkedConvert('requestOptions', + (v) => (v as List?)?.map((e) => e as Object).toList()), + ); + return val; + }, + ); + +Map _$SearchRecommendRulesParamsToJson( + SearchRecommendRulesParams instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('query', instance.query); + writeNotNull('context', instance.context); + writeNotNull('page', instance.page); + writeNotNull('hitsPerPage', instance.hitsPerPage); + writeNotNull('enabled', instance.enabled); + writeNotNull('requestOptions', instance.requestOptions); + return val; +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_recommend_rules_response.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_recommend_rules_response.dart new file mode 100644 index 0000000000..1a39bc4ef1 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_recommend_rules_response.dart @@ -0,0 +1,57 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/rule_response.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'search_recommend_rules_response.g.dart'; + +@JsonSerializable() +final class SearchRecommendRulesResponse { + /// Returns a new [SearchRecommendRulesResponse] instance. + const SearchRecommendRulesResponse({ + required this.hits, + required this.nbHits, + required this.page, + required this.nbPages, + }); + + /// Fetched rules. + @JsonKey(name: r'hits') + final List hits; + + /// Number of fetched rules. + @JsonKey(name: r'nbHits') + final int nbHits; + + /// Current page. + @JsonKey(name: r'page') + final int page; + + /// Number of pages. + @JsonKey(name: r'nbPages') + final int nbPages; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SearchRecommendRulesResponse && + other.hits == hits && + other.nbHits == nbHits && + other.page == page && + other.nbPages == nbPages; + + @override + int get hashCode => + hits.hashCode + nbHits.hashCode + page.hashCode + nbPages.hashCode; + + factory SearchRecommendRulesResponse.fromJson(Map json) => + _$SearchRecommendRulesResponseFromJson(json); + + Map toJson() => _$SearchRecommendRulesResponseToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_recommend_rules_response.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_recommend_rules_response.g.dart new file mode 100644 index 0000000000..85f119ab18 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/search_recommend_rules_response.g.dart @@ -0,0 +1,36 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'search_recommend_rules_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SearchRecommendRulesResponse _$SearchRecommendRulesResponseFromJson( + Map json) => + $checkedCreate( + 'SearchRecommendRulesResponse', + json, + ($checkedConvert) { + final val = SearchRecommendRulesResponse( + hits: $checkedConvert( + 'hits', + (v) => (v as List) + .map((e) => RuleResponse.fromJson(e as Map)) + .toList()), + nbHits: $checkedConvert('nbHits', (v) => v as int), + page: $checkedConvert('page', (v) => v as int), + nbPages: $checkedConvert('nbPages', (v) => v as int), + ); + return val; + }, + ); + +Map _$SearchRecommendRulesResponseToJson( + SearchRecommendRulesResponse instance) => + { + 'hits': instance.hits.map((e) => e.toJson()).toList(), + 'nbHits': instance.nbHits, + 'page': instance.page, + 'nbPages': instance.nbPages, + }; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/snippet_result_option.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/snippet_result_option.dart new file mode 100644 index 0000000000..40d787aaca --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/snippet_result_option.dart @@ -0,0 +1,43 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/match_level.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'snippet_result_option.g.dart'; + +@JsonSerializable() +final class SnippetResultOption { + /// Returns a new [SnippetResultOption] instance. + const SnippetResultOption({ + required this.value, + required this.matchLevel, + }); + + /// Markup text with `facetQuery` matches highlighted. + @JsonKey(name: r'value') + final String value; + + @JsonKey(name: r'matchLevel') + final MatchLevel matchLevel; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SnippetResultOption && + other.value == value && + other.matchLevel == matchLevel; + + @override + int get hashCode => value.hashCode + matchLevel.hashCode; + + factory SnippetResultOption.fromJson(Map json) => + _$SnippetResultOptionFromJson(json); + + Map toJson() => _$SnippetResultOptionToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/snippet_result_option.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/snippet_result_option.g.dart new file mode 100644 index 0000000000..99c56459bf --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/snippet_result_option.g.dart @@ -0,0 +1,34 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'snippet_result_option.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SnippetResultOption _$SnippetResultOptionFromJson(Map json) => + $checkedCreate( + 'SnippetResultOption', + json, + ($checkedConvert) { + final val = SnippetResultOption( + value: $checkedConvert('value', (v) => v as String), + matchLevel: $checkedConvert( + 'matchLevel', (v) => $enumDecode(_$MatchLevelEnumMap, v)), + ); + return val; + }, + ); + +Map _$SnippetResultOptionToJson( + SnippetResultOption instance) => + { + 'value': instance.value, + 'matchLevel': instance.matchLevel.toJson(), + }; + +const _$MatchLevelEnumMap = { + MatchLevel.none: 'none', + MatchLevel.partial: 'partial', + MatchLevel.full: 'full', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/sort_remaining_by.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/sort_remaining_by.dart new file mode 100644 index 0000000000..6382bc44ee --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/sort_remaining_by.dart @@ -0,0 +1,31 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// How to display the remaining items: - `count`: facet count (descending). - `alpha`: alphabetical (ascending). - `hidden`: show only pinned values. +@JsonEnum(valueField: 'raw') +enum SortRemainingBy { + /// How to display the remaining items: - `count`: facet count (descending). - `alpha`: alphabetical (ascending). - `hidden`: show only pinned values. + count(r'count'), + + /// How to display the remaining items: - `count`: facet count (descending). - `alpha`: alphabetical (ascending). - `hidden`: show only pinned values. + alpha(r'alpha'), + + /// How to display the remaining items: - `count`: facet count (descending). - `alpha`: alphabetical (ascending). - `hidden`: show only pinned values. + hidden(r'hidden'); + + const SortRemainingBy(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static SortRemainingBy fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/task_status.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/task_status.dart new file mode 100644 index 0000000000..606cb52ec3 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/task_status.dart @@ -0,0 +1,28 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// _published_ if the task has been processed, _notPublished_ otherwise. +@JsonEnum(valueField: 'raw') +enum TaskStatus { + /// _published_ if the task has been processed, _notPublished_ otherwise. + published(r'published'), + + /// _published_ if the task has been processed, _notPublished_ otherwise. + notPublished(r'notPublished'); + + const TaskStatus(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static TaskStatus fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/trending_models.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/trending_models.dart new file mode 100644 index 0000000000..b9badd7b33 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/trending_models.dart @@ -0,0 +1,28 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// Trending model. +@JsonEnum(valueField: 'raw') +enum TrendingModels { + /// Trending model. + facets(r'trending-facets'), + + /// Trending model. + items(r'trending-items'); + + const TrendingModels(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static TrendingModels fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/trending_request.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/trending_request.dart new file mode 100644 index 0000000000..ddacaa5897 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/trending_request.dart @@ -0,0 +1,88 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/search_params_object.dart'; +import 'package:algolia_client_recommend/src/model/trending_models.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'trending_request.g.dart'; + +@JsonSerializable() +final class TrendingRequest { + /// Returns a new [TrendingRequest] instance. + const TrendingRequest({ + required this.model, + this.facetName, + this.facetValue, + required this.indexName, + required this.threshold, + this.maxRecommendations, + this.queryParameters, + this.fallbackParameters, + }); + + @JsonKey(name: r'model') + final TrendingModels model; + + /// Facet name for trending models. + @JsonKey(name: r'facetName') + final String? facetName; + + /// Facet value for trending models. + @JsonKey(name: r'facetValue') + final String? facetValue; + + /// Algolia index name. + @JsonKey(name: r'indexName') + final String indexName; + + /// Recommendations with a confidence score lower than `threshold` won't appear in results. > **Note**: Each recommendation has a confidence score of 0 to 100. The closer the score is to 100, the more relevant the recommendations are. + // minimum: 0 + // maximum: 100 + @JsonKey(name: r'threshold') + final int threshold; + + /// Maximum number of recommendations to retrieve. If 0, all recommendations will be returned. + @JsonKey(name: r'maxRecommendations') + final int? maxRecommendations; + + @JsonKey(name: r'queryParameters') + final SearchParamsObject? queryParameters; + + @JsonKey(name: r'fallbackParameters') + final SearchParamsObject? fallbackParameters; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TrendingRequest && + other.model == model && + other.facetName == facetName && + other.facetValue == facetValue && + other.indexName == indexName && + other.threshold == threshold && + other.maxRecommendations == maxRecommendations && + other.queryParameters == queryParameters && + other.fallbackParameters == fallbackParameters; + + @override + int get hashCode => + model.hashCode + + facetName.hashCode + + facetValue.hashCode + + indexName.hashCode + + threshold.hashCode + + maxRecommendations.hashCode + + queryParameters.hashCode + + fallbackParameters.hashCode; + + factory TrendingRequest.fromJson(Map json) => + _$TrendingRequestFromJson(json); + + Map toJson() => _$TrendingRequestToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/trending_request.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/trending_request.g.dart new file mode 100644 index 0000000000..bc82c8ce6b --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/trending_request.g.dart @@ -0,0 +1,62 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'trending_request.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TrendingRequest _$TrendingRequestFromJson(Map json) => + $checkedCreate( + 'TrendingRequest', + json, + ($checkedConvert) { + final val = TrendingRequest( + model: $checkedConvert( + 'model', (v) => $enumDecode(_$TrendingModelsEnumMap, v)), + facetName: $checkedConvert('facetName', (v) => v as String?), + facetValue: $checkedConvert('facetValue', (v) => v as String?), + indexName: $checkedConvert('indexName', (v) => v as String), + threshold: $checkedConvert('threshold', (v) => v as int), + maxRecommendations: + $checkedConvert('maxRecommendations', (v) => v as int?), + queryParameters: $checkedConvert( + 'queryParameters', + (v) => v == null + ? null + : SearchParamsObject.fromJson(v as Map)), + fallbackParameters: $checkedConvert( + 'fallbackParameters', + (v) => v == null + ? null + : SearchParamsObject.fromJson(v as Map)), + ); + return val; + }, + ); + +Map _$TrendingRequestToJson(TrendingRequest instance) { + final val = { + 'model': instance.model.toJson(), + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('facetName', instance.facetName); + writeNotNull('facetValue', instance.facetValue); + val['indexName'] = instance.indexName; + val['threshold'] = instance.threshold; + writeNotNull('maxRecommendations', instance.maxRecommendations); + writeNotNull('queryParameters', instance.queryParameters?.toJson()); + writeNotNull('fallbackParameters', instance.fallbackParameters?.toJson()); + return val; +} + +const _$TrendingModelsEnumMap = { + TrendingModels.facets: 'trending-facets', + TrendingModels.items: 'trending-items', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/typo_tolerance_enum.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/typo_tolerance_enum.dart new file mode 100644 index 0000000000..b5ec1a7893 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/typo_tolerance_enum.dart @@ -0,0 +1,24 @@ +// 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. +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +@JsonEnum(valueField: 'raw') +enum TypoToleranceEnum { + min(r'min'), + strict(r'strict'); + + const TypoToleranceEnum(this.raw); + final dynamic raw; + + dynamic toJson() => raw; + + static TypoToleranceEnum fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + + @override + String toString() => raw.toString(); +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/value.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/value.dart new file mode 100644 index 0000000000..9aa5856382 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/value.dart @@ -0,0 +1,42 @@ +// 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. +// ignore_for_file: unused_element +import 'package:algolia_client_recommend/src/model/sort_remaining_by.dart'; + +import 'package:json_annotation/json_annotation.dart'; + +part 'value.g.dart'; + +@JsonSerializable() +final class Value { + /// Returns a new [Value] instance. + const Value({ + this.order, + this.sortRemainingBy, + }); + + /// Pinned order of facet lists. + @JsonKey(name: r'order') + final List? order; + + @JsonKey(name: r'sortRemainingBy') + final SortRemainingBy? sortRemainingBy; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Value && + other.order == order && + other.sortRemainingBy == sortRemainingBy; + + @override + int get hashCode => order.hashCode + sortRemainingBy.hashCode; + + factory Value.fromJson(Map json) => _$ValueFromJson(json); + + Map toJson() => _$ValueToJson(this); + + @override + String toString() { + return toJson().toString(); + } +} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/value.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/value.g.dart new file mode 100644 index 0000000000..acb2a48f77 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/value.g.dart @@ -0,0 +1,41 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'value.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Value _$ValueFromJson(Map json) => $checkedCreate( + 'Value', + json, + ($checkedConvert) { + final val = Value( + order: $checkedConvert('order', + (v) => (v as List?)?.map((e) => e as String).toList()), + sortRemainingBy: $checkedConvert('sortRemainingBy', + (v) => $enumDecodeNullable(_$SortRemainingByEnumMap, v)), + ); + return val; + }, + ); + +Map _$ValueToJson(Value instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('order', instance.order); + writeNotNull('sortRemainingBy', instance.sortRemainingBy?.toJson()); + return val; +} + +const _$SortRemainingByEnumMap = { + SortRemainingBy.count: 'count', + SortRemainingBy.alpha: 'alpha', + SortRemainingBy.hidden: 'hidden', +}; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/version.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/version.dart new file mode 100644 index 0000000000..03e065a0a8 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/version.dart @@ -0,0 +1,2 @@ +/// Current package version +const packageVersion = '0.1.2'; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/pubspec.yaml b/clients/algoliasearch-client-dart/packages/client_recommend/pubspec.yaml new file mode 100644 index 0000000000..a091262130 --- /dev/null +++ b/clients/algoliasearch-client-dart/packages/client_recommend/pubspec.yaml @@ -0,0 +1,24 @@ +name: algolia_client_recommend +version: 0.1.2 +description: A sub-package of the AlgoliaSearch library, offering recommend-specific functionalities for enhanced search and discovery in Dart/Flutter apps. +homepage: https://www.algolia.com/doc/ +repository: https://github.com/algolia/algoliasearch-client-dart/tree/main/packages/client_recommend +topics: + - search + - discovery + +environment: + sdk: '>=3.0.0 <4.0.0' + +dependencies: + # Pinning versions until the API stabilizes. + algolia_client_core: 0.1.1+4 + json_annotation: ^4.8.1 + collection: ^1.17.1 + +dev_dependencies: + build_runner: ^2.4.4 + json_serializable: ^6.7.0 + lints: ^2.1.1 + logging: ^1.2.0 + test: ^1.24.3 diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/api/search_client.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/api/search_client.dart index 9c34564544..23f0269396 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/api/search_client.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/api/search_client.dart @@ -129,9 +129,9 @@ final class SearchClient implements ApiClient { /// If you use an existing `objectID`, the existing record will be replaced with the new one. To update only some attributes of an existing record, use the [`partial` operation](#tag/Records/operation/partialUpdateObject) instead. To add multiple records to your index in a single API request, use the [`batch` operation](#tag/Records/operation/batch). /// /// Parameters: - /// * [indexName] - Index on which to perform the request. - /// * [objectID] - Unique record (object) identifier. - /// * [body] - Algolia record. + /// * [indexName] Index on which to perform the request. + /// * [objectID] Unique record (object) identifier. + /// * [body] Algolia record. /// * [requestOptions] additional request configuration. Future addOrUpdateObject({ required String indexName, @@ -184,7 +184,7 @@ final class SearchClient implements ApiClient { /// Add a source to the list of allowed sources. /// /// Parameters: - /// * [source] - Source to add. + /// * [source] Source to add. /// * [requestOptions] additional request configuration. Future appendSource({ required Source source, @@ -210,7 +210,7 @@ final class SearchClient implements ApiClient { /// Assign or move a user ID to a cluster. The time it takes to move a user is proportional to the amount of data linked to the user ID. /// /// Parameters: - /// * [xAlgoliaUserID] - userID to assign. + /// * [xAlgoliaUserID] userID to assign. /// * [assignUserIdParams] /// * [requestOptions] additional request configuration. Future assignUserId({ @@ -245,7 +245,7 @@ final class SearchClient implements ApiClient { /// To reduce the time spent on network round trips, you can perform several write actions in a single API call. Actions are applied in the order they are specified. The supported `action`s are equivalent to the individual operations of the same name. /// /// Parameters: - /// * [indexName] - Index on which to perform the request. + /// * [indexName] Index on which to perform the request. /// * [batchWriteParams] /// * [requestOptions] additional request configuration. Future batch({ @@ -278,7 +278,7 @@ final class SearchClient implements ApiClient { /// Assign multiple user IDs to a cluster. **You can't _move_ users with this operation.**. /// /// Parameters: - /// * [xAlgoliaUserID] - userID to assign. + /// * [xAlgoliaUserID] userID to assign. /// * [batchAssignUserIdsParams] /// * [requestOptions] additional request configuration. Future batchAssignUserIds({ @@ -313,7 +313,7 @@ final class SearchClient implements ApiClient { /// Add or remove a batch of dictionary entries. /// /// Parameters: - /// * [dictionaryName] - Dictionary to search in. + /// * [dictionaryName] Dictionary to search in. /// * [batchDictionaryEntriesParams] /// * [requestOptions] additional request configuration. Future batchDictionaryEntries({ @@ -343,8 +343,8 @@ final class SearchClient implements ApiClient { /// Retrieve up to 1,000 records per call. Supports full-text search and filters. For better performance, it doesn't support: - The `distinct` query parameter - Sorting by typos, proximity, words, or geographical distance. /// /// Parameters: - /// * [indexName] - Index on which to perform the request. - /// * [browseParams] + /// * [indexName] Index on which to perform the request. + /// * [browseParams] - one of types: [SearchParamsString], [BrowseParamsObject], /// * [requestOptions] additional request configuration. Future browse({ required String indexName, @@ -376,8 +376,8 @@ final class SearchClient implements ApiClient { /// Delete all synonyms in the index. /// /// Parameters: - /// * [indexName] - Index on which to perform the request. - /// * [forwardToReplicas] - Indicates whether changed index settings are forwarded to the replica indices. + /// * [indexName] Index on which to perform the request. + /// * [forwardToReplicas] Indicates whether changed index settings are forwarded to the replica indices. /// * [requestOptions] additional request configuration. Future clearAllSynonyms({ required String indexName, @@ -411,7 +411,7 @@ final class SearchClient implements ApiClient { /// Delete the records but leave settings and index-specific API keys untouched. /// /// Parameters: - /// * [indexName] - Index on which to perform the request. + /// * [indexName] Index on which to perform the request. /// * [requestOptions] additional request configuration. Future clearObjects({ required String indexName, @@ -441,8 +441,8 @@ final class SearchClient implements ApiClient { /// Delete all rules in the index. /// /// Parameters: - /// * [indexName] - Index on which to perform the request. - /// * [forwardToReplicas] - Indicates whether changed index settings are forwarded to the replica indices. + /// * [indexName] Index on which to perform the request. + /// * [forwardToReplicas] Indicates whether changed index settings are forwarded to the replica indices. /// * [requestOptions] additional request configuration. Future clearRules({ required String indexName, @@ -476,8 +476,8 @@ final class SearchClient implements ApiClient { /// This method allow you to send requests to the Algolia REST API. /// /// Parameters: - /// * [path] - Path of the endpoint, anything after \"/1\" must be specified. - /// * [parameters] - Query parameters to apply to the current query. + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. /// * [requestOptions] additional request configuration. Future del({ required String path, @@ -510,7 +510,7 @@ final class SearchClient implements ApiClient { /// Delete an existing API key. The request must be authenticated with the admin API key. /// /// Parameters: - /// * [key] - API key. + /// * [key] API key. /// * [requestOptions] additional request configuration. Future deleteApiKey({ required String key, @@ -540,7 +540,7 @@ final class SearchClient implements ApiClient { /// This operation doesn't support all the query options, only its filters (numeric, facet, or tag) and geo queries. It doesn't accept empty filters or queries. /// /// Parameters: - /// * [indexName] - Index on which to perform the request. + /// * [indexName] Index on which to perform the request. /// * [deleteByParams] /// * [requestOptions] additional request configuration. Future deleteBy({ @@ -573,7 +573,7 @@ final class SearchClient implements ApiClient { /// Delete an existing index. /// /// Parameters: - /// * [indexName] - Index on which to perform the request. + /// * [indexName] Index on which to perform the request. /// * [requestOptions] additional request configuration. Future deleteIndex({ required String indexName, @@ -603,8 +603,8 @@ final class SearchClient implements ApiClient { /// To delete a set of records matching a query, use the [`deleteByQuery` operation](#tag/Records/operation/deleteBy) instead. /// /// Parameters: - /// * [indexName] - Index on which to perform the request. - /// * [objectID] - Unique record (object) identifier. + /// * [indexName] Index on which to perform the request. + /// * [objectID] Unique record (object) identifier. /// * [requestOptions] additional request configuration. Future deleteObject({ required String indexName, @@ -642,9 +642,9 @@ final class SearchClient implements ApiClient { /// Delete a rule by its `objectID`. To find the `objectID` for rules, use the [`search` operation](#tag/Rules/operation/searchRules). /// /// Parameters: - /// * [indexName] - Index on which to perform the request. - /// * [objectID] - Unique identifier of a rule object. - /// * [forwardToReplicas] - Indicates whether changed index settings are forwarded to the replica indices. + /// * [indexName] Index on which to perform the request. + /// * [objectID] Unique identifier of a rule object. + /// * [forwardToReplicas] Indicates whether changed index settings are forwarded to the replica indices. /// * [requestOptions] additional request configuration. Future deleteRule({ required String indexName, @@ -686,7 +686,7 @@ final class SearchClient implements ApiClient { /// Remove a source from the list of allowed sources. /// /// Parameters: - /// * [source] - IP address range of the source. + /// * [source] IP address range of the source. /// * [requestOptions] additional request configuration. Future deleteSource({ required String source, @@ -716,9 +716,9 @@ final class SearchClient implements ApiClient { /// Delete a synonym by its `objectID`. To find the object IDs of your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms). /// /// Parameters: - /// * [indexName] - Index on which to perform the request. - /// * [objectID] - Unique identifier of a synonym object. - /// * [forwardToReplicas] - Indicates whether changed index settings are forwarded to the replica indices. + /// * [indexName] Index on which to perform the request. + /// * [objectID] Unique identifier of a synonym object. + /// * [forwardToReplicas] Indicates whether changed index settings are forwarded to the replica indices. /// * [requestOptions] additional request configuration. Future deleteSynonym({ required String indexName, @@ -760,8 +760,8 @@ final class SearchClient implements ApiClient { /// This method allow you to send requests to the Algolia REST API. /// /// Parameters: - /// * [path] - Path of the endpoint, anything after \"/1\" must be specified. - /// * [parameters] - Query parameters to apply to the current query. + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. /// * [requestOptions] additional request configuration. Future get({ required String path, @@ -794,7 +794,7 @@ final class SearchClient implements ApiClient { /// Get the permissions and restrictions of a specific API key. When authenticating with the admin API key, you can request information for any of your application's keys. When authenticating with other API keys, you can only retrieve information for that key. /// /// Parameters: - /// * [key] - API key. + /// * [key] API key. /// * [requestOptions] additional request configuration. Future getApiKey({ required String key, @@ -871,14 +871,14 @@ final class SearchClient implements ApiClient { /// The request must be authenticated by an API key with the [`logs` ACL](https://www.algolia.com/doc/guides/security/api-keys/#access-control-list-acl). Logs are held for the last seven days. There's also a logging limit of 1,000 API calls per server. This request counts towards your [operations quota](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-) but doesn't appear in the logs itself. > **Note**: To fetch the logs for a Distributed Search Network (DSN) cluster, target the [DSN's endpoint](https://www.algolia.com/doc/guides/scaling/distributed-search-network-dsn/#accessing-dsn-servers). /// /// Parameters: - /// * [offset] - First log entry to retrieve. Sorted by decreasing date with 0 being the most recent. - /// * [length] - Maximum number of entries to retrieve. - /// * [indexName] - Index for which log entries should be retrieved. When omitted, log entries are retrieved for all indices. - /// * [type] - Type of log entries to retrieve. When omitted, all log entries are retrieved. + /// * [offset] First log entry to retrieve. Sorted by decreasing date with 0 being the most recent. + /// * [length] Maximum number of entries to retrieve. + /// * [indexName] Index for which log entries should be retrieved. When omitted, log entries are retrieved for all indices. + /// * [type] Type of log entries to retrieve. When omitted, all log entries are retrieved. /// * [requestOptions] additional request configuration. Future getLogs({ - int? offset = 0, - int? length = 10, + int? offset, + int? length, String? indexName, LogType? type, RequestOptions? requestOptions, @@ -908,9 +908,9 @@ final class SearchClient implements ApiClient { /// To get more than one record, use the [`objects` operation](#tag/Records/operation/getObjects). /// /// Parameters: - /// * [indexName] - Index on which to perform the request. - /// * [objectID] - Unique record (object) identifier. - /// * [attributesToRetrieve] - Attributes to include with the records in the response. This is useful to reduce the size of the API response. By default, all retrievable attributes are returned. `objectID` is always retrieved, even when not specified. [`unretrievableAttributes`](https://www.algolia.com/doc/api-reference/api-parameters/unretrievableAttributes/) won't be retrieved unless the request is authenticated with the admin API key. + /// * [indexName] Index on which to perform the request. + /// * [objectID] Unique record (object) identifier. + /// * [attributesToRetrieve] Attributes to include with the records in the response. This is useful to reduce the size of the API response. By default, all retrievable attributes are returned. `objectID` is always retrieved, even when not specified. [`unretrievableAttributes`](https://www.algolia.com/doc/api-reference/api-parameters/unretrievableAttributes/) won't be retrieved unless the request is authenticated with the admin API key. /// * [requestOptions] additional request configuration. Future> getObject({ required String indexName, @@ -953,7 +953,7 @@ final class SearchClient implements ApiClient { /// Retrieve one or more records, potentially from different indices, in a single API operation. Results will be received in the same order as the requests. /// /// Parameters: - /// * [getObjectsParams] - Request object. + /// * [getObjectsParams] Request object. /// * [requestOptions] additional request configuration. Future getObjects({ required GetObjectsParams getObjectsParams, @@ -980,8 +980,8 @@ final class SearchClient implements ApiClient { /// Get a rule by its `objectID`. To find the `objectID` for rules, use the [`search` operation](#tag/Rules/operation/searchRules). /// /// Parameters: - /// * [indexName] - Index on which to perform the request. - /// * [objectID] - Unique identifier of a rule object. + /// * [indexName] Index on which to perform the request. + /// * [objectID] Unique identifier of a rule object. /// * [requestOptions] additional request configuration. Future getRule({ required String indexName, @@ -1019,7 +1019,7 @@ final class SearchClient implements ApiClient { /// Return an object containing an index's [configuration settings](https://www.algolia.com/doc/api-reference/settings-api-parameters/). /// /// Parameters: - /// * [indexName] - Index on which to perform the request. + /// * [indexName] Index on which to perform the request. /// * [requestOptions] additional request configuration. Future getSettings({ required String indexName, @@ -1072,8 +1072,8 @@ final class SearchClient implements ApiClient { /// Get a syonym by its `objectID`. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms). /// /// Parameters: - /// * [indexName] - Index on which to perform the request. - /// * [objectID] - Unique identifier of a synonym object. + /// * [indexName] Index on which to perform the request. + /// * [objectID] Unique identifier of a synonym object. /// * [requestOptions] additional request configuration. Future getSynonym({ required String indexName, @@ -1111,8 +1111,8 @@ final class SearchClient implements ApiClient { /// Some operations, such as copying an index, will respond with a `taskID` value. Use this value here to check the status of that task. /// /// Parameters: - /// * [indexName] - Index on which to perform the request. - /// * [taskID] - Unique task identifier. + /// * [indexName] Index on which to perform the request. + /// * [taskID] Unique task identifier. /// * [requestOptions] additional request configuration. Future getTask({ required String indexName, @@ -1169,7 +1169,7 @@ final class SearchClient implements ApiClient { /// Returns the userID data stored in the mapping. Since it can take up to a few seconds to get the data from the different clusters, the response isn't real-time. /// /// Parameters: - /// * [userID] - userID to assign. + /// * [userID] userID to assign. /// * [requestOptions] additional request configuration. Future getUserId({ required String userID, @@ -1199,7 +1199,7 @@ final class SearchClient implements ApiClient { /// To determine when the time-consuming process of creating a large batch of users or migrating users from one cluster to another is complete, this operation retrieves the status of the process. /// /// Parameters: - /// * [getClusters] - Indicates whether to include the cluster's pending mapping state in the response. + /// * [getClusters] Indicates whether to include the cluster's pending mapping state in the response. /// * [requestOptions] additional request configuration. Future hasPendingMappings({ bool? getClusters, @@ -1273,12 +1273,12 @@ final class SearchClient implements ApiClient { /// List indices in an Algolia application. /// /// Parameters: - /// * [page] - Returns the requested page number. The page size is determined by the `hitsPerPage` parameter. You can see the number of available pages in the `nbPages` response attribute. When `page` is null, the API response is not paginated. - /// * [hitsPerPage] - Maximum number of hits per page. + /// * [page] Returns the requested page number. The page size is determined by the `hitsPerPage` parameter. You can see the number of available pages in the `nbPages` response attribute. When `page` is null, the API response is not paginated. + /// * [hitsPerPage] Maximum number of hits per page. /// * [requestOptions] additional request configuration. Future listIndices({ int? page, - int? hitsPerPage = 100, + int? hitsPerPage, RequestOptions? requestOptions, }) async { final request = ApiRequest( @@ -1304,12 +1304,12 @@ final class SearchClient implements ApiClient { /// List the userIDs assigned to a multi-cluster application. Since it can take up to a few seconds to get the data from the different clusters, the response isn't real-time. /// /// Parameters: - /// * [page] - Returns the requested page number. The page size is determined by the `hitsPerPage` parameter. You can see the number of available pages in the `nbPages` response attribute. When `page` is null, the API response is not paginated. - /// * [hitsPerPage] - Maximum number of hits per page. + /// * [page] Returns the requested page number. The page size is determined by the `hitsPerPage` parameter. You can see the number of available pages in the `nbPages` response attribute. When `page` is null, the API response is not paginated. + /// * [hitsPerPage] Maximum number of hits per page. /// * [requestOptions] additional request configuration. Future listUserIds({ int? page, - int? hitsPerPage = 100, + int? hitsPerPage, RequestOptions? requestOptions, }) async { final request = ApiRequest( @@ -1361,7 +1361,7 @@ final class SearchClient implements ApiClient { /// This `operation`, _copy_ or _move_, will copy or move a source index's (`IndexName`) records, settings, synonyms, and rules to a `destination` index. If the destination index exists, it will be replaced, except for index-specific API keys and analytics data. If the destination index doesn't exist, it will be created. The choice between moving or copying an index depends on your needs. Choose: - **Move** to rename an index. - **Copy** to create a new index with the same records and configuration as an existing one. > **Note**: When considering copying or moving, be aware of the [rate limitations](https://www.algolia.com/doc/guides/scaling/algolia-service-limits/#application-record-and-index-limits) on these processes and the [impact on your analytics data](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/concepts/indices-analytics/). /// /// Parameters: - /// * [indexName] - Index on which to perform the request. + /// * [indexName] Index on which to perform the request. /// * [operationIndexParams] /// * [requestOptions] additional request configuration. Future operationIndex({ @@ -1394,16 +1394,16 @@ final class SearchClient implements ApiClient { /// Add new attributes or update current ones in an existing record. You can use any first-level attribute but not nested attributes. If you specify a [nested attribute](https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/how-to/creating-and-using-nested-attributes/), the engine treats it as a replacement for its first-level ancestor. /// /// Parameters: - /// * [indexName] - Index on which to perform the request. - /// * [objectID] - Unique record (object) identifier. - /// * [attributesToUpdate] - Object with attributes to update. - /// * [createIfNotExists] - Indicates whether to create a new record if it doesn't exist yet. + /// * [indexName] Index on which to perform the request. + /// * [objectID] Unique record (object) identifier. + /// * [attributesToUpdate] Object with attributes to update. - one of types: [BuiltInOperation], [String], + /// * [createIfNotExists] Indicates whether to create a new record if it doesn't exist yet. /// * [requestOptions] additional request configuration. Future partialUpdateObject({ required String indexName, required String objectID, required Map attributesToUpdate, - bool? createIfNotExists = true, + bool? createIfNotExists, RequestOptions? requestOptions, }) async { assert( @@ -1442,9 +1442,9 @@ final class SearchClient implements ApiClient { /// This method allow you to send requests to the Algolia REST API. /// /// Parameters: - /// * [path] - Path of the endpoint, anything after \"/1\" must be specified. - /// * [parameters] - Query parameters to apply to the current query. - /// * [body] - Parameters to send with the custom request. + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [body] Parameters to send with the custom request. /// * [requestOptions] additional request configuration. Future post({ required String path, @@ -1479,9 +1479,9 @@ final class SearchClient implements ApiClient { /// This method allow you to send requests to the Algolia REST API. /// /// Parameters: - /// * [path] - Path of the endpoint, anything after \"/1\" must be specified. - /// * [parameters] - Query parameters to apply to the current query. - /// * [body] - Parameters to send with the custom request. + /// * [path] Path of the endpoint, anything after \"/1\" must be specified. + /// * [parameters] Query parameters to apply to the current query. + /// * [body] Parameters to send with the custom request. /// * [requestOptions] additional request configuration. Future put({ required String path, @@ -1516,7 +1516,7 @@ final class SearchClient implements ApiClient { /// Remove a userID and its associated data from the multi-clusters. /// /// Parameters: - /// * [userID] - userID to assign. + /// * [userID] userID to assign. /// * [requestOptions] additional request configuration. Future removeUserId({ required String userID, @@ -1546,7 +1546,7 @@ final class SearchClient implements ApiClient { /// Replace all allowed sources. /// /// Parameters: - /// * [source] - Allowed sources. + /// * [source] Allowed sources. /// * [requestOptions] additional request configuration. Future replaceSources({ required List source, @@ -1572,7 +1572,7 @@ final class SearchClient implements ApiClient { /// Restore a deleted API key, along with its associated permissions. The request must be authenticated with the admin API key. /// /// Parameters: - /// * [key] - API key. + /// * [key] API key. /// * [requestOptions] additional request configuration. Future restoreApiKey({ required String key, @@ -1602,8 +1602,8 @@ final class SearchClient implements ApiClient { /// Add a record (object) to an index or replace it. If the record doesn't contain an `objectID`, Algolia automatically adds it. If you use an existing `objectID`, the existing record is replaced with the new one. To add multiple records to your index in a single API request, use the [`batch` operation](#tag/Records/operation/batch). /// /// Parameters: - /// * [indexName] - Index on which to perform the request. - /// * [body] - The Algolia record. + /// * [indexName] Index on which to perform the request. + /// * [body] The Algolia record. /// * [requestOptions] additional request configuration. Future saveObject({ required String indexName, @@ -1647,10 +1647,10 @@ final class SearchClient implements ApiClient { /// To create or update more than one rule, use the [`batch` operation](#tag/Rules/operation/saveRules). /// /// Parameters: - /// * [indexName] - Index on which to perform the request. - /// * [objectID] - Unique identifier of a rule object. + /// * [indexName] Index on which to perform the request. + /// * [objectID] Unique identifier of a rule object. /// * [rule] - /// * [forwardToReplicas] - Indicates whether changed index settings are forwarded to the replica indices. + /// * [forwardToReplicas] Indicates whether changed index settings are forwarded to the replica indices. /// * [requestOptions] additional request configuration. Future saveRule({ required String indexName, @@ -1694,10 +1694,10 @@ final class SearchClient implements ApiClient { /// Create or update multiple rules. /// /// Parameters: - /// * [indexName] - Index on which to perform the request. + /// * [indexName] Index on which to perform the request. /// * [rules] - /// * [forwardToReplicas] - Indicates whether changed index settings are forwarded to the replica indices. - /// * [clearExistingRules] - Indicates whether existing rules should be deleted before adding this batch. + /// * [forwardToReplicas] Indicates whether changed index settings are forwarded to the replica indices. + /// * [clearExistingRules] Indicates whether existing rules should be deleted before adding this batch. /// * [requestOptions] additional request configuration. Future saveRules({ required String indexName, @@ -1736,10 +1736,10 @@ final class SearchClient implements ApiClient { /// Add a [synonym](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#the-different-types-of-synonyms) to an index or replace it. If the synonym `objectID` doesn't exist, Algolia adds a new one. If you use an existing synonym `objectID`, the existing synonym is replaced with the new one. To add multiple synonyms in a single API request, use the [`batch` operation](#tag/Synonyms/operation/saveSynonyms). /// /// Parameters: - /// * [indexName] - Index on which to perform the request. - /// * [objectID] - Unique identifier of a synonym object. + /// * [indexName] Index on which to perform the request. + /// * [objectID] Unique identifier of a synonym object. /// * [synonymHit] - /// * [forwardToReplicas] - Indicates whether changed index settings are forwarded to the replica indices. + /// * [forwardToReplicas] Indicates whether changed index settings are forwarded to the replica indices. /// * [requestOptions] additional request configuration. Future saveSynonym({ required String indexName, @@ -1783,10 +1783,10 @@ final class SearchClient implements ApiClient { /// Create or update multiple synonyms. /// /// Parameters: - /// * [indexName] - Index on which to perform the request. + /// * [indexName] Index on which to perform the request. /// * [synonymHit] - /// * [forwardToReplicas] - Indicates whether changed index settings are forwarded to the replica indices. - /// * [replaceExistingSynonyms] - Indicates whether to replace all synonyms in the index with the ones sent with this request. + /// * [forwardToReplicas] Indicates whether changed index settings are forwarded to the replica indices. + /// * [replaceExistingSynonyms] Indicates whether to replace all synonyms in the index with the ones sent with this request. /// * [requestOptions] additional request configuration. Future saveSynonyms({ required String indexName, @@ -1825,7 +1825,7 @@ final class SearchClient implements ApiClient { /// Send multiple search queries to one or more indices. /// /// Parameters: - /// * [searchMethodParams] - Query requests and strategies. Results will be received in the same order as the queries. + /// * [searchMethodParams] Query requests and strategies. Results will be received in the same order as the queries. /// * [requestOptions] additional request configuration. Future search({ required SearchMethodParams searchMethodParams, @@ -1852,7 +1852,7 @@ final class SearchClient implements ApiClient { /// Search for standard and [custom](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-stop-words/) entries in the [stop words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-stop-words/), [plurals](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-plurals-and-other-declensions/), or [segmentation (compounds)](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-segmentation/) dictionaries. /// /// Parameters: - /// * [dictionaryName] - Dictionary to search in. + /// * [dictionaryName] Dictionary to search in. /// * [searchDictionaryEntriesParams] /// * [requestOptions] additional request configuration. Future searchDictionaryEntries({ @@ -1883,8 +1883,8 @@ final class SearchClient implements ApiClient { /// [Search for a facet's values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values), optionally restricting the returned values to those contained in records matching other search criteria. > **Note**: Pagination isn't supported (`page` and `hitsPerPage` are ignored). By default, the engine returns a maximum of 10 values but you can adjust this with `maxFacetHits`. /// /// Parameters: - /// * [indexName] - Index on which to perform the request. - /// * [facetName] - Facet name. + /// * [indexName] Index on which to perform the request. + /// * [facetName] Facet name. /// * [searchForFacetValuesRequest] /// * [requestOptions] additional request configuration. Future searchForFacetValues({ @@ -1927,7 +1927,7 @@ final class SearchClient implements ApiClient { /// Search for rules in your index. You can control the search with parameters. To list all rules, send an empty request body. /// /// Parameters: - /// * [indexName] - Index on which to perform the request. + /// * [indexName] Index on which to perform the request. /// * [searchRulesParams] /// * [requestOptions] additional request configuration. Future searchRules({ @@ -1961,8 +1961,8 @@ final class SearchClient implements ApiClient { /// Return records that match the query. /// /// Parameters: - /// * [indexName] - Index on which to perform the request. - /// * [searchParams] + /// * [indexName] Index on which to perform the request. + /// * [searchParams] - one of types: [SearchParamsString], [SearchParamsObject], /// * [requestOptions] additional request configuration. Future searchSingleIndex({ required String indexName, @@ -1995,17 +1995,17 @@ final class SearchClient implements ApiClient { /// Search for synonyms in your index. You can control and filter the search with parameters. To get all synonyms, send an empty request body. /// /// Parameters: - /// * [indexName] - Index on which to perform the request. - /// * [type] - Search for specific [types of synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#the-different-types-of-synonyms). - /// * [page] - Returns the requested page number (the first page is 0). Page size is set by `hitsPerPage`. When null, there's no pagination. - /// * [hitsPerPage] - Maximum number of hits per page. - /// * [searchSynonymsParams] - Body of the `searchSynonyms` operation. + /// * [indexName] Index on which to perform the request. + /// * [type] Search for specific [types of synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#the-different-types-of-synonyms). + /// * [page] Returns the requested page number (the first page is 0). Page size is set by `hitsPerPage`. When null, there's no pagination. + /// * [hitsPerPage] Maximum number of hits per page. + /// * [searchSynonymsParams] Body of the `searchSynonyms` operation. /// * [requestOptions] additional request configuration. Future searchSynonyms({ required String indexName, SynonymType? type, - int? page = 0, - int? hitsPerPage = 100, + int? page, + int? hitsPerPage, SearchSynonymsParams? searchSynonymsParams, RequestOptions? requestOptions, }) async { @@ -2093,9 +2093,9 @@ final class SearchClient implements ApiClient { /// Update the specified [index settings](https://www.algolia.com/doc/api-reference/settings-api-parameters/). Specifying null for a setting resets it to its default value. /// /// Parameters: - /// * [indexName] - Index on which to perform the request. + /// * [indexName] Index on which to perform the request. /// * [indexSettings] - /// * [forwardToReplicas] - Indicates whether changed index settings are forwarded to the replica indices. + /// * [forwardToReplicas] Indicates whether changed index settings are forwarded to the replica indices. /// * [requestOptions] additional request configuration. Future setSettings({ required String indexName, @@ -2131,7 +2131,7 @@ final class SearchClient implements ApiClient { /// Replace the permissions of an existing API key. Any unspecified parameter resets that permission to its default value. The request must be authenticated with the admin API key. /// /// Parameters: - /// * [key] - API key. + /// * [key] API key. /// * [apiKey] /// * [requestOptions] additional request configuration. Future updateApiKey({ diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/deserialize.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/deserialize.dart index 1eb3bbeba0..3d0b138143 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/deserialize.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/deserialize.dart @@ -1,5 +1,11 @@ +import 'package:algolia_client_search/src/model/acl.dart'; +import 'package:algolia_client_search/src/model/action.dart'; import 'package:algolia_client_search/src/model/add_api_key_response.dart'; +import 'package:algolia_client_search/src/model/advanced_syntax_features.dart'; +import 'package:algolia_client_search/src/model/alternatives_as_exact.dart'; +import 'package:algolia_client_search/src/model/anchoring.dart'; import 'package:algolia_client_search/src/model/api_key.dart'; +import 'package:algolia_client_search/src/model/around_radius_all.dart'; import 'package:algolia_client_search/src/model/assign_user_id_params.dart'; import 'package:algolia_client_search/src/model/automatic_facet_filter.dart'; import 'package:algolia_client_search/src/model/base_get_api_key_response.dart'; @@ -18,6 +24,7 @@ import 'package:algolia_client_search/src/model/batch_write_params.dart'; import 'package:algolia_client_search/src/model/browse_params_object.dart'; import 'package:algolia_client_search/src/model/browse_response.dart'; import 'package:algolia_client_search/src/model/built_in_operation.dart'; +import 'package:algolia_client_search/src/model/built_in_operation_type.dart'; import 'package:algolia_client_search/src/model/condition.dart'; import 'package:algolia_client_search/src/model/consequence.dart'; import 'package:algolia_client_search/src/model/consequence_hide.dart'; @@ -29,11 +36,16 @@ import 'package:algolia_client_search/src/model/delete_api_key_response.dart'; import 'package:algolia_client_search/src/model/delete_by_params.dart'; import 'package:algolia_client_search/src/model/delete_source_response.dart'; import 'package:algolia_client_search/src/model/deleted_at_response.dart'; +import 'package:algolia_client_search/src/model/dictionary_action.dart'; import 'package:algolia_client_search/src/model/dictionary_entry.dart'; +import 'package:algolia_client_search/src/model/dictionary_entry_state.dart'; import 'package:algolia_client_search/src/model/dictionary_language.dart'; import 'package:algolia_client_search/src/model/dictionary_settings_params.dart'; +import 'package:algolia_client_search/src/model/dictionary_type.dart'; import 'package:algolia_client_search/src/model/edit.dart'; +import 'package:algolia_client_search/src/model/edit_type.dart'; import 'package:algolia_client_search/src/model/error_base.dart'; +import 'package:algolia_client_search/src/model/exact_on_single_word_query.dart'; import 'package:algolia_client_search/src/model/facet_hits.dart'; import 'package:algolia_client_search/src/model/facet_ordering.dart'; import 'package:algolia_client_search/src/model/facets.dart'; @@ -60,23 +72,30 @@ import 'package:algolia_client_search/src/model/list_indices_response.dart'; import 'package:algolia_client_search/src/model/list_user_ids_response.dart'; import 'package:algolia_client_search/src/model/log.dart'; import 'package:algolia_client_search/src/model/log_query.dart'; +import 'package:algolia_client_search/src/model/log_type.dart'; +import 'package:algolia_client_search/src/model/match_level.dart'; import 'package:algolia_client_search/src/model/matched_geo_location.dart'; +import 'package:algolia_client_search/src/model/mode.dart'; import 'package:algolia_client_search/src/model/multiple_batch_request.dart'; import 'package:algolia_client_search/src/model/multiple_batch_response.dart'; import 'package:algolia_client_search/src/model/operation_index_params.dart'; +import 'package:algolia_client_search/src/model/operation_type.dart'; import 'package:algolia_client_search/src/model/params.dart'; import 'package:algolia_client_search/src/model/personalization.dart'; import 'package:algolia_client_search/src/model/promote_object_id.dart'; import 'package:algolia_client_search/src/model/promote_object_ids.dart'; +import 'package:algolia_client_search/src/model/query_type.dart'; import 'package:algolia_client_search/src/model/ranking_info.dart'; import 'package:algolia_client_search/src/model/redirect_rule_index_metadata.dart'; import 'package:algolia_client_search/src/model/redirect_rule_index_metadata_data.dart'; import 'package:algolia_client_search/src/model/remove_user_id_response.dart'; +import 'package:algolia_client_search/src/model/remove_words_if_no_results.dart'; import 'package:algolia_client_search/src/model/rendering_content.dart'; import 'package:algolia_client_search/src/model/replace_source_response.dart'; import 'package:algolia_client_search/src/model/rule.dart'; import 'package:algolia_client_search/src/model/save_object_response.dart'; import 'package:algolia_client_search/src/model/save_synonym_response.dart'; +import 'package:algolia_client_search/src/model/scope_type.dart'; import 'package:algolia_client_search/src/model/search_dictionary_entries_params.dart'; import 'package:algolia_client_search/src/model/search_for_facet_values_request.dart'; import 'package:algolia_client_search/src/model/search_for_facet_values_response.dart'; @@ -93,15 +112,22 @@ import 'package:algolia_client_search/src/model/search_response.dart'; import 'package:algolia_client_search/src/model/search_responses.dart'; import 'package:algolia_client_search/src/model/search_rules_params.dart'; import 'package:algolia_client_search/src/model/search_rules_response.dart'; +import 'package:algolia_client_search/src/model/search_strategy.dart'; import 'package:algolia_client_search/src/model/search_synonyms_params.dart'; import 'package:algolia_client_search/src/model/search_synonyms_response.dart'; +import 'package:algolia_client_search/src/model/search_type_default.dart'; +import 'package:algolia_client_search/src/model/search_type_facet.dart'; import 'package:algolia_client_search/src/model/search_user_ids_params.dart'; import 'package:algolia_client_search/src/model/search_user_ids_response.dart'; import 'package:algolia_client_search/src/model/snippet_result_option.dart'; +import 'package:algolia_client_search/src/model/sort_remaining_by.dart'; import 'package:algolia_client_search/src/model/source.dart'; import 'package:algolia_client_search/src/model/standard_entries.dart'; import 'package:algolia_client_search/src/model/synonym_hit.dart'; +import 'package:algolia_client_search/src/model/synonym_type.dart'; +import 'package:algolia_client_search/src/model/task_status.dart'; import 'package:algolia_client_search/src/model/time_range.dart'; +import 'package:algolia_client_search/src/model/typo_tolerance_enum.dart'; import 'package:algolia_client_search/src/model/update_api_key_response.dart'; import 'package:algolia_client_search/src/model/updated_at_response.dart'; import 'package:algolia_client_search/src/model/updated_at_with_object_id_response.dart'; @@ -131,16 +157,22 @@ ReturnType deserialize(dynamic value, String targetType, case 'double': return (value is double ? value : double.parse('$value')) as ReturnType; case 'Acl': + return Acl.fromJson(value) as ReturnType; case 'Action': + return Action.fromJson(value) as ReturnType; case 'AddApiKeyResponse': return AddApiKeyResponse.fromJson(value as Map) as ReturnType; case 'AdvancedSyntaxFeatures': + return AdvancedSyntaxFeatures.fromJson(value) as ReturnType; case 'AlternativesAsExact': + return AlternativesAsExact.fromJson(value) as ReturnType; case 'Anchoring': + return Anchoring.fromJson(value) as ReturnType; case 'ApiKey': return ApiKey.fromJson(value as Map) as ReturnType; case 'AroundRadiusAll': + return AroundRadiusAll.fromJson(value) as ReturnType; case 'AssignUserIdParams': return AssignUserIdParams.fromJson(value as Map) as ReturnType; @@ -194,6 +226,7 @@ ReturnType deserialize(dynamic value, String targetType, return BuiltInOperation.fromJson(value as Map) as ReturnType; case 'BuiltInOperationType': + return BuiltInOperationType.fromJson(value) as ReturnType; case 'Condition': return Condition.fromJson(value as Map) as ReturnType; case 'Consequence': @@ -225,10 +258,12 @@ ReturnType deserialize(dynamic value, String targetType, return DeletedAtResponse.fromJson(value as Map) as ReturnType; case 'DictionaryAction': + return DictionaryAction.fromJson(value) as ReturnType; case 'DictionaryEntry': return DictionaryEntry.fromJson(value as Map) as ReturnType; case 'DictionaryEntryState': + return DictionaryEntryState.fromJson(value) as ReturnType; case 'DictionaryLanguage': return DictionaryLanguage.fromJson(value as Map) as ReturnType; @@ -236,12 +271,15 @@ ReturnType deserialize(dynamic value, String targetType, return DictionarySettingsParams.fromJson(value as Map) as ReturnType; case 'DictionaryType': + return DictionaryType.fromJson(value) as ReturnType; case 'Edit': return Edit.fromJson(value as Map) as ReturnType; case 'EditType': + return EditType.fromJson(value) as ReturnType; case 'ErrorBase': return ErrorBase.fromJson(value as Map) as ReturnType; case 'ExactOnSingleWordQuery': + return ExactOnSingleWordQuery.fromJson(value) as ReturnType; case 'FacetHits': return FacetHits.fromJson(value as Map) as ReturnType; case 'FacetOrdering': @@ -313,11 +351,14 @@ ReturnType deserialize(dynamic value, String targetType, case 'LogQuery': return LogQuery.fromJson(value as Map) as ReturnType; case 'LogType': + return LogType.fromJson(value) as ReturnType; case 'MatchLevel': + return MatchLevel.fromJson(value) as ReturnType; case 'MatchedGeoLocation': return MatchedGeoLocation.fromJson(value as Map) as ReturnType; case 'Mode': + return Mode.fromJson(value) as ReturnType; case 'MultipleBatchRequest': return MultipleBatchRequest.fromJson(value as Map) as ReturnType; @@ -328,6 +369,7 @@ ReturnType deserialize(dynamic value, String targetType, return OperationIndexParams.fromJson(value as Map) as ReturnType; case 'OperationType': + return OperationType.fromJson(value) as ReturnType; case 'Params': return Params.fromJson(value as Map) as ReturnType; case 'Personalization': @@ -340,6 +382,7 @@ ReturnType deserialize(dynamic value, String targetType, return PromoteObjectIDs.fromJson(value as Map) as ReturnType; case 'QueryType': + return QueryType.fromJson(value) as ReturnType; case 'RankingInfo': return RankingInfo.fromJson(value as Map) as ReturnType; case 'RedirectRuleIndexMetadata': @@ -352,6 +395,7 @@ ReturnType deserialize(dynamic value, String targetType, return RemoveUserIdResponse.fromJson(value as Map) as ReturnType; case 'RemoveWordsIfNoResults': + return RemoveWordsIfNoResults.fromJson(value) as ReturnType; case 'RenderingContent': return RenderingContent.fromJson(value as Map) as ReturnType; @@ -367,6 +411,7 @@ ReturnType deserialize(dynamic value, String targetType, return SaveSynonymResponse.fromJson(value as Map) as ReturnType; case 'ScopeType': + return ScopeType.fromJson(value) as ReturnType; case 'SearchDictionaryEntriesParams': return SearchDictionaryEntriesParams.fromJson( value as Map) as ReturnType; @@ -415,6 +460,7 @@ ReturnType deserialize(dynamic value, String targetType, return SearchRulesResponse.fromJson(value as Map) as ReturnType; case 'SearchStrategy': + return SearchStrategy.fromJson(value) as ReturnType; case 'SearchSynonymsParams': return SearchSynonymsParams.fromJson(value as Map) as ReturnType; @@ -422,7 +468,9 @@ ReturnType deserialize(dynamic value, String targetType, return SearchSynonymsResponse.fromJson(value as Map) as ReturnType; case 'SearchTypeDefault': + return SearchTypeDefault.fromJson(value) as ReturnType; case 'SearchTypeFacet': + return SearchTypeFacet.fromJson(value) as ReturnType; case 'SearchUserIdsParams': return SearchUserIdsParams.fromJson(value as Map) as ReturnType; @@ -433,6 +481,7 @@ ReturnType deserialize(dynamic value, String targetType, return SnippetResultOption.fromJson(value as Map) as ReturnType; case 'SortRemainingBy': + return SortRemainingBy.fromJson(value) as ReturnType; case 'Source': return Source.fromJson(value as Map) as ReturnType; case 'StandardEntries': @@ -441,10 +490,13 @@ ReturnType deserialize(dynamic value, String targetType, case 'SynonymHit': return SynonymHit.fromJson(value as Map) as ReturnType; case 'SynonymType': + return SynonymType.fromJson(value) as ReturnType; case 'TaskStatus': + return TaskStatus.fromJson(value) as ReturnType; case 'TimeRange': return TimeRange.fromJson(value as Map) as ReturnType; case 'TypoToleranceEnum': + return TypoToleranceEnum.fromJson(value) as ReturnType; case 'UpdateApiKeyResponse': return UpdateApiKeyResponse.fromJson(value as Map) as ReturnType; diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/acl.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/acl.dart index 0a835e3a71..34acb23f78 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/acl.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/acl.dart @@ -52,6 +52,13 @@ enum Acl { dynamic toJson() => raw; + static Acl fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/action.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/action.dart index f446316f46..fef51d0ee2 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/action.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/action.dart @@ -31,6 +31,13 @@ enum Action { dynamic toJson() => raw; + static Action fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/advanced_syntax_features.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/advanced_syntax_features.dart index df2eb29ed0..b63f46b55a 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/advanced_syntax_features.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/advanced_syntax_features.dart @@ -12,6 +12,13 @@ enum AdvancedSyntaxFeatures { dynamic toJson() => raw; + static AdvancedSyntaxFeatures fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/alternatives_as_exact.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/alternatives_as_exact.dart index 28ff5e8ec5..58dea73f89 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/alternatives_as_exact.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/alternatives_as_exact.dart @@ -13,6 +13,13 @@ enum AlternativesAsExact { dynamic toJson() => raw; + static AlternativesAsExact fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/anchoring.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/anchoring.dart index c67999e8cf..c5f1439dde 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/anchoring.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/anchoring.dart @@ -22,6 +22,13 @@ enum Anchoring { dynamic toJson() => raw; + static Anchoring fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/around_radius_all.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/around_radius_all.dart index 74c5a5a50d..907fb416e0 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/around_radius_all.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/around_radius_all.dart @@ -11,6 +11,13 @@ enum AroundRadiusAll { dynamic toJson() => raw; + static AroundRadiusAll fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_search_params.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_search_params.dart index a9e8a470e1..5f3cf2602a 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_search_params.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_search_params.dart @@ -57,15 +57,31 @@ final class BaseSearchParams { @JsonKey(name: r'filters') final String? filters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'facetFilters') final dynamic facetFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'optionalFilters') final dynamic optionalFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'numericFilters') final dynamic numericFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'tagFilters') final dynamic tagFilters; @@ -111,6 +127,9 @@ final class BaseSearchParams { @JsonKey(name: r'aroundLatLngViaIP') final bool? aroundLatLngViaIP; + /// One of types: + /// - [AroundRadiusAll] + /// - [int] @JsonKey(name: r'aroundRadius') final dynamic aroundRadius; @@ -175,6 +194,10 @@ final class BaseSearchParams { @JsonKey(name: r'enableReRanking') final bool? enableReRanking; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'reRankingApplyFilter') final dynamic reRankingApplyFilter; diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_search_params_without_query.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_search_params_without_query.dart index 612ed9fdaf..4dc6cebbfb 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_search_params_without_query.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/base_search_params_without_query.dart @@ -52,15 +52,31 @@ final class BaseSearchParamsWithoutQuery { @JsonKey(name: r'filters') final String? filters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'facetFilters') final dynamic facetFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'optionalFilters') final dynamic optionalFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'numericFilters') final dynamic numericFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'tagFilters') final dynamic tagFilters; @@ -106,6 +122,9 @@ final class BaseSearchParamsWithoutQuery { @JsonKey(name: r'aroundLatLngViaIP') final bool? aroundLatLngViaIP; + /// One of types: + /// - [AroundRadiusAll] + /// - [int] @JsonKey(name: r'aroundRadius') final dynamic aroundRadius; @@ -170,6 +189,10 @@ final class BaseSearchParamsWithoutQuery { @JsonKey(name: r'enableReRanking') final bool? enableReRanking; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'reRankingApplyFilter') final dynamic reRankingApplyFilter; diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/browse_params_object.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/browse_params_object.dart index 74f56b3d73..e9bfa7987a 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/browse_params_object.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/browse_params_object.dart @@ -111,15 +111,31 @@ final class BrowseParamsObject { @JsonKey(name: r'filters') final String? filters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'facetFilters') final dynamic facetFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'optionalFilters') final dynamic optionalFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'numericFilters') final dynamic numericFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'tagFilters') final dynamic tagFilters; @@ -165,6 +181,9 @@ final class BrowseParamsObject { @JsonKey(name: r'aroundLatLngViaIP') final bool? aroundLatLngViaIP; + /// One of types: + /// - [AroundRadiusAll] + /// - [int] @JsonKey(name: r'aroundRadius') final dynamic aroundRadius; @@ -229,6 +248,10 @@ final class BrowseParamsObject { @JsonKey(name: r'enableReRanking') final bool? enableReRanking; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'reRankingApplyFilter') final dynamic reRankingApplyFilter; @@ -294,6 +317,9 @@ final class BrowseParamsObject { @JsonKey(name: r'minWordSizefor2Typos') final int? minWordSizefor2Typos; + /// One of types: + /// - [TypoToleranceEnum] + /// - [bool] @JsonKey(name: r'typoTolerance') final dynamic typoTolerance; @@ -305,9 +331,15 @@ final class BrowseParamsObject { @JsonKey(name: r'disableTypoToleranceOnAttributes') final List? disableTypoToleranceOnAttributes; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'ignorePlurals') final dynamic ignorePlurals; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'removeStopWords') final dynamic removeStopWords; @@ -370,6 +402,9 @@ final class BrowseParamsObject { @JsonKey(name: r'explain') final List? explain; + /// One of types: + /// - [bool] + /// - [int] @JsonKey(name: r'distinct') final dynamic distinct; diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/built_in_operation_type.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/built_in_operation_type.dart index fe019624be..36fc39d33b 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/built_in_operation_type.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/built_in_operation_type.dart @@ -31,6 +31,13 @@ enum BuiltInOperationType { dynamic toJson() => raw; + static BuiltInOperationType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/consequence.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/consequence.dart index bb55d8d7ea..e54e3d5704 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/consequence.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/consequence.dart @@ -22,6 +22,9 @@ final class Consequence { final ConsequenceParams? params; /// Records to promote. + /// One of types: + /// - [PromoteObjectIDs] + /// - [PromoteObjectID] @JsonKey(name: r'promote') final Iterable? promote; diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/consequence_params.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/consequence_params.dart index b762174c3f..c26ebaff46 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/consequence_params.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/consequence_params.dart @@ -108,15 +108,31 @@ final class ConsequenceParams { @JsonKey(name: r'filters') final String? filters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'facetFilters') final dynamic facetFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'optionalFilters') final dynamic optionalFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'numericFilters') final dynamic numericFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'tagFilters') final dynamic tagFilters; @@ -162,6 +178,9 @@ final class ConsequenceParams { @JsonKey(name: r'aroundLatLngViaIP') final bool? aroundLatLngViaIP; + /// One of types: + /// - [AroundRadiusAll] + /// - [int] @JsonKey(name: r'aroundRadius') final dynamic aroundRadius; @@ -226,6 +245,10 @@ final class ConsequenceParams { @JsonKey(name: r'enableReRanking') final bool? enableReRanking; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'reRankingApplyFilter') final dynamic reRankingApplyFilter; @@ -291,6 +314,9 @@ final class ConsequenceParams { @JsonKey(name: r'minWordSizefor2Typos') final int? minWordSizefor2Typos; + /// One of types: + /// - [TypoToleranceEnum] + /// - [bool] @JsonKey(name: r'typoTolerance') final dynamic typoTolerance; @@ -302,9 +328,15 @@ final class ConsequenceParams { @JsonKey(name: r'disableTypoToleranceOnAttributes') final List? disableTypoToleranceOnAttributes; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'ignorePlurals') final dynamic ignorePlurals; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'removeStopWords') final dynamic removeStopWords; @@ -367,6 +399,9 @@ final class ConsequenceParams { @JsonKey(name: r'explain') final List? explain; + /// One of types: + /// - [bool] + /// - [int] @JsonKey(name: r'distinct') final dynamic distinct; @@ -404,12 +439,21 @@ final class ConsequenceParams { @JsonKey(name: r'renderingContent') final RenderingContent? renderingContent; + /// One of types: + /// - [ConsequenceQueryObject] + /// - [String] @JsonKey(name: r'query') final dynamic query; + /// One of types: + /// - [List] + /// - [List] @JsonKey(name: r'automaticFacetFilters') final dynamic automaticFacetFilters; + /// One of types: + /// - [List] + /// - [List] @JsonKey(name: r'automaticOptionalFacetFilters') final dynamic automaticOptionalFacetFilters; diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/delete_by_params.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/delete_by_params.dart index 2f40f081c8..9d2af14848 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/delete_by_params.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/delete_by_params.dart @@ -19,6 +19,10 @@ final class DeleteByParams { this.insidePolygon, }); + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'facetFilters') final dynamic facetFilters; @@ -26,9 +30,17 @@ final class DeleteByParams { @JsonKey(name: r'filters') final String? filters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'numericFilters') final dynamic numericFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'tagFilters') final dynamic tagFilters; @@ -36,6 +48,9 @@ final class DeleteByParams { @JsonKey(name: r'aroundLatLng') final String? aroundLatLng; + /// One of types: + /// - [AroundRadiusAll] + /// - [int] @JsonKey(name: r'aroundRadius') final dynamic aroundRadius; diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/dictionary_action.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/dictionary_action.dart index 48205d255d..ccf6e4b059 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/dictionary_action.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/dictionary_action.dart @@ -16,6 +16,13 @@ enum DictionaryAction { dynamic toJson() => raw; + static DictionaryAction fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/dictionary_entry_state.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/dictionary_entry_state.dart index fe148b15cb..20d1e7618e 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/dictionary_entry_state.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/dictionary_entry_state.dart @@ -16,6 +16,13 @@ enum DictionaryEntryState { dynamic toJson() => raw; + static DictionaryEntryState fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/dictionary_type.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/dictionary_type.dart index 3afa64f914..3deb1d164b 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/dictionary_type.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/dictionary_type.dart @@ -13,6 +13,13 @@ enum DictionaryType { dynamic toJson() => raw; + static DictionaryType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/edit_type.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/edit_type.dart index 61d665682e..c92cf5fe56 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/edit_type.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/edit_type.dart @@ -16,6 +16,13 @@ enum EditType { dynamic toJson() => raw; + static EditType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/exact_on_single_word_query.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/exact_on_single_word_query.dart index 83d1728e31..022f5acb46 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/exact_on_single_word_query.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/exact_on_single_word_query.dart @@ -19,6 +19,13 @@ enum ExactOnSingleWordQuery { dynamic toJson() => raw; + static ExactOnSingleWordQuery fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/index_settings.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/index_settings.dart index f2b3054608..0032bcaa68 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/index_settings.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/index_settings.dart @@ -201,6 +201,9 @@ final class IndexSettings { @JsonKey(name: r'minWordSizefor2Typos') final int? minWordSizefor2Typos; + /// One of types: + /// - [TypoToleranceEnum] + /// - [bool] @JsonKey(name: r'typoTolerance') final dynamic typoTolerance; @@ -212,9 +215,15 @@ final class IndexSettings { @JsonKey(name: r'disableTypoToleranceOnAttributes') final List? disableTypoToleranceOnAttributes; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'ignorePlurals') final dynamic ignorePlurals; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'removeStopWords') final dynamic removeStopWords; @@ -277,6 +286,9 @@ final class IndexSettings { @JsonKey(name: r'explain') final List? explain; + /// One of types: + /// - [bool] + /// - [int] @JsonKey(name: r'distinct') final dynamic distinct; diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/index_settings_as_search_params.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/index_settings_as_search_params.dart index 22383396cc..6ebf6fb1ca 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/index_settings_as_search_params.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/index_settings_as_search_params.dart @@ -126,6 +126,9 @@ final class IndexSettingsAsSearchParams { @JsonKey(name: r'minWordSizefor2Typos') final int? minWordSizefor2Typos; + /// One of types: + /// - [TypoToleranceEnum] + /// - [bool] @JsonKey(name: r'typoTolerance') final dynamic typoTolerance; @@ -137,9 +140,15 @@ final class IndexSettingsAsSearchParams { @JsonKey(name: r'disableTypoToleranceOnAttributes') final List? disableTypoToleranceOnAttributes; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'ignorePlurals') final dynamic ignorePlurals; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'removeStopWords') final dynamic removeStopWords; @@ -202,6 +211,9 @@ final class IndexSettingsAsSearchParams { @JsonKey(name: r'explain') final List? explain; + /// One of types: + /// - [bool] + /// - [int] @JsonKey(name: r'distinct') final dynamic distinct; diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/log_type.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/log_type.dart index 0fe076e62a..849f2b6f29 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/log_type.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/log_type.dart @@ -14,6 +14,13 @@ enum LogType { dynamic toJson() => raw; + static LogType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/match_level.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/match_level.dart index d1deaa4808..efdd963b5f 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/match_level.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/match_level.dart @@ -19,6 +19,13 @@ enum MatchLevel { dynamic toJson() => raw; + static MatchLevel fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/mode.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/mode.dart index 0bfd425a4e..44ac83d064 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/mode.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/mode.dart @@ -16,6 +16,13 @@ enum Mode { dynamic toJson() => raw; + static Mode fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/operation_type.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/operation_type.dart index 08e9d8f2ef..4a89b450ad 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/operation_type.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/operation_type.dart @@ -16,6 +16,13 @@ enum OperationType { dynamic toJson() => raw; + static OperationType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/params.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/params.dart index 57260f2c33..eeb2f068d0 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/params.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/params.dart @@ -16,12 +16,21 @@ final class Params { this.renderingContent, }); + /// One of types: + /// - [ConsequenceQueryObject] + /// - [String] @JsonKey(name: r'query') final dynamic query; + /// One of types: + /// - [List] + /// - [List] @JsonKey(name: r'automaticFacetFilters') final dynamic automaticFacetFilters; + /// One of types: + /// - [List] + /// - [List] @JsonKey(name: r'automaticOptionalFacetFilters') final dynamic automaticOptionalFacetFilters; diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/query_type.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/query_type.dart index 1145093609..ef7b47d661 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/query_type.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/query_type.dart @@ -19,6 +19,13 @@ enum QueryType { dynamic toJson() => raw; + static QueryType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/remove_words_if_no_results.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/remove_words_if_no_results.dart index 9915dbbb26..051a2fca14 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/remove_words_if_no_results.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/remove_words_if_no_results.dart @@ -22,6 +22,13 @@ enum RemoveWordsIfNoResults { dynamic toJson() => raw; + static RemoveWordsIfNoResults fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/scope_type.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/scope_type.dart index 2902e67096..4c9d9c58a3 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/scope_type.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/scope_type.dart @@ -13,6 +13,13 @@ enum ScopeType { dynamic toJson() => raw; + static ScopeType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_for_facets.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_for_facets.dart index 4a2e44c7a7..43f1531f02 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_for_facets.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_for_facets.dart @@ -120,15 +120,31 @@ final class SearchForFacets { @JsonKey(name: r'filters') final String? filters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'facetFilters') final dynamic facetFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'optionalFilters') final dynamic optionalFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'numericFilters') final dynamic numericFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'tagFilters') final dynamic tagFilters; @@ -174,6 +190,9 @@ final class SearchForFacets { @JsonKey(name: r'aroundLatLngViaIP') final bool? aroundLatLngViaIP; + /// One of types: + /// - [AroundRadiusAll] + /// - [int] @JsonKey(name: r'aroundRadius') final dynamic aroundRadius; @@ -238,6 +257,10 @@ final class SearchForFacets { @JsonKey(name: r'enableReRanking') final bool? enableReRanking; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'reRankingApplyFilter') final dynamic reRankingApplyFilter; @@ -303,6 +326,9 @@ final class SearchForFacets { @JsonKey(name: r'minWordSizefor2Typos') final int? minWordSizefor2Typos; + /// One of types: + /// - [TypoToleranceEnum] + /// - [bool] @JsonKey(name: r'typoTolerance') final dynamic typoTolerance; @@ -314,9 +340,15 @@ final class SearchForFacets { @JsonKey(name: r'disableTypoToleranceOnAttributes') final List? disableTypoToleranceOnAttributes; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'ignorePlurals') final dynamic ignorePlurals; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'removeStopWords') final dynamic removeStopWords; @@ -379,6 +411,9 @@ final class SearchForFacets { @JsonKey(name: r'explain') final List? explain; + /// One of types: + /// - [bool] + /// - [int] @JsonKey(name: r'distinct') final dynamic distinct; diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_for_hits.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_for_hits.dart index 14939b58d2..c02e3f8c44 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_for_hits.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_for_hits.dart @@ -118,15 +118,31 @@ final class SearchForHits { @JsonKey(name: r'filters') final String? filters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'facetFilters') final dynamic facetFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'optionalFilters') final dynamic optionalFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'numericFilters') final dynamic numericFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'tagFilters') final dynamic tagFilters; @@ -172,6 +188,9 @@ final class SearchForHits { @JsonKey(name: r'aroundLatLngViaIP') final bool? aroundLatLngViaIP; + /// One of types: + /// - [AroundRadiusAll] + /// - [int] @JsonKey(name: r'aroundRadius') final dynamic aroundRadius; @@ -236,6 +255,10 @@ final class SearchForHits { @JsonKey(name: r'enableReRanking') final bool? enableReRanking; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'reRankingApplyFilter') final dynamic reRankingApplyFilter; @@ -301,6 +324,9 @@ final class SearchForHits { @JsonKey(name: r'minWordSizefor2Typos') final int? minWordSizefor2Typos; + /// One of types: + /// - [TypoToleranceEnum] + /// - [bool] @JsonKey(name: r'typoTolerance') final dynamic typoTolerance; @@ -312,9 +338,15 @@ final class SearchForHits { @JsonKey(name: r'disableTypoToleranceOnAttributes') final List? disableTypoToleranceOnAttributes; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'ignorePlurals') final dynamic ignorePlurals; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'removeStopWords') final dynamic removeStopWords; @@ -377,6 +409,9 @@ final class SearchForHits { @JsonKey(name: r'explain') final List? explain; + /// One of types: + /// - [bool] + /// - [int] @JsonKey(name: r'distinct') final dynamic distinct; diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_method_params.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_method_params.dart index feb8865572..c1fe79f431 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_method_params.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_method_params.dart @@ -14,6 +14,9 @@ final class SearchMethodParams { this.strategy, }); + /// One of types: + /// - [SearchForHits] + /// - [SearchForFacets] @JsonKey(name: r'requests') final Iterable requests; diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_params_object.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_params_object.dart index 33ea1112c1..b5022143bd 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_params_object.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_params_object.dart @@ -110,15 +110,31 @@ final class SearchParamsObject { @JsonKey(name: r'filters') final String? filters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'facetFilters') final dynamic facetFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'optionalFilters') final dynamic optionalFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'numericFilters') final dynamic numericFilters; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'tagFilters') final dynamic tagFilters; @@ -164,6 +180,9 @@ final class SearchParamsObject { @JsonKey(name: r'aroundLatLngViaIP') final bool? aroundLatLngViaIP; + /// One of types: + /// - [AroundRadiusAll] + /// - [int] @JsonKey(name: r'aroundRadius') final dynamic aroundRadius; @@ -228,6 +247,10 @@ final class SearchParamsObject { @JsonKey(name: r'enableReRanking') final bool? enableReRanking; + /// One of types: + /// - [List>] + /// - [String] + /// - [List] @JsonKey(name: r'reRankingApplyFilter') final dynamic reRankingApplyFilter; @@ -293,6 +316,9 @@ final class SearchParamsObject { @JsonKey(name: r'minWordSizefor2Typos') final int? minWordSizefor2Typos; + /// One of types: + /// - [TypoToleranceEnum] + /// - [bool] @JsonKey(name: r'typoTolerance') final dynamic typoTolerance; @@ -304,9 +330,15 @@ final class SearchParamsObject { @JsonKey(name: r'disableTypoToleranceOnAttributes') final List? disableTypoToleranceOnAttributes; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'ignorePlurals') final dynamic ignorePlurals; + /// One of types: + /// - [bool] + /// - [List] @JsonKey(name: r'removeStopWords') final dynamic removeStopWords; @@ -369,6 +401,9 @@ final class SearchParamsObject { @JsonKey(name: r'explain') final List? explain; + /// One of types: + /// - [bool] + /// - [int] @JsonKey(name: r'distinct') final dynamic distinct; diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_responses.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_responses.dart index 12b5994e6c..9638e21e86 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_responses.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_responses.dart @@ -12,6 +12,9 @@ final class SearchResponses { required this.results, }); + /// One of types: + /// - [SearchForFacetValuesResponse] + /// - [SearchResponse] @JsonKey(name: r'results') final Iterable results; diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_strategy.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_strategy.dart index 50ad0fbbf1..6bafacdd93 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_strategy.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_strategy.dart @@ -16,6 +16,13 @@ enum SearchStrategy { dynamic toJson() => raw; + static SearchStrategy fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_type_default.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_type_default.dart index e74994edc3..a7eb383de5 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_type_default.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_type_default.dart @@ -13,6 +13,13 @@ enum SearchTypeDefault { dynamic toJson() => raw; + static SearchTypeDefault fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_type_facet.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_type_facet.dart index 0048e0d8f8..8407b4a17e 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_type_facet.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/search_type_facet.dart @@ -13,6 +13,13 @@ enum SearchTypeFacet { dynamic toJson() => raw; + static SearchTypeFacet fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/sort_remaining_by.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/sort_remaining_by.dart index 731ec8f1ca..6382bc44ee 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/sort_remaining_by.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/sort_remaining_by.dart @@ -19,6 +19,13 @@ enum SortRemainingBy { dynamic toJson() => raw; + static SortRemainingBy fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/synonym_type.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/synonym_type.dart index b34a5261ce..b66086f7f7 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/synonym_type.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/synonym_type.dart @@ -25,6 +25,13 @@ enum SynonymType { dynamic toJson() => raw; + static SynonymType fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/task_status.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/task_status.dart index 1e4ad50425..606cb52ec3 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/task_status.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/task_status.dart @@ -16,6 +16,13 @@ enum TaskStatus { dynamic toJson() => raw; + static TaskStatus fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/typo_tolerance_enum.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/typo_tolerance_enum.dart index 712f24e662..b5ec1a7893 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/typo_tolerance_enum.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/typo_tolerance_enum.dart @@ -12,6 +12,13 @@ enum TypoToleranceEnum { dynamic toJson() => raw; + static TypoToleranceEnum fromJson(dynamic json) { + for (final value in values) { + if (value.raw == json) return value; + } + throw ArgumentError.value(json, "raw", "No enum value with that value"); + } + @override String toString() => raw.toString(); } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/user_highlight_result.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/user_highlight_result.dart index 4f3d5f808e..f7065cb43f 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/user_highlight_result.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/user_highlight_result.dart @@ -14,10 +14,16 @@ final class UserHighlightResult { }); /// Show highlighted section and words matched on a query. + /// One of types: + /// - [List] + /// - [HighlightResultOption] @JsonKey(name: r'userID') final Map userID; /// Show highlighted section and words matched on a query. + /// One of types: + /// - [List] + /// - [HighlightResultOption] @JsonKey(name: r'clusterName') final Map clusterName; diff --git a/clients/algoliasearch-client-dart/packages/client_search/pubspec.yaml b/clients/algoliasearch-client-dart/packages/client_search/pubspec.yaml index f3dce9c56f..889812f588 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/pubspec.yaml +++ b/clients/algoliasearch-client-dart/packages/client_search/pubspec.yaml @@ -12,7 +12,7 @@ environment: dependencies: # Pinning versions until the API stabilizes. - algolia_client_core: 0.1.1+1 + algolia_client_core: 0.1.1+4 json_annotation: ^4.8.1 collection: ^1.17.1