From a5bf6232c4e90db2995c96d5c7672b9de181ca4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vannicatte?= Date: Wed, 2 Aug 2023 10:39:59 +0200 Subject: [PATCH] feat(specs): delete Predict (#1860) --- .codesandbox/ci.json | 1 - .redocly.yaml | 2 - .../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 -- .../client_predict/lib/src/extension.dart | 1 - .../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 - .../algolia/predict/api_predict.go | 3166 ----------------- .../algolia/predict/client.go | 352 -- .../algolia/predict/configuration.go | 50 - .../model_activate_model_instance_response.go | 136 - .../predict/model_activate_model_params.go | 245 -- .../algolia/predict/model_affinity.go | 164 - .../algolia/predict/model_all_params.go | 165 - .../model_all_update_segment_params.go | 166 - .../predict/model_compatible_sources.go | 99 - .../predict/model_create_segment_params.go | 135 - .../predict/model_create_segment_response.go | 185 - .../model_delete_model_instance_response.go | 136 - .../predict/model_delete_segment_response.go | 136 - .../model_delete_user_profile_response.go | 136 - .../algolia/predict/model_error.go | 104 - .../algolia/predict/model_error_base.go | 150 - .../model_fetch_all_user_profiles_params.go | 212 -- .../model_fetch_all_user_profiles_response.go | 197 - .../algolia/predict/model_funnel_stage.go | 134 - ...et_available_model_types_response_inner.go | 196 - ..._types_response_inner_data_requirements.go | 136 - .../model_get_model_instance_config_status.go | 105 - .../model_get_model_metrics_response.go | 135 - .../model_get_segment_users_response.go | 228 -- .../algolia/predict/model_limit_param.go | 122 - .../algolia/predict/model_model_attributes.go | 152 - .../algolia/predict/model_model_instance.go | 409 --- .../algolia/predict/model_model_metrics.go | 338 -- .../algolia/predict/model_model_status.go | 101 - .../predict/model_models_to_retrieve.go | 103 - .../predict/model_models_to_retrieve_param.go | 122 - .../predict/model_next_page_token_param.go | 123 - .../algolia/predict/model_params.go | 154 - .../model_prediction_affinity_value.go | 154 - .../algolia/predict/model_predictions.go | 208 -- .../predict/model_predictions_affinities.go | 125 - .../model_predictions_affinities_success.go | 134 - .../predict/model_predictions_funnel_stage.go | 125 - .../model_predictions_funnel_stage_success.go | 134 - .../predict/model_predictions_order_value.go | 125 - .../model_predictions_order_value_success.go | 134 - .../model_previous_page_token_param.go | 123 - .../algolia/predict/model_properties.go | 211 -- .../algolia/predict/model_segment.go | 336 -- .../predict/model_segment_affinity_filter.go | 184 - .../model_segment_affinity_filter_value.go | 183 - .../model_segment_child_condition_operands.go | 183 - .../predict/model_segment_child_conditions.go | 134 - .../model_segment_condition_operator.go | 101 - .../predict/model_segment_conditions_param.go | 122 - .../model_segment_filter_operator_boolean.go | 101 - ...model_segment_filter_operator_numerical.go | 109 - .../model_segment_filter_probability.go | 251 -- .../model_segment_funnel_stage_filter.go | 184 - .../predict/model_segment_name_param.go | 123 - .../predict/model_segment_operand_affinity.go | 134 - .../model_segment_operand_funnel_stage.go | 134 - .../model_segment_operand_order_value.go | 134 - .../predict/model_segment_operand_property.go | 134 - .../model_segment_order_value_filter.go | 154 - ...model_segment_parent_condition_operands.go | 212 -- .../model_segment_parent_conditions.go | 134 - .../predict/model_segment_property_filter.go | 154 - .../model_segment_property_filter_value.go | 74 - .../algolia/predict/model_segment_status.go | 103 - .../algolia/predict/model_segment_type.go | 101 - .../algolia/predict/model_segments.go | 136 - .../predict/model_types_to_retrieve.go | 101 - .../predict/model_types_to_retrieve_param.go | 122 - .../model_update_model_instance_response.go | 136 - .../predict/model_update_model_params.go | 209 -- .../predict/model_update_segment_params.go | 154 - .../predict/model_update_segment_response.go | 185 - .../algolia/predict/model_user_profile.go | 238 -- .../algolia/predict/response.go | 47 - .../algolia/predict/utils.go | 344 -- .../bundlesize.config.json | 4 - .../packages/predict/builds/browser.ts | 71 - .../packages/predict/builds/node.ts | 60 - .../packages/predict/index.d.ts | 2 - .../packages/predict/index.js | 2 - .../model/activateModelInstanceResponse.ts | 13 - .../predict/model/activateModelParams.ts | 24 - .../packages/predict/model/affinity.ts | 11 - .../packages/predict/model/allParams.ts | 6 - .../predict/model/allUpdateSegmentParams.ts | 6 - .../predict/model/clientMethodProps.ts | 185 - .../predict/model/compatibleSources.ts | 3 - .../predict/model/createSegmentParams.ts | 12 - .../predict/model/createSegmentResponse.ts | 18 - .../model/deleteModelInstanceResponse.ts | 13 - .../predict/model/deleteSegmentResponse.ts | 13 - .../model/deleteUserProfileResponse.ts | 13 - .../packages/predict/model/errorBase.ts | 8 - .../model/fetchAllUserProfilesParams.ts | 14 - .../model/fetchAllUserProfilesResponse.ts | 17 - .../packages/predict/model/funnelStage.ts | 7 - .../getAvailableModelTypesResponseInner.ts | 20 - ...ModelTypesResponseInnerDataRequirements.ts | 13 - .../model/getModelInstanceConfigStatus.ts | 10 - .../predict/model/getModelMetricsResponse.ts | 12 - .../predict/model/getSegmentUsersResponse.ts | 22 - .../packages/predict/model/index.ts | 74 - .../packages/predict/model/limitParam.ts | 5 - .../packages/predict/model/modelAttributes.ts | 7 - .../packages/predict/model/modelError.ts | 8 - .../packages/predict/model/modelInstance.ts | 39 - .../packages/predict/model/modelMetrics.ts | 18 - .../packages/predict/model/modelStatus.ts | 6 - .../predict/model/modelsToRetrieve.ts | 3 - .../predict/model/modelsToRetrieveParam.ts | 7 - .../predict/model/nextPageTokenParam.ts | 8 - .../packages/predict/model/params.ts | 7 - .../predict/model/predictionAffinityValue.ts | 3 - .../packages/predict/model/predictions.ts | 13 - .../predict/model/predictionsAffinities.ts | 6 - .../model/predictionsAffinitiesSuccess.ts | 12 - .../predict/model/predictionsFunnelStage.ts | 6 - .../model/predictionsFunnelStageSuccess.ts | 12 - .../predict/model/predictionsOrderValue.ts | 6 - .../model/predictionsOrderValueSuccess.ts | 10 - .../predict/model/previousPageTokenParam.ts | 8 - .../packages/predict/model/properties.ts | 21 - .../packages/predict/model/segment.ts | 35 - .../predict/model/segmentAffinityFilter.ts | 16 - .../model/segmentAffinityFilterValue.ts | 3 - .../model/segmentChildConditionOperands.ts | 12 - .../predict/model/segmentChildConditions.ts | 13 - .../predict/model/segmentConditionOperator.ts | 6 - .../predict/model/segmentConditionsParam.ts | 7 - .../model/segmentFilterOperatorBoolean.ts | 6 - .../model/segmentFilterOperatorNumerical.ts | 12 - .../predict/model/segmentFilterProbability.ts | 14 - .../predict/model/segmentFunnelStageFilter.ts | 15 - .../predict/model/segmentNameParam.ts | 8 - .../predict/model/segmentOperandAffinity.ts | 12 - .../model/segmentOperandFunnelStage.ts | 12 - .../predict/model/segmentOperandOrderValue.ts | 12 - .../predict/model/segmentOperandProperty.ts | 12 - .../predict/model/segmentOrderValueFilter.ts | 12 - .../model/segmentParentConditionOperands.ts | 14 - .../predict/model/segmentParentConditions.ts | 13 - .../predict/model/segmentPropertyFilter.ts | 13 - .../model/segmentPropertyFilterValue.ts | 5 - .../packages/predict/model/segmentStatus.ts | 6 - .../packages/predict/model/segmentType.ts | 6 - .../packages/predict/model/segments.ts | 16 - .../packages/predict/model/typesToRetrieve.ts | 3 - .../predict/model/typesToRetrieveParam.ts | 7 - .../model/updateModelInstanceResponse.ts | 13 - .../predict/model/updateModelParams.ts | 14 - .../predict/model/updateSegmentParams.ts | 10 - .../predict/model/updateSegmentResponse.ts | 18 - .../packages/predict/model/userProfile.ts | 15 - .../packages/predict/package.json | 54 - .../packages/predict/rollup.config.js | 5 - .../packages/predict/src/predictClient.ts | 846 ----- .../packages/predict/tsconfig.json | 8 - .../com/algolia/client/api/PredictClient.kt | 416 --- .../predict/ActivateModelInstanceResponse.kt | 21 - .../model/predict/ActivateModelParams.kt | 31 - .../algolia/client/model/predict/Affinity.kt | 22 - .../algolia/client/model/predict/AllParams.kt | 19 - .../model/predict/AllUpdateSegmentParams.kt | 20 - .../client/model/predict/CompatibleSources.kt | 13 - .../model/predict/CreateSegmentParams.kt | 20 - .../model/predict/CreateSegmentResponse.kt | 25 - .../predict/DeleteModelInstanceResponse.kt | 21 - .../model/predict/DeleteSegmentResponse.kt | 21 - .../predict/DeleteUserProfileResponse.kt | 21 - .../com/algolia/client/model/predict/Error.kt | 16 - .../algolia/client/model/predict/ErrorBase.kt | 46 - .../predict/FetchAllUserProfilesParams.kt | 147 - .../predict/FetchAllUserProfilesResponse.kt | 24 - .../client/model/predict/FunnelStage.kt | 19 - .../GetAvailableModelTypesResponseInner.kt | 27 - ...ModelTypesResponseInnerDataRequirements.kt | 21 - .../predict/GetModelInstanceConfigStatus.kt | 25 - .../model/predict/GetModelMetricsResponse.kt | 20 - .../model/predict/GetSegmentUsersResponse.kt | 28 - .../client/model/predict/LimitParam.kt | 16 - .../client/model/predict/ModelAttributes.kt | 19 - .../client/model/predict/ModelInstance.kt | 47 - .../client/model/predict/ModelMetrics.kt | 32 - .../client/model/predict/ModelStatus.kt | 19 - .../client/model/predict/ModelsToRetrieve.kt | 19 - .../model/predict/ModelsToRetrieveParam.kt | 16 - .../model/predict/NextPageTokenParam.kt | 17 - .../algolia/client/model/predict/Params.kt | 106 - .../model/predict/PredictionAffinityValue.kt | 106 - .../client/model/predict/Predictions.kt | 22 - .../model/predict/PredictionsAffinities.kt | 84 - .../predict/PredictionsAffinitiesSuccess.kt | 19 - .../model/predict/PredictionsFunnelStage.kt | 84 - .../predict/PredictionsFunnelStageSuccess.kt | 19 - .../model/predict/PredictionsOrderValue.kt | 84 - .../predict/PredictionsOrderValueSuccess.kt | 19 - .../model/predict/PreviousPageTokenParam.kt | 17 - .../client/model/predict/Properties.kt | 25 - .../algolia/client/model/predict/Segment.kt | 41 - .../model/predict/SegmentAffinityFilter.kt | 22 - .../predict/SegmentAffinityFilterValue.kt | 129 - .../predict/SegmentChildConditionOperands.kt | 137 - .../model/predict/SegmentChildConditions.kt | 19 - .../model/predict/SegmentConditionOperator.kt | 19 - .../model/predict/SegmentConditionsParam.kt | 16 - .../predict/SegmentFilterOperatorBoolean.kt | 19 - .../predict/SegmentFilterOperatorNumerical.kt | 31 - .../model/predict/SegmentFilterProbability.kt | 25 - .../model/predict/SegmentFunnelStageFilter.kt | 22 - .../client/model/predict/SegmentNameParam.kt | 17 - .../model/predict/SegmentOperandAffinity.kt | 19 - .../predict/SegmentOperandFunnelStage.kt | 19 - .../model/predict/SegmentOperandOrderValue.kt | 19 - .../model/predict/SegmentOperandProperty.kt | 19 - .../model/predict/SegmentOrderValueFilter.kt | 19 - .../predict/SegmentParentConditionOperands.kt | 162 - .../model/predict/SegmentParentConditions.kt | 19 - .../model/predict/SegmentPropertyFilter.kt | 19 - .../predict/SegmentPropertyFilterValue.kt | 7 - .../client/model/predict/SegmentStatus.kt | 22 - .../client/model/predict/SegmentType.kt | 19 - .../algolia/client/model/predict/Segments.kt | 21 - .../client/model/predict/TypesToRetrieve.kt | 16 - .../model/predict/TypesToRetrieveParam.kt | 16 - .../predict/UpdateModelInstanceResponse.kt | 21 - .../client/model/predict/UpdateModelParams.kt | 23 - .../model/predict/UpdateSegmentParams.kt | 106 - .../model/predict/UpdateSegmentResponse.kt | 25 - .../client/model/predict/UserProfile.kt | 25 - config/openapitools.json | 20 +- playground/go/main.go | 4 +- playground/go/predict.go | 27 - playground/javascript/node/package.json | 4 +- playground/javascript/node/predict.ts | 35 - .../kotlin/com/algolia/playground/Predict.kt | 54 - renovate.json | 1 - scripts/release/text.ts | 2 +- specs/bundled/ingestion.yml | 2 +- specs/bundled/predict.yml | 1557 -------- .../common/destinationParameters.yml | 2 +- .../ingestion/common/schemas/destination.yml | 2 +- specs/predict/common/parameters.yml | 30 - specs/predict/common/schemas/Params.yml | 75 - .../predict/common/schemas/SegmentsParams.yml | 37 - specs/predict/common/schemas/modelsParams.yml | 60 - .../paths/models/getAvailableModelTypes.yml | 53 - .../predict/paths/models/getModelMetrics.yml | 36 - specs/predict/paths/models/modelInstances.yml | 101 - specs/predict/paths/models/models.yml | 63 - specs/predict/paths/segments/allSegments.yml | 48 - specs/predict/paths/segments/segmentUsers.yml | 31 - .../predict/paths/segments/singleSegment.yml | 81 - specs/predict/paths/users/delete.yml | 38 - specs/predict/paths/users/fetch.yml | 32 - specs/predict/paths/users/fetchAll.yml | 43 - .../predict/responses/InvalidCredentials.yml | 5 - specs/predict/responses/ModelTypes.yml | 3 - specs/predict/responses/Models.yml | 85 - specs/predict/responses/Segment.yml | 358 -- specs/predict/responses/UserNotFound.yml | 5 - specs/predict/responses/UserProfile.yml | 149 - specs/predict/spec.yml | 87 - templates/kotlin/tests/client/suite.mustache | 3 +- .../kotlin/tests/requests/requests.mustache | 3 +- tests/CTS/client/predict/parameters.json | 51 - .../predict/activateModelInstance.json | 23 - .../requests/predict/createSegment.json | 95 - .../requests/predict/deleteModelInstance.json | 12 - .../requests/predict/deleteSegment.json | 12 - .../requests/predict/deleteUserProfile.json | 13 - .../requests/predict/fetchAllSegments.json | 36 - .../predict/fetchAllUserProfiles.json | 81 - .../requests/predict/fetchSegment.json | 12 - .../requests/predict/fetchUserProfile.json | 80 - .../predict/getAvailableModelTypes.json | 10 - .../predict/getModelInstanceConfig.json | 12 - .../requests/predict/getModelInstances.json | 10 - .../requests/predict/getModelMetrics.json | 12 - .../requests/predict/getSegmentUsers.json | 90 - .../requests/predict/updateModelInstance.json | 32 - .../requests/predict/updateSegment.json | 160 - tests/output/dart/pubspec_overrides.yaml | 2 - .../go/tests/methods/requests/predict_test.go | 1351 ------- .../java/com/algolia/client/Predict.test.java | 120 - .../methods/requests/Predict.test.java | 1392 -------- tests/output/javascript/package.json | 1 - .../javascript/src/client/predict.test.ts | 87 - .../src/methods/requests/predict.test.ts | 875 ----- .../kotlin/com/algolia/client/PredictTest.kt | 83 - .../extension/SegmentFilterProbability.kt | 16 - .../algolia/methods/requests/PredictTest.kt | 1118 ------ .../docs/contributing/CLI/specs-commands.md | 2 +- yarn.lock | 7 - 413 files changed, 10 insertions(+), 34672 deletions(-) delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/build.yaml delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/algolia_client_predict.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/api/predict_client.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/deserialize.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/extension.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_instance_response.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_instance_response.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_params.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_params.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/affinity.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/affinity.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_params.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_params.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_update_segment_params.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_update_segment_params.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/compatible_sources.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_params.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_params.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_response.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_response.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_model_instance_response.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_model_instance_response.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_segment_response.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_segment_response.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_user_profile_response.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_user_profile_response.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error_base.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error_base.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/fetch_all_user_profiles_response.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/fetch_all_user_profiles_response.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/funnel_stage.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/funnel_stage.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner_data_requirements.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner_data_requirements.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_model_instance_config_status.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_model_metrics_response.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_model_metrics_response.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_segment_users_response.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_segment_users_response.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/limit_param.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/limit_param.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_attributes.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_attributes.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_instance.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_instance.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_metrics.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_metrics.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_status.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/models_to_retrieve.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/models_to_retrieve_param.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/models_to_retrieve_param.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/next_page_token_param.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/next_page_token_param.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_affinities_success.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_affinities_success.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_funnel_stage_success.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_funnel_stage_success.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_order_value_success.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_order_value_success.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/previous_page_token_param.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/previous_page_token_param.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/properties.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/properties.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_affinity_filter.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_affinity_filter.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_child_conditions.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_child_conditions.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_condition_operator.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_conditions_param.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_conditions_param.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_operator_boolean.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_operator_numerical.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_probability.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_probability.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_funnel_stage_filter.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_funnel_stage_filter.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_name_param.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_name_param.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_affinity.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_affinity.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_funnel_stage.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_funnel_stage.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_order_value.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_order_value.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_property.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_property.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_order_value_filter.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_order_value_filter.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_parent_conditions.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_parent_conditions.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_property_filter.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_property_filter.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_status.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_type.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segments.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segments.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/types_to_retrieve.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/types_to_retrieve_param.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/types_to_retrieve_param.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_instance_response.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_instance_response.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_params.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_params.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_segment_response.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_segment_response.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/user_profile.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/user_profile.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/lib/src/version.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_predict/pubspec.yaml delete mode 100644 clients/algoliasearch-client-go/algolia/predict/api_predict.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/client.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/configuration.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_activate_model_instance_response.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_activate_model_params.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_affinity.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_all_params.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_all_update_segment_params.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_compatible_sources.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_create_segment_params.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_create_segment_response.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_delete_model_instance_response.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_delete_segment_response.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_delete_user_profile_response.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_error.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_error_base.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_fetch_all_user_profiles_params.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_fetch_all_user_profiles_response.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_funnel_stage.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_get_available_model_types_response_inner.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_get_available_model_types_response_inner_data_requirements.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_get_model_instance_config_status.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_get_model_metrics_response.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_get_segment_users_response.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_limit_param.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_model_attributes.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_model_instance.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_model_metrics.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_model_status.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_models_to_retrieve.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_models_to_retrieve_param.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_next_page_token_param.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_params.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_prediction_affinity_value.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_predictions.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_predictions_affinities.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_predictions_affinities_success.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_predictions_funnel_stage.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_predictions_funnel_stage_success.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_predictions_order_value.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_predictions_order_value_success.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_previous_page_token_param.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_properties.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_affinity_filter.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_affinity_filter_value.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_child_condition_operands.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_child_conditions.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_condition_operator.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_conditions_param.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_filter_operator_boolean.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_filter_operator_numerical.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_filter_probability.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_funnel_stage_filter.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_name_param.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_operand_affinity.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_operand_funnel_stage.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_operand_order_value.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_operand_property.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_order_value_filter.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_parent_condition_operands.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_parent_conditions.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_property_filter.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_property_filter_value.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_status.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segment_type.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_segments.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_types_to_retrieve.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_types_to_retrieve_param.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_update_model_instance_response.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_update_model_params.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_update_segment_params.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_update_segment_response.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/model_user_profile.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/response.go delete mode 100644 clients/algoliasearch-client-go/algolia/predict/utils.go delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/builds/browser.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/builds/node.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/index.d.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/index.js delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/activateModelInstanceResponse.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/activateModelParams.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/affinity.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/allParams.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/allUpdateSegmentParams.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/clientMethodProps.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/compatibleSources.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/createSegmentParams.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/createSegmentResponse.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/deleteModelInstanceResponse.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/deleteSegmentResponse.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/deleteUserProfileResponse.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/errorBase.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/fetchAllUserProfilesParams.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/fetchAllUserProfilesResponse.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/funnelStage.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/getAvailableModelTypesResponseInner.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/getAvailableModelTypesResponseInnerDataRequirements.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/getModelInstanceConfigStatus.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/getModelMetricsResponse.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/getSegmentUsersResponse.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/index.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/limitParam.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/modelAttributes.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/modelError.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/modelInstance.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/modelMetrics.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/modelStatus.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/modelsToRetrieve.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/modelsToRetrieveParam.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/nextPageTokenParam.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/params.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/predictionAffinityValue.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/predictions.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/predictionsAffinities.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/predictionsAffinitiesSuccess.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/predictionsFunnelStage.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/predictionsFunnelStageSuccess.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/predictionsOrderValue.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/predictionsOrderValueSuccess.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/previousPageTokenParam.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/properties.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segment.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentAffinityFilter.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentAffinityFilterValue.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentChildConditionOperands.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentChildConditions.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentConditionOperator.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentConditionsParam.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentFilterOperatorBoolean.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentFilterOperatorNumerical.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentFilterProbability.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentFunnelStageFilter.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentNameParam.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentOperandAffinity.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentOperandFunnelStage.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentOperandOrderValue.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentOperandProperty.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentOrderValueFilter.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentParentConditionOperands.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentParentConditions.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentPropertyFilter.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentPropertyFilterValue.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentStatus.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segmentType.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/segments.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/typesToRetrieve.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/typesToRetrieveParam.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/updateModelInstanceResponse.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/updateModelParams.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/updateSegmentParams.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/updateSegmentResponse.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/model/userProfile.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/package.json delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/rollup.config.js delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/src/predictClient.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/predict/tsconfig.json delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/PredictClient.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ActivateModelInstanceResponse.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ActivateModelParams.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Affinity.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/AllParams.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/AllUpdateSegmentParams.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/CompatibleSources.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/CreateSegmentParams.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/CreateSegmentResponse.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/DeleteModelInstanceResponse.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/DeleteSegmentResponse.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/DeleteUserProfileResponse.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Error.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ErrorBase.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/FetchAllUserProfilesParams.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/FetchAllUserProfilesResponse.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/FunnelStage.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/GetAvailableModelTypesResponseInner.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/GetAvailableModelTypesResponseInnerDataRequirements.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/GetModelInstanceConfigStatus.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/GetModelMetricsResponse.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/GetSegmentUsersResponse.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/LimitParam.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelAttributes.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelInstance.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelMetrics.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelStatus.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelsToRetrieve.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelsToRetrieveParam.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/NextPageTokenParam.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Params.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionAffinityValue.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Predictions.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsAffinities.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsAffinitiesSuccess.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsFunnelStage.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsFunnelStageSuccess.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsOrderValue.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsOrderValueSuccess.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PreviousPageTokenParam.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Properties.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Segment.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentAffinityFilter.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentAffinityFilterValue.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentChildConditionOperands.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentChildConditions.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentConditionOperator.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentConditionsParam.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentFilterOperatorBoolean.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentFilterOperatorNumerical.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentFilterProbability.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentFunnelStageFilter.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentNameParam.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentOperandAffinity.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentOperandFunnelStage.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentOperandOrderValue.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentOperandProperty.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentOrderValueFilter.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentParentConditionOperands.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentParentConditions.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentPropertyFilter.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentPropertyFilterValue.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentStatus.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentType.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Segments.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/TypesToRetrieve.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/TypesToRetrieveParam.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/UpdateModelInstanceResponse.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/UpdateModelParams.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/UpdateSegmentParams.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/UpdateSegmentResponse.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/UserProfile.kt delete mode 100644 playground/go/predict.go delete mode 100644 playground/javascript/node/predict.ts delete mode 100644 playground/kotlin/src/main/kotlin/com/algolia/playground/Predict.kt delete mode 100644 specs/bundled/predict.yml delete mode 100644 specs/predict/common/parameters.yml delete mode 100644 specs/predict/common/schemas/Params.yml delete mode 100644 specs/predict/common/schemas/SegmentsParams.yml delete mode 100644 specs/predict/common/schemas/modelsParams.yml delete mode 100644 specs/predict/paths/models/getAvailableModelTypes.yml delete mode 100644 specs/predict/paths/models/getModelMetrics.yml delete mode 100644 specs/predict/paths/models/modelInstances.yml delete mode 100644 specs/predict/paths/models/models.yml delete mode 100644 specs/predict/paths/segments/allSegments.yml delete mode 100644 specs/predict/paths/segments/segmentUsers.yml delete mode 100644 specs/predict/paths/segments/singleSegment.yml delete mode 100644 specs/predict/paths/users/delete.yml delete mode 100644 specs/predict/paths/users/fetch.yml delete mode 100644 specs/predict/paths/users/fetchAll.yml delete mode 100644 specs/predict/responses/InvalidCredentials.yml delete mode 100644 specs/predict/responses/ModelTypes.yml delete mode 100644 specs/predict/responses/Models.yml delete mode 100644 specs/predict/responses/Segment.yml delete mode 100644 specs/predict/responses/UserNotFound.yml delete mode 100644 specs/predict/responses/UserProfile.yml delete mode 100644 specs/predict/spec.yml delete mode 100644 tests/CTS/client/predict/parameters.json delete mode 100644 tests/CTS/methods/requests/predict/activateModelInstance.json delete mode 100644 tests/CTS/methods/requests/predict/createSegment.json delete mode 100644 tests/CTS/methods/requests/predict/deleteModelInstance.json delete mode 100644 tests/CTS/methods/requests/predict/deleteSegment.json delete mode 100644 tests/CTS/methods/requests/predict/deleteUserProfile.json delete mode 100644 tests/CTS/methods/requests/predict/fetchAllSegments.json delete mode 100644 tests/CTS/methods/requests/predict/fetchAllUserProfiles.json delete mode 100644 tests/CTS/methods/requests/predict/fetchSegment.json delete mode 100644 tests/CTS/methods/requests/predict/fetchUserProfile.json delete mode 100644 tests/CTS/methods/requests/predict/getAvailableModelTypes.json delete mode 100644 tests/CTS/methods/requests/predict/getModelInstanceConfig.json delete mode 100644 tests/CTS/methods/requests/predict/getModelInstances.json delete mode 100644 tests/CTS/methods/requests/predict/getModelMetrics.json delete mode 100644 tests/CTS/methods/requests/predict/getSegmentUsers.json delete mode 100644 tests/CTS/methods/requests/predict/updateModelInstance.json delete mode 100644 tests/CTS/methods/requests/predict/updateSegment.json delete mode 100644 tests/output/go/tests/methods/requests/predict_test.go delete mode 100644 tests/output/java/src/test/java/com/algolia/client/Predict.test.java delete mode 100644 tests/output/java/src/test/java/com/algolia/methods/requests/Predict.test.java delete mode 100644 tests/output/javascript/src/client/predict.test.ts delete mode 100644 tests/output/javascript/src/methods/requests/predict.test.ts delete mode 100644 tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/PredictTest.kt delete mode 100644 tests/output/kotlin/src/commonTest/kotlin/com/algolia/extension/SegmentFilterProbability.kt delete mode 100644 tests/output/kotlin/src/commonTest/kotlin/com/algolia/methods/requests/PredictTest.kt diff --git a/.codesandbox/ci.json b/.codesandbox/ci.json index f3abf4e59c..30a3e1cd9e 100644 --- a/.codesandbox/ci.json +++ b/.codesandbox/ci.json @@ -6,7 +6,6 @@ "sandboxes": [ "algolia-algoliasearch-for-javascript-jc82hd", "algolia-client-search-for-javascript-10pix9", - "algolia-client-predict-for-javascript-4e31t3", "algolia-recommend-for-javascript-j04foe", "algolia-client-abtesting-for-javascript-8wthkc", "algolia-client-query-suggestions-for-javascrip-h8rwl4", diff --git a/.redocly.yaml b/.redocly.yaml index 5d70fab54e..6575eb8296 100644 --- a/.redocly.yaml +++ b/.redocly.yaml @@ -19,8 +19,6 @@ apis: root: specs/recommend/spec.yml search: root: specs/search/spec.yml - predict: - root: specs/predict/spec.yml extends: - recommended diff --git a/clients/algoliasearch-client-dart/packages/client_predict/build.yaml b/clients/algoliasearch-client-dart/packages/client_predict/build.yaml deleted file mode 100644 index 6d71b406a7..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/build.yaml +++ /dev/null @@ -1,14 +0,0 @@ -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 deleted file mode 100644 index 3be03e9db8..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/algolia_client_predict.dart +++ /dev/null @@ -1,69 +0,0 @@ -// 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 deleted file mode 100644 index 43ef2867b0..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/api/predict_client.dart +++ /dev/null @@ -1,677 +0,0 @@ -// Code generated by 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 deleted file mode 100644 index 8328183f9d..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/deserialize.dart +++ /dev/null @@ -1,273 +0,0 @@ -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/extension.dart b/clients/algoliasearch-client-dart/packages/client_predict/lib/src/extension.dart deleted file mode 100644 index 8b13789179..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/extension.dart +++ /dev/null @@ -1 +0,0 @@ - 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 deleted file mode 100644 index c8d094cbca..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_instance_response.dart +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 5ba0afa9d7..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_instance_response.g.dart +++ /dev/null @@ -1,28 +0,0 @@ -// 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 deleted file mode 100644 index 0aff5db31c..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_params.dart +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 7b840e9071..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/activate_model_params.g.dart +++ /dev/null @@ -1,49 +0,0 @@ -// 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 deleted file mode 100644 index bec2ced086..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/affinity.dart +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 799e14eca2..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/affinity.g.dart +++ /dev/null @@ -1,37 +0,0 @@ -// 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 deleted file mode 100644 index 08ab405683..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_params.dart +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index ab3ee0a9e6..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_params.g.dart +++ /dev/null @@ -1,54 +0,0 @@ -// 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 deleted file mode 100644 index 436b5930f6..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_update_segment_params.dart +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 46d05918f9..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/all_update_segment_params.g.dart +++ /dev/null @@ -1,41 +0,0 @@ -// 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 deleted file mode 100644 index 4e858aff38..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/compatible_sources.dart +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index c27947488e..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_params.dart +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index c2fb34e3bc..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_params.g.dart +++ /dev/null @@ -1,30 +0,0 @@ -// 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 deleted file mode 100644 index 2661e5f077..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_response.dart +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index f185df2986..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/create_segment_response.g.dart +++ /dev/null @@ -1,39 +0,0 @@ -// 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 deleted file mode 100644 index 453cf30179..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_model_instance_response.dart +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index b175c3f696..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_model_instance_response.g.dart +++ /dev/null @@ -1,28 +0,0 @@ -// 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 deleted file mode 100644 index 20856f240f..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_segment_response.dart +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index b565fe0d14..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_segment_response.g.dart +++ /dev/null @@ -1,28 +0,0 @@ -// 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 deleted file mode 100644 index 8f6be21789..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_user_profile_response.dart +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index d249fc6f4a..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/delete_user_profile_response.g.dart +++ /dev/null @@ -1,28 +0,0 @@ -// 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 deleted file mode 100644 index ef20fb3b01..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error.dart +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 387138c249..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error.g.dart +++ /dev/null @@ -1,22 +0,0 @@ -// 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 deleted file mode 100644 index df5d4ade57..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error_base.dart +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index f796166fb2..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/error_base.g.dart +++ /dev/null @@ -1,35 +0,0 @@ -// 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 deleted file mode 100644 index ef1ec994cc..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/fetch_all_user_profiles_response.dart +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 4907727c72..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/fetch_all_user_profiles_response.g.dart +++ /dev/null @@ -1,44 +0,0 @@ -// 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 deleted file mode 100644 index 06e9d86524..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/funnel_stage.dart +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index d5571fbc96..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/funnel_stage.g.dart +++ /dev/null @@ -1,26 +0,0 @@ -// 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 deleted file mode 100644 index 8a77aadbf0..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner.dart +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 1fe7bb6293..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner.g.dart +++ /dev/null @@ -1,44 +0,0 @@ -// 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 deleted file mode 100644 index f45f080cd0..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner_data_requirements.dart +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 7ef5195707..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_available_model_types_response_inner_data_requirements.g.dart +++ /dev/null @@ -1,30 +0,0 @@ -// 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 deleted file mode 100644 index ea8288d3fd..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_model_instance_config_status.dart +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 7a258a73aa..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_model_metrics_response.dart +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 25b7af9ab3..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_model_metrics_response.g.dart +++ /dev/null @@ -1,32 +0,0 @@ -// 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 deleted file mode 100644 index 5eef5f7c4d..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_segment_users_response.dart +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index dc6d365feb..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/get_segment_users_response.g.dart +++ /dev/null @@ -1,46 +0,0 @@ -// 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 deleted file mode 100644 index 023c4f633c..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/limit_param.dart +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index f96c9b93ee..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/limit_param.g.dart +++ /dev/null @@ -1,31 +0,0 @@ -// 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 deleted file mode 100644 index 0683bca9d0..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_attributes.dart +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 9a4eff6d1a..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_attributes.g.dart +++ /dev/null @@ -1,36 +0,0 @@ -// 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 deleted file mode 100644 index 379b0d900e..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_instance.dart +++ /dev/null @@ -1,98 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index da56a5eeea..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_instance.g.dart +++ /dev/null @@ -1,72 +0,0 @@ -// 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 deleted file mode 100644 index f85610686b..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_metrics.dart +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 0b4a4aa879..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_metrics.g.dart +++ /dev/null @@ -1,44 +0,0 @@ -// 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 deleted file mode 100644 index 2aa5eb5546..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/model_status.dart +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 1aac709db7..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/models_to_retrieve.dart +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 3f20707aff..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/models_to_retrieve_param.dart +++ /dev/null @@ -1,37 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 9a41772444..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/models_to_retrieve_param.g.dart +++ /dev/null @@ -1,45 +0,0 @@ -// 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 deleted file mode 100644 index e312c72961..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/next_page_token_param.dart +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 2eb9206dbe..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/next_page_token_param.g.dart +++ /dev/null @@ -1,32 +0,0 @@ -// 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 deleted file mode 100644 index e47e0019ec..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions.dart +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 9246f154f3..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions.g.dart +++ /dev/null @@ -1,39 +0,0 @@ -// 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 deleted file mode 100644 index 31b905007f..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_affinities_success.dart +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 8cb7a9307a..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_affinities_success.g.dart +++ /dev/null @@ -1,32 +0,0 @@ -// 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 deleted file mode 100644 index 5231a34945..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_funnel_stage_success.dart +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 7db53c8e02..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_funnel_stage_success.g.dart +++ /dev/null @@ -1,32 +0,0 @@ -// 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 deleted file mode 100644 index 29e9779ff9..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_order_value_success.dart +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 1456551da5..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/predictions_order_value_success.g.dart +++ /dev/null @@ -1,28 +0,0 @@ -// 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 deleted file mode 100644 index 6fd90b0c5a..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/previous_page_token_param.dart +++ /dev/null @@ -1,37 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 9d8db1519c..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/previous_page_token_param.g.dart +++ /dev/null @@ -1,35 +0,0 @@ -// 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 deleted file mode 100644 index 496e9384c0..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/properties.dart +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 5b42d39523..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/properties.g.dart +++ /dev/null @@ -1,35 +0,0 @@ -// 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 deleted file mode 100644 index eee6c462b3..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment.dart +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 795f07c6a6..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment.g.dart +++ /dev/null @@ -1,62 +0,0 @@ -// 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 deleted file mode 100644 index df2049d048..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_affinity_filter.dart +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 03c2078f53..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_affinity_filter.g.dart +++ /dev/null @@ -1,54 +0,0 @@ -// 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 deleted file mode 100644 index 918ef3579e..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_child_conditions.dart +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 6dff48a97e..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_child_conditions.g.dart +++ /dev/null @@ -1,34 +0,0 @@ -// 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 deleted file mode 100644 index 5ab0f0e5d3..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_condition_operator.dart +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index d043672394..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_conditions_param.dart +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index c206446498..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_conditions_param.g.dart +++ /dev/null @@ -1,39 +0,0 @@ -// 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 deleted file mode 100644 index b395f6d388..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_operator_boolean.dart +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 2ef51870e9..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_operator_numerical.dart +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 10e08070d8..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_probability.dart +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index bbe005f2d5..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_filter_probability.g.dart +++ /dev/null @@ -1,41 +0,0 @@ -// 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 deleted file mode 100644 index ed5660889e..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_funnel_stage_filter.dart +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index a99f4ba47a..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_funnel_stage_filter.g.dart +++ /dev/null @@ -1,49 +0,0 @@ -// 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 deleted file mode 100644 index 5f4d417074..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_name_param.dart +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 6c2d1fef21..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_name_param.g.dart +++ /dev/null @@ -1,32 +0,0 @@ -// 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 deleted file mode 100644 index 8ffa24f71f..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_affinity.dart +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index b8b4eea1ed..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_affinity.g.dart +++ /dev/null @@ -1,33 +0,0 @@ -// 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 deleted file mode 100644 index f2ffc81a70..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_funnel_stage.dart +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 55ea824a0f..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_funnel_stage.g.dart +++ /dev/null @@ -1,33 +0,0 @@ -// 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 deleted file mode 100644 index c5cad8b92e..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_order_value.dart +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 8dcd00e672..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_order_value.g.dart +++ /dev/null @@ -1,33 +0,0 @@ -// 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 deleted file mode 100644 index cacab6b2c5..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_property.dart +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index febd1d4b7b..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_operand_property.g.dart +++ /dev/null @@ -1,33 +0,0 @@ -// 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 deleted file mode 100644 index 103b9ef99e..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_order_value_filter.dart +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 967404dcd7..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_order_value_filter.g.dart +++ /dev/null @@ -1,48 +0,0 @@ -// 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 deleted file mode 100644 index 97432ae0a8..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_parent_conditions.dart +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 93adee6593..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_parent_conditions.g.dart +++ /dev/null @@ -1,34 +0,0 @@ -// 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 deleted file mode 100644 index 4d72c1da61..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_property_filter.dart +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 3607c246cf..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_property_filter.g.dart +++ /dev/null @@ -1,48 +0,0 @@ -// 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 deleted file mode 100644 index f5ecaa8600..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_status.dart +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 31df7352b4..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segment_type.dart +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 3e4673bacc..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segments.dart +++ /dev/null @@ -1,41 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 285cd96c8e..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/segments.g.dart +++ /dev/null @@ -1,26 +0,0 @@ -// 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 deleted file mode 100644 index 44da965fd0..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/types_to_retrieve.dart +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 3fe350a5a6..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/types_to_retrieve_param.dart +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 65059bf7fa..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/types_to_retrieve_param.g.dart +++ /dev/null @@ -1,44 +0,0 @@ -// 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 deleted file mode 100644 index 3ea7e91bc0..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_instance_response.dart +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 4b901de910..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_instance_response.g.dart +++ /dev/null @@ -1,28 +0,0 @@ -// 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 deleted file mode 100644 index 6ef3a69e44..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_params.dart +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 67052d61b7..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_model_params.g.dart +++ /dev/null @@ -1,43 +0,0 @@ -// 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 deleted file mode 100644 index f4ef6bbf11..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_segment_response.dart +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index 8efc88cf45..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/update_segment_response.g.dart +++ /dev/null @@ -1,39 +0,0 @@ -// 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 deleted file mode 100644 index 191265d957..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/user_profile.dart +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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 deleted file mode 100644 index d7c52a50a6..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/model/user_profile.g.dart +++ /dev/null @@ -1,50 +0,0 @@ -// 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 deleted file mode 100644 index 03e065a0a8..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/lib/src/version.dart +++ /dev/null @@ -1,2 +0,0 @@ -/// 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 deleted file mode 100644 index d47693e6fe..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_predict/pubspec.yaml +++ /dev/null @@ -1,24 +0,0 @@ -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-go/algolia/predict/api_predict.go b/clients/algoliasearch-client-go/algolia/predict/api_predict.go deleted file mode 100644 index cffce1af12..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/api_predict.go +++ /dev/null @@ -1,3166 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "bytes" - "context" - "encoding/json" - "io" - "net/http" - "net/url" - "strings" - - "github.com/algolia/algoliasearch-client-go/v4/algolia/call" -) - -type Option struct { - optionType string - name string - value string -} - -func QueryParamOption(name string, val any) Option { - return Option{ - optionType: "query", - name: name, - value: parameterToString(val), - } -} - -func HeaderParamOption(name string, val any) Option { - return Option{ - optionType: "header", - name: name, - value: parameterToString(val), - } -} - -func (r *ApiActivateModelInstanceRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - if v, ok := req["activateModelParams"]; ok { - err = json.Unmarshal(v, &r.activateModelParams) - if err != nil { - err = json.Unmarshal(b, &r.activateModelParams) - if err != nil { - return err - } - } - } else { - err = json.Unmarshal(b, &r.activateModelParams) - if err != nil { - return err - } - } - - return nil -} - -// ApiActivateModelInstanceRequest represents the request with all the parameters for the API call. -type ApiActivateModelInstanceRequest struct { - activateModelParams *ActivateModelParams -} - -// NewApiActivateModelInstanceRequest creates an instance of the ApiActivateModelInstanceRequest to be used for the API call. -func (c *APIClient) NewApiActivateModelInstanceRequest(activateModelParams *ActivateModelParams) ApiActivateModelInstanceRequest { - return ApiActivateModelInstanceRequest{ - activateModelParams: activateModelParams, - } -} - -/* -ActivateModelInstance Activate a model instance. Wraps ActivateModelInstanceWithContext using context.Background. - -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. - -Request can be constructed by NewApiActivateModelInstanceRequest with parameters below. - - @param activateModelParams ActivateModelParams - @return ActivateModelInstanceResponse -*/ -func (c *APIClient) ActivateModelInstance(r ApiActivateModelInstanceRequest, opts ...Option) (*ActivateModelInstanceResponse, error) { - return c.ActivateModelInstanceWithContext(context.Background(), r, opts...) -} - -/* -ActivateModelInstance 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. - -Request can be constructed by NewApiActivateModelInstanceRequest with parameters below. - - @param activateModelParams ActivateModelParams - @return ActivateModelInstanceResponse -*/ -func (c *APIClient) ActivateModelInstanceWithContext(ctx context.Context, r ApiActivateModelInstanceRequest, opts ...Option) (*ActivateModelInstanceResponse, error) { - var ( - postBody any - returnValue *ActivateModelInstanceResponse - ) - - requestPath := "/1/predict/models" - - headers := make(map[string]string) - queryParams := url.Values{} - if r.activateModelParams == nil { - return returnValue, reportError("activateModelParams is required and must be specified") - } - - // optional params if any - for _, opt := range opts { - switch opt.optionType { - case "query": - queryParams.Set(opt.name, opt.value) - case "header": - headers[opt.name] = opt.value - } - } - - // body params - postBody = r.activateModelParams - req, err := c.prepareRequest(ctx, requestPath, http.MethodPost, postBody, headers, queryParams) - if err != nil { - return returnValue, err - } - - res, err := c.callAPI(req, call.Write) - if err != nil { - return returnValue, err - } - if res == nil { - return returnValue, reportError("res is nil") - } - - resBody, err := io.ReadAll(res.Body) - res.Body.Close() - res.Body = io.NopCloser(bytes.NewBuffer(resBody)) - if err != nil { - return returnValue, err - } - - if res.StatusCode >= 300 { - newErr := &APIError{ - Message: string(resBody), - Status: res.StatusCode, - } - if res.StatusCode == 401 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 422 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 500 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - } - return returnValue, newErr - } - - err = c.decode(&returnValue, resBody, res.Header.Get("Content-Type")) - if err != nil { - return returnValue, reportError("cannot decode result: %w", err) - } - - return returnValue, nil -} - -func (r *ApiCreateSegmentRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - if v, ok := req["createSegmentParams"]; ok { - err = json.Unmarshal(v, &r.createSegmentParams) - if err != nil { - err = json.Unmarshal(b, &r.createSegmentParams) - if err != nil { - return err - } - } - } else { - err = json.Unmarshal(b, &r.createSegmentParams) - if err != nil { - return err - } - } - - return nil -} - -// ApiCreateSegmentRequest represents the request with all the parameters for the API call. -type ApiCreateSegmentRequest struct { - createSegmentParams *CreateSegmentParams -} - -// NewApiCreateSegmentRequest creates an instance of the ApiCreateSegmentRequest to be used for the API call. -func (c *APIClient) NewApiCreateSegmentRequest(createSegmentParams *CreateSegmentParams) ApiCreateSegmentRequest { - return ApiCreateSegmentRequest{ - createSegmentParams: createSegmentParams, - } -} - -/* -CreateSegment Create a segment. Wraps CreateSegmentWithContext using context.Background. - -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. - -Request can be constructed by NewApiCreateSegmentRequest with parameters below. - - @param createSegmentParams CreateSegmentParams - @return CreateSegmentResponse -*/ -func (c *APIClient) CreateSegment(r ApiCreateSegmentRequest, opts ...Option) (*CreateSegmentResponse, error) { - return c.CreateSegmentWithContext(context.Background(), r, opts...) -} - -/* -CreateSegment 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. - -Request can be constructed by NewApiCreateSegmentRequest with parameters below. - - @param createSegmentParams CreateSegmentParams - @return CreateSegmentResponse -*/ -func (c *APIClient) CreateSegmentWithContext(ctx context.Context, r ApiCreateSegmentRequest, opts ...Option) (*CreateSegmentResponse, error) { - var ( - postBody any - returnValue *CreateSegmentResponse - ) - - requestPath := "/1/segments" - - headers := make(map[string]string) - queryParams := url.Values{} - if r.createSegmentParams == nil { - return returnValue, reportError("createSegmentParams is required and must be specified") - } - - // optional params if any - for _, opt := range opts { - switch opt.optionType { - case "query": - queryParams.Set(opt.name, opt.value) - case "header": - headers[opt.name] = opt.value - } - } - - // body params - postBody = r.createSegmentParams - req, err := c.prepareRequest(ctx, requestPath, http.MethodPost, postBody, headers, queryParams) - if err != nil { - return returnValue, err - } - - res, err := c.callAPI(req, call.Write) - if err != nil { - return returnValue, err - } - if res == nil { - return returnValue, reportError("res is nil") - } - - resBody, err := io.ReadAll(res.Body) - res.Body.Close() - res.Body = io.NopCloser(bytes.NewBuffer(resBody)) - if err != nil { - return returnValue, err - } - - if res.StatusCode >= 300 { - newErr := &APIError{ - Message: string(resBody), - Status: res.StatusCode, - } - if res.StatusCode == 400 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 401 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 422 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 500 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - } - return returnValue, newErr - } - - err = c.decode(&returnValue, resBody, res.Header.Get("Content-Type")) - if err != nil { - return returnValue, reportError("cannot decode result: %w", err) - } - - return returnValue, nil -} - -func (r *ApiDelRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - if v, ok := req["path"]; ok { - err = json.Unmarshal(v, &r.path) - if err != nil { - err = json.Unmarshal(b, &r.path) - if err != nil { - return err - } - } - } - if v, ok := req["parameters"]; ok { - err = json.Unmarshal(v, &r.parameters) - if err != nil { - err = json.Unmarshal(b, &r.parameters) - if err != nil { - return err - } - } - } - - return nil -} - -// ApiDelRequest represents the request with all the parameters for the API call. -type ApiDelRequest struct { - path string - parameters map[string]interface{} -} - -// NewApiDelRequest creates an instance of the ApiDelRequest to be used for the API call. -func (c *APIClient) NewApiDelRequest(path string) ApiDelRequest { - return ApiDelRequest{ - path: path, - } -} - -// WithParameters adds the parameters to the ApiDelRequest and returns the request for chaining. -func (r ApiDelRequest) WithParameters(parameters map[string]interface{}) ApiDelRequest { - r.parameters = parameters - return r -} - -/* -Del Send requests to the Algolia REST API. Wraps DelWithContext using context.Background. - -This method allow you to send requests to the Algolia REST API. - -Request can be constructed by NewApiDelRequest with parameters below. - - @param path string - Path of the endpoint, anything after \"/1\" must be specified. - @param parameters map[string]interface{} - Query parameters to apply to the current query. - @return map[string]interface{} -*/ -func (c *APIClient) Del(r ApiDelRequest, opts ...Option) (map[string]interface{}, error) { - return c.DelWithContext(context.Background(), r, opts...) -} - -/* -Del Send requests to the Algolia REST API. - -This method allow you to send requests to the Algolia REST API. - -Request can be constructed by NewApiDelRequest with parameters below. - - @param path string - Path of the endpoint, anything after \"/1\" must be specified. - @param parameters map[string]interface{} - Query parameters to apply to the current query. - @return map[string]interface{} -*/ -func (c *APIClient) DelWithContext(ctx context.Context, r ApiDelRequest, opts ...Option) (map[string]interface{}, error) { - var ( - postBody any - returnValue map[string]interface{} - ) - - requestPath := "/1{path}" - requestPath = strings.Replace(requestPath, "{"+"path"+"}", url.PathEscape(parameterToString(r.path)), -1) - - headers := make(map[string]string) - queryParams := url.Values{} - - if !isNilorEmpty(r.parameters) { - for k, v := range r.parameters { - queryParams.Set(k, parameterToString(v)) - } - } - - // optional params if any - for _, opt := range opts { - switch opt.optionType { - case "query": - queryParams.Set(opt.name, opt.value) - case "header": - headers[opt.name] = opt.value - } - } - - req, err := c.prepareRequest(ctx, requestPath, http.MethodDelete, postBody, headers, queryParams) - if err != nil { - return returnValue, err - } - - res, err := c.callAPI(req, call.Write) - if err != nil { - return returnValue, err - } - if res == nil { - return returnValue, reportError("res is nil") - } - - resBody, err := io.ReadAll(res.Body) - res.Body.Close() - res.Body = io.NopCloser(bytes.NewBuffer(resBody)) - if err != nil { - return returnValue, err - } - - if res.StatusCode >= 300 { - newErr := &APIError{ - Message: string(resBody), - Status: res.StatusCode, - } - if res.StatusCode == 400 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 402 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 403 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 404 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - } - return returnValue, newErr - } - - err = c.decode(&returnValue, resBody, res.Header.Get("Content-Type")) - if err != nil { - return returnValue, reportError("cannot decode result: %w", err) - } - - return returnValue, nil -} - -func (r *ApiDeleteModelInstanceRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - if v, ok := req["modelID"]; ok { - err = json.Unmarshal(v, &r.modelID) - if err != nil { - err = json.Unmarshal(b, &r.modelID) - if err != nil { - return err - } - } - } - - return nil -} - -// ApiDeleteModelInstanceRequest represents the request with all the parameters for the API call. -type ApiDeleteModelInstanceRequest struct { - modelID string -} - -// NewApiDeleteModelInstanceRequest creates an instance of the ApiDeleteModelInstanceRequest to be used for the API call. -func (c *APIClient) NewApiDeleteModelInstanceRequest(modelID string) ApiDeleteModelInstanceRequest { - return ApiDeleteModelInstanceRequest{ - modelID: modelID, - } -} - -/* -DeleteModelInstance Delete a model instance. Wraps DeleteModelInstanceWithContext using context.Background. - -Delete the model’s configuration, pipelines and generated predictions. - -Request can be constructed by NewApiDeleteModelInstanceRequest with parameters below. - - @param modelID string - The ID of the model to retrieve. - @return DeleteModelInstanceResponse -*/ -func (c *APIClient) DeleteModelInstance(r ApiDeleteModelInstanceRequest, opts ...Option) (*DeleteModelInstanceResponse, error) { - return c.DeleteModelInstanceWithContext(context.Background(), r, opts...) -} - -/* -DeleteModelInstance Delete a model instance. - -Delete the model’s configuration, pipelines and generated predictions. - -Request can be constructed by NewApiDeleteModelInstanceRequest with parameters below. - - @param modelID string - The ID of the model to retrieve. - @return DeleteModelInstanceResponse -*/ -func (c *APIClient) DeleteModelInstanceWithContext(ctx context.Context, r ApiDeleteModelInstanceRequest, opts ...Option) (*DeleteModelInstanceResponse, error) { - var ( - postBody any - returnValue *DeleteModelInstanceResponse - ) - - requestPath := "/1/predict/models/{modelID}" - requestPath = strings.Replace(requestPath, "{"+"modelID"+"}", url.PathEscape(parameterToString(r.modelID)), -1) - - headers := make(map[string]string) - queryParams := url.Values{} - - // optional params if any - for _, opt := range opts { - switch opt.optionType { - case "query": - queryParams.Set(opt.name, opt.value) - case "header": - headers[opt.name] = opt.value - } - } - - req, err := c.prepareRequest(ctx, requestPath, http.MethodDelete, postBody, headers, queryParams) - if err != nil { - return returnValue, err - } - - res, err := c.callAPI(req, call.Write) - if err != nil { - return returnValue, err - } - if res == nil { - return returnValue, reportError("res is nil") - } - - resBody, err := io.ReadAll(res.Body) - res.Body.Close() - res.Body = io.NopCloser(bytes.NewBuffer(resBody)) - if err != nil { - return returnValue, err - } - - if res.StatusCode >= 300 { - newErr := &APIError{ - Message: string(resBody), - Status: res.StatusCode, - } - if res.StatusCode == 401 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 404 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 422 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 500 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - } - return returnValue, newErr - } - - err = c.decode(&returnValue, resBody, res.Header.Get("Content-Type")) - if err != nil { - return returnValue, reportError("cannot decode result: %w", err) - } - - return returnValue, nil -} - -func (r *ApiDeleteSegmentRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - if v, ok := req["segmentID"]; ok { - err = json.Unmarshal(v, &r.segmentID) - if err != nil { - err = json.Unmarshal(b, &r.segmentID) - if err != nil { - return err - } - } - } - - return nil -} - -// ApiDeleteSegmentRequest represents the request with all the parameters for the API call. -type ApiDeleteSegmentRequest struct { - segmentID string -} - -// NewApiDeleteSegmentRequest creates an instance of the ApiDeleteSegmentRequest to be used for the API call. -func (c *APIClient) NewApiDeleteSegmentRequest(segmentID string) ApiDeleteSegmentRequest { - return ApiDeleteSegmentRequest{ - segmentID: segmentID, - } -} - -/* -DeleteSegment Delete a segment's configuration. Wraps DeleteSegmentWithContext using context.Background. - -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. - -Request can be constructed by NewApiDeleteSegmentRequest with parameters below. - - @param segmentID string - The ID of the Segment to fetch. - @return DeleteSegmentResponse -*/ -func (c *APIClient) DeleteSegment(r ApiDeleteSegmentRequest, opts ...Option) (*DeleteSegmentResponse, error) { - return c.DeleteSegmentWithContext(context.Background(), r, opts...) -} - -/* -DeleteSegment 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. - -Request can be constructed by NewApiDeleteSegmentRequest with parameters below. - - @param segmentID string - The ID of the Segment to fetch. - @return DeleteSegmentResponse -*/ -func (c *APIClient) DeleteSegmentWithContext(ctx context.Context, r ApiDeleteSegmentRequest, opts ...Option) (*DeleteSegmentResponse, error) { - var ( - postBody any - returnValue *DeleteSegmentResponse - ) - - requestPath := "/1/segments/{segmentID}" - requestPath = strings.Replace(requestPath, "{"+"segmentID"+"}", url.PathEscape(parameterToString(r.segmentID)), -1) - - headers := make(map[string]string) - queryParams := url.Values{} - - // optional params if any - for _, opt := range opts { - switch opt.optionType { - case "query": - queryParams.Set(opt.name, opt.value) - case "header": - headers[opt.name] = opt.value - } - } - - req, err := c.prepareRequest(ctx, requestPath, http.MethodDelete, postBody, headers, queryParams) - if err != nil { - return returnValue, err - } - - res, err := c.callAPI(req, call.Write) - if err != nil { - return returnValue, err - } - if res == nil { - return returnValue, reportError("res is nil") - } - - resBody, err := io.ReadAll(res.Body) - res.Body.Close() - res.Body = io.NopCloser(bytes.NewBuffer(resBody)) - if err != nil { - return returnValue, err - } - - if res.StatusCode >= 300 { - newErr := &APIError{ - Message: string(resBody), - Status: res.StatusCode, - } - if res.StatusCode == 401 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 404 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 422 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 500 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - } - return returnValue, newErr - } - - err = c.decode(&returnValue, resBody, res.Header.Get("Content-Type")) - if err != nil { - return returnValue, reportError("cannot decode result: %w", err) - } - - return returnValue, nil -} - -func (r *ApiDeleteUserProfileRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - if v, ok := req["userID"]; ok { - err = json.Unmarshal(v, &r.userID) - if err != nil { - err = json.Unmarshal(b, &r.userID) - if err != nil { - return err - } - } - } - - return nil -} - -// ApiDeleteUserProfileRequest represents the request with all the parameters for the API call. -type ApiDeleteUserProfileRequest struct { - userID string -} - -// NewApiDeleteUserProfileRequest creates an instance of the ApiDeleteUserProfileRequest to be used for the API call. -func (c *APIClient) NewApiDeleteUserProfileRequest(userID string) ApiDeleteUserProfileRequest { - return ApiDeleteUserProfileRequest{ - userID: userID, - } -} - -/* -DeleteUserProfile Delete user profile. Wraps DeleteUserProfileWithContext using context.Background. - -Delete all data and predictions associated with an authenticated user (userID) or an anonymous user (cookieID, sessionID). - -Request can be constructed by NewApiDeleteUserProfileRequest with parameters below. - - @param userID string - User ID for authenticated users or cookie ID for non-authenticated repeated users (visitors). - @return DeleteUserProfileResponse -*/ -func (c *APIClient) DeleteUserProfile(r ApiDeleteUserProfileRequest, opts ...Option) (*DeleteUserProfileResponse, error) { - return c.DeleteUserProfileWithContext(context.Background(), r, opts...) -} - -/* -DeleteUserProfile Delete user profile. - -Delete all data and predictions associated with an authenticated user (userID) or an anonymous user (cookieID, sessionID). - -Request can be constructed by NewApiDeleteUserProfileRequest with parameters below. - - @param userID string - User ID for authenticated users or cookie ID for non-authenticated repeated users (visitors). - @return DeleteUserProfileResponse -*/ -func (c *APIClient) DeleteUserProfileWithContext(ctx context.Context, r ApiDeleteUserProfileRequest, opts ...Option) (*DeleteUserProfileResponse, error) { - var ( - postBody any - returnValue *DeleteUserProfileResponse - ) - - requestPath := "/1/users/{userID}" - requestPath = strings.Replace(requestPath, "{"+"userID"+"}", url.PathEscape(parameterToString(r.userID)), -1) - - headers := make(map[string]string) - queryParams := url.Values{} - - // optional params if any - for _, opt := range opts { - switch opt.optionType { - case "query": - queryParams.Set(opt.name, opt.value) - case "header": - headers[opt.name] = opt.value - } - } - - req, err := c.prepareRequest(ctx, requestPath, http.MethodDelete, postBody, headers, queryParams) - if err != nil { - return returnValue, err - } - - res, err := c.callAPI(req, call.Write) - if err != nil { - return returnValue, err - } - if res == nil { - return returnValue, reportError("res is nil") - } - - resBody, err := io.ReadAll(res.Body) - res.Body.Close() - res.Body = io.NopCloser(bytes.NewBuffer(resBody)) - if err != nil { - return returnValue, err - } - - if res.StatusCode >= 300 { - newErr := &APIError{ - Message: string(resBody), - Status: res.StatusCode, - } - if res.StatusCode == 401 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 404 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 422 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 500 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - } - return returnValue, newErr - } - - err = c.decode(&returnValue, resBody, res.Header.Get("Content-Type")) - if err != nil { - return returnValue, reportError("cannot decode result: %w", err) - } - - return returnValue, nil -} - -func (r *ApiFetchAllSegmentsRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - if v, ok := req["type"]; ok { - err = json.Unmarshal(v, &r.type_) - if err != nil { - err = json.Unmarshal(b, &r.type_) - if err != nil { - return err - } - } - } - - return nil -} - -// ApiFetchAllSegmentsRequest represents the request with all the parameters for the API call. -type ApiFetchAllSegmentsRequest struct { - type_ *SegmentType -} - -// NewApiFetchAllSegmentsRequest creates an instance of the ApiFetchAllSegmentsRequest to be used for the API call. -func (c *APIClient) NewApiFetchAllSegmentsRequest() ApiFetchAllSegmentsRequest { - return ApiFetchAllSegmentsRequest{} -} - -// WithType_ adds the type_ to the ApiFetchAllSegmentsRequest and returns the request for chaining. -func (r ApiFetchAllSegmentsRequest) WithType_(type_ *SegmentType) ApiFetchAllSegmentsRequest { - r.type_ = type_ - return r -} - -/* -FetchAllSegments Get all segments. Wraps FetchAllSegmentsWithContext using context.Background. - -Get the list of segments with their configuration. - -Request can be constructed by NewApiFetchAllSegmentsRequest with parameters below. - - @param type_ SegmentType - The type of segments to fetch. - @return []Segment -*/ -func (c *APIClient) FetchAllSegments(r ApiFetchAllSegmentsRequest, opts ...Option) ([]Segment, error) { - return c.FetchAllSegmentsWithContext(context.Background(), r, opts...) -} - -/* -FetchAllSegments Get all segments. - -Get the list of segments with their configuration. - -Request can be constructed by NewApiFetchAllSegmentsRequest with parameters below. - - @param type_ SegmentType - The type of segments to fetch. - @return []Segment -*/ -func (c *APIClient) FetchAllSegmentsWithContext(ctx context.Context, r ApiFetchAllSegmentsRequest, opts ...Option) ([]Segment, error) { - var ( - postBody any - returnValue []Segment - ) - - requestPath := "/1/segments" - - headers := make(map[string]string) - queryParams := url.Values{} - - if !isNilorEmpty(r.type_) { - queryParams.Set("type", parameterToString(*r.type_)) - } - - // optional params if any - for _, opt := range opts { - switch opt.optionType { - case "query": - queryParams.Set(opt.name, opt.value) - case "header": - headers[opt.name] = opt.value - } - } - - req, err := c.prepareRequest(ctx, requestPath, http.MethodGet, postBody, headers, queryParams) - if err != nil { - return returnValue, err - } - - res, err := c.callAPI(req, call.Write) - if err != nil { - return returnValue, err - } - if res == nil { - return returnValue, reportError("res is nil") - } - - resBody, err := io.ReadAll(res.Body) - res.Body.Close() - res.Body = io.NopCloser(bytes.NewBuffer(resBody)) - if err != nil { - return returnValue, err - } - - if res.StatusCode >= 300 { - newErr := &APIError{ - Message: string(resBody), - Status: res.StatusCode, - } - if res.StatusCode == 404 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 422 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 500 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - } - return returnValue, newErr - } - - err = c.decode(&returnValue, resBody, res.Header.Get("Content-Type")) - if err != nil { - return returnValue, reportError("cannot decode result: %w", err) - } - - return returnValue, nil -} - -func (r *ApiFetchAllUserProfilesRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - if v, ok := req["fetchAllUserProfilesParams"]; ok { - err = json.Unmarshal(v, &r.fetchAllUserProfilesParams) - if err != nil { - err = json.Unmarshal(b, &r.fetchAllUserProfilesParams) - if err != nil { - return err - } - } - } else { - err = json.Unmarshal(b, &r.fetchAllUserProfilesParams) - if err != nil { - return err - } - } - - return nil -} - -// ApiFetchAllUserProfilesRequest represents the request with all the parameters for the API call. -type ApiFetchAllUserProfilesRequest struct { - fetchAllUserProfilesParams *FetchAllUserProfilesParams -} - -// NewApiFetchAllUserProfilesRequest creates an instance of the ApiFetchAllUserProfilesRequest to be used for the API call. -func (c *APIClient) NewApiFetchAllUserProfilesRequest(fetchAllUserProfilesParams *FetchAllUserProfilesParams) ApiFetchAllUserProfilesRequest { - return ApiFetchAllUserProfilesRequest{ - fetchAllUserProfilesParams: fetchAllUserProfilesParams, - } -} - -/* -FetchAllUserProfiles Get all user profiles. Wraps FetchAllUserProfilesWithContext using context.Background. - -Get all users with predictions in the provided application. - -Request can be constructed by NewApiFetchAllUserProfilesRequest with parameters below. - - @param fetchAllUserProfilesParams FetchAllUserProfilesParams - @return FetchAllUserProfilesResponse -*/ -func (c *APIClient) FetchAllUserProfiles(r ApiFetchAllUserProfilesRequest, opts ...Option) (*FetchAllUserProfilesResponse, error) { - return c.FetchAllUserProfilesWithContext(context.Background(), r, opts...) -} - -/* -FetchAllUserProfiles Get all user profiles. - -Get all users with predictions in the provided application. - -Request can be constructed by NewApiFetchAllUserProfilesRequest with parameters below. - - @param fetchAllUserProfilesParams FetchAllUserProfilesParams - @return FetchAllUserProfilesResponse -*/ -func (c *APIClient) FetchAllUserProfilesWithContext(ctx context.Context, r ApiFetchAllUserProfilesRequest, opts ...Option) (*FetchAllUserProfilesResponse, error) { - var ( - postBody any - returnValue *FetchAllUserProfilesResponse - ) - - requestPath := "/1/users" - - headers := make(map[string]string) - queryParams := url.Values{} - if r.fetchAllUserProfilesParams == nil { - return returnValue, reportError("fetchAllUserProfilesParams is required and must be specified") - } - - // optional params if any - for _, opt := range opts { - switch opt.optionType { - case "query": - queryParams.Set(opt.name, opt.value) - case "header": - headers[opt.name] = opt.value - } - } - - // body params - postBody = r.fetchAllUserProfilesParams - req, err := c.prepareRequest(ctx, requestPath, http.MethodPost, postBody, headers, queryParams) - if err != nil { - return returnValue, err - } - - res, err := c.callAPI(req, call.Write) - if err != nil { - return returnValue, err - } - if res == nil { - return returnValue, reportError("res is nil") - } - - resBody, err := io.ReadAll(res.Body) - res.Body.Close() - res.Body = io.NopCloser(bytes.NewBuffer(resBody)) - if err != nil { - return returnValue, err - } - - if res.StatusCode >= 300 { - newErr := &APIError{ - Message: string(resBody), - Status: res.StatusCode, - } - if res.StatusCode == 400 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 401 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 422 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 500 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - } - return returnValue, newErr - } - - err = c.decode(&returnValue, resBody, res.Header.Get("Content-Type")) - if err != nil { - return returnValue, reportError("cannot decode result: %w", err) - } - - return returnValue, nil -} - -func (r *ApiFetchSegmentRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - if v, ok := req["segmentID"]; ok { - err = json.Unmarshal(v, &r.segmentID) - if err != nil { - err = json.Unmarshal(b, &r.segmentID) - if err != nil { - return err - } - } - } - - return nil -} - -// ApiFetchSegmentRequest represents the request with all the parameters for the API call. -type ApiFetchSegmentRequest struct { - segmentID string -} - -// NewApiFetchSegmentRequest creates an instance of the ApiFetchSegmentRequest to be used for the API call. -func (c *APIClient) NewApiFetchSegmentRequest(segmentID string) ApiFetchSegmentRequest { - return ApiFetchSegmentRequest{ - segmentID: segmentID, - } -} - -/* -FetchSegment Get the segment configuration. Wraps FetchSegmentWithContext using context.Background. - -Get the segment configuration. - -Request can be constructed by NewApiFetchSegmentRequest with parameters below. - - @param segmentID string - The ID of the Segment to fetch. - @return Segment -*/ -func (c *APIClient) FetchSegment(r ApiFetchSegmentRequest, opts ...Option) (*Segment, error) { - return c.FetchSegmentWithContext(context.Background(), r, opts...) -} - -/* -FetchSegment Get the segment configuration. - -Get the segment configuration. - -Request can be constructed by NewApiFetchSegmentRequest with parameters below. - - @param segmentID string - The ID of the Segment to fetch. - @return Segment -*/ -func (c *APIClient) FetchSegmentWithContext(ctx context.Context, r ApiFetchSegmentRequest, opts ...Option) (*Segment, error) { - var ( - postBody any - returnValue *Segment - ) - - requestPath := "/1/segments/{segmentID}" - requestPath = strings.Replace(requestPath, "{"+"segmentID"+"}", url.PathEscape(parameterToString(r.segmentID)), -1) - - headers := make(map[string]string) - queryParams := url.Values{} - - // optional params if any - for _, opt := range opts { - switch opt.optionType { - case "query": - queryParams.Set(opt.name, opt.value) - case "header": - headers[opt.name] = opt.value - } - } - - req, err := c.prepareRequest(ctx, requestPath, http.MethodGet, postBody, headers, queryParams) - if err != nil { - return returnValue, err - } - - res, err := c.callAPI(req, call.Write) - if err != nil { - return returnValue, err - } - if res == nil { - return returnValue, reportError("res is nil") - } - - resBody, err := io.ReadAll(res.Body) - res.Body.Close() - res.Body = io.NopCloser(bytes.NewBuffer(resBody)) - if err != nil { - return returnValue, err - } - - if res.StatusCode >= 300 { - newErr := &APIError{ - Message: string(resBody), - Status: res.StatusCode, - } - if res.StatusCode == 404 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 422 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 500 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - } - return returnValue, newErr - } - - err = c.decode(&returnValue, resBody, res.Header.Get("Content-Type")) - if err != nil { - return returnValue, reportError("cannot decode result: %w", err) - } - - return returnValue, nil -} - -func (r *ApiFetchUserProfileRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - if v, ok := req["userID"]; ok { - err = json.Unmarshal(v, &r.userID) - if err != nil { - err = json.Unmarshal(b, &r.userID) - if err != nil { - return err - } - } - } - if v, ok := req["params"]; ok { - err = json.Unmarshal(v, &r.params) - if err != nil { - err = json.Unmarshal(b, &r.params) - if err != nil { - return err - } - } - } else { - err = json.Unmarshal(b, &r.params) - if err != nil { - return err - } - } - - return nil -} - -// ApiFetchUserProfileRequest represents the request with all the parameters for the API call. -type ApiFetchUserProfileRequest struct { - userID string - params *Params -} - -// NewApiFetchUserProfileRequest creates an instance of the ApiFetchUserProfileRequest to be used for the API call. -func (c *APIClient) NewApiFetchUserProfileRequest(userID string, params *Params) ApiFetchUserProfileRequest { - return ApiFetchUserProfileRequest{ - userID: userID, - params: params, - } -} - -/* -FetchUserProfile Get user profile. Wraps FetchUserProfileWithContext using context.Background. - -Get predictions, properties (raw, computed or custom) and segments (computed or custom) for a user profile. - -Request can be constructed by NewApiFetchUserProfileRequest with parameters below. - - @param userID string - User ID for authenticated users or cookie ID for non-authenticated repeated users (visitors). - @param params Params - @return UserProfile -*/ -func (c *APIClient) FetchUserProfile(r ApiFetchUserProfileRequest, opts ...Option) (*UserProfile, error) { - return c.FetchUserProfileWithContext(context.Background(), r, opts...) -} - -/* -FetchUserProfile Get user profile. - -Get predictions, properties (raw, computed or custom) and segments (computed or custom) for a user profile. - -Request can be constructed by NewApiFetchUserProfileRequest with parameters below. - - @param userID string - User ID for authenticated users or cookie ID for non-authenticated repeated users (visitors). - @param params Params - @return UserProfile -*/ -func (c *APIClient) FetchUserProfileWithContext(ctx context.Context, r ApiFetchUserProfileRequest, opts ...Option) (*UserProfile, error) { - var ( - postBody any - returnValue *UserProfile - ) - - requestPath := "/1/users/{userID}/fetch" - requestPath = strings.Replace(requestPath, "{"+"userID"+"}", url.PathEscape(parameterToString(r.userID)), -1) - - headers := make(map[string]string) - queryParams := url.Values{} - if r.params == nil { - return returnValue, reportError("params is required and must be specified") - } - - // optional params if any - for _, opt := range opts { - switch opt.optionType { - case "query": - queryParams.Set(opt.name, opt.value) - case "header": - headers[opt.name] = opt.value - } - } - - // body params - postBody = r.params - req, err := c.prepareRequest(ctx, requestPath, http.MethodPost, postBody, headers, queryParams) - if err != nil { - return returnValue, err - } - - res, err := c.callAPI(req, call.Write) - if err != nil { - return returnValue, err - } - if res == nil { - return returnValue, reportError("res is nil") - } - - resBody, err := io.ReadAll(res.Body) - res.Body.Close() - res.Body = io.NopCloser(bytes.NewBuffer(resBody)) - if err != nil { - return returnValue, err - } - - if res.StatusCode >= 300 { - newErr := &APIError{ - Message: string(resBody), - Status: res.StatusCode, - } - if res.StatusCode == 400 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 404 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 405 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - } - return returnValue, newErr - } - - err = c.decode(&returnValue, resBody, res.Header.Get("Content-Type")) - if err != nil { - return returnValue, reportError("cannot decode result: %w", err) - } - - return returnValue, nil -} - -func (r *ApiGetRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - if v, ok := req["path"]; ok { - err = json.Unmarshal(v, &r.path) - if err != nil { - err = json.Unmarshal(b, &r.path) - if err != nil { - return err - } - } - } - if v, ok := req["parameters"]; ok { - err = json.Unmarshal(v, &r.parameters) - if err != nil { - err = json.Unmarshal(b, &r.parameters) - if err != nil { - return err - } - } - } - - return nil -} - -// ApiGetRequest represents the request with all the parameters for the API call. -type ApiGetRequest struct { - path string - parameters map[string]interface{} -} - -// NewApiGetRequest creates an instance of the ApiGetRequest to be used for the API call. -func (c *APIClient) NewApiGetRequest(path string) ApiGetRequest { - return ApiGetRequest{ - path: path, - } -} - -// WithParameters adds the parameters to the ApiGetRequest and returns the request for chaining. -func (r ApiGetRequest) WithParameters(parameters map[string]interface{}) ApiGetRequest { - r.parameters = parameters - return r -} - -/* -Get Send requests to the Algolia REST API. Wraps GetWithContext using context.Background. - -This method allow you to send requests to the Algolia REST API. - -Request can be constructed by NewApiGetRequest with parameters below. - - @param path string - Path of the endpoint, anything after \"/1\" must be specified. - @param parameters map[string]interface{} - Query parameters to apply to the current query. - @return map[string]interface{} -*/ -func (c *APIClient) Get(r ApiGetRequest, opts ...Option) (map[string]interface{}, error) { - return c.GetWithContext(context.Background(), r, opts...) -} - -/* -Get Send requests to the Algolia REST API. - -This method allow you to send requests to the Algolia REST API. - -Request can be constructed by NewApiGetRequest with parameters below. - - @param path string - Path of the endpoint, anything after \"/1\" must be specified. - @param parameters map[string]interface{} - Query parameters to apply to the current query. - @return map[string]interface{} -*/ -func (c *APIClient) GetWithContext(ctx context.Context, r ApiGetRequest, opts ...Option) (map[string]interface{}, error) { - var ( - postBody any - returnValue map[string]interface{} - ) - - requestPath := "/1{path}" - requestPath = strings.Replace(requestPath, "{"+"path"+"}", url.PathEscape(parameterToString(r.path)), -1) - - headers := make(map[string]string) - queryParams := url.Values{} - - if !isNilorEmpty(r.parameters) { - for k, v := range r.parameters { - queryParams.Set(k, parameterToString(v)) - } - } - - // optional params if any - for _, opt := range opts { - switch opt.optionType { - case "query": - queryParams.Set(opt.name, opt.value) - case "header": - headers[opt.name] = opt.value - } - } - - req, err := c.prepareRequest(ctx, requestPath, http.MethodGet, postBody, headers, queryParams) - if err != nil { - return returnValue, err - } - - res, err := c.callAPI(req, call.Write) - if err != nil { - return returnValue, err - } - if res == nil { - return returnValue, reportError("res is nil") - } - - resBody, err := io.ReadAll(res.Body) - res.Body.Close() - res.Body = io.NopCloser(bytes.NewBuffer(resBody)) - if err != nil { - return returnValue, err - } - - if res.StatusCode >= 300 { - newErr := &APIError{ - Message: string(resBody), - Status: res.StatusCode, - } - if res.StatusCode == 400 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 402 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 403 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 404 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - } - return returnValue, newErr - } - - err = c.decode(&returnValue, resBody, res.Header.Get("Content-Type")) - if err != nil { - return returnValue, reportError("cannot decode result: %w", err) - } - - return returnValue, nil -} - -/* -GetAvailableModelTypes Get a list of available model types. Wraps GetAvailableModelTypesWithContext using context.Background. - -Get a list of all available model types. Each model type can be activated more than once, by selecting a different data source. - -Request can be constructed by NewApiGetAvailableModelTypesRequest with parameters below. - - @return []GetAvailableModelTypesResponseInner -*/ -func (c *APIClient) GetAvailableModelTypes(opts ...Option) ([]GetAvailableModelTypesResponseInner, error) { - return c.GetAvailableModelTypesWithContext(context.Background(), opts...) -} - -/* -GetAvailableModelTypes 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. - -Request can be constructed by NewApiGetAvailableModelTypesRequest with parameters below. - - @return []GetAvailableModelTypesResponseInner -*/ -func (c *APIClient) GetAvailableModelTypesWithContext(ctx context.Context, opts ...Option) ([]GetAvailableModelTypesResponseInner, error) { - var ( - postBody any - returnValue []GetAvailableModelTypesResponseInner - ) - - requestPath := "/1/predict/modeltypes" - - headers := make(map[string]string) - queryParams := url.Values{} - - // optional params if any - for _, opt := range opts { - switch opt.optionType { - case "query": - queryParams.Set(opt.name, opt.value) - case "header": - headers[opt.name] = opt.value - } - } - - req, err := c.prepareRequest(ctx, requestPath, http.MethodGet, postBody, headers, queryParams) - if err != nil { - return returnValue, err - } - - res, err := c.callAPI(req, call.Write) - if err != nil { - return returnValue, err - } - if res == nil { - return returnValue, reportError("res is nil") - } - - resBody, err := io.ReadAll(res.Body) - res.Body.Close() - res.Body = io.NopCloser(bytes.NewBuffer(resBody)) - if err != nil { - return returnValue, err - } - - if res.StatusCode >= 300 { - newErr := &APIError{ - Message: string(resBody), - Status: res.StatusCode, - } - if res.StatusCode == 401 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 422 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 500 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - } - return returnValue, newErr - } - - err = c.decode(&returnValue, resBody, res.Header.Get("Content-Type")) - if err != nil { - return returnValue, reportError("cannot decode result: %w", err) - } - - return returnValue, nil -} - -func (r *ApiGetModelInstanceConfigRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - if v, ok := req["modelID"]; ok { - err = json.Unmarshal(v, &r.modelID) - if err != nil { - err = json.Unmarshal(b, &r.modelID) - if err != nil { - return err - } - } - } - - return nil -} - -// ApiGetModelInstanceConfigRequest represents the request with all the parameters for the API call. -type ApiGetModelInstanceConfigRequest struct { - modelID string -} - -// NewApiGetModelInstanceConfigRequest creates an instance of the ApiGetModelInstanceConfigRequest to be used for the API call. -func (c *APIClient) NewApiGetModelInstanceConfigRequest(modelID string) ApiGetModelInstanceConfigRequest { - return ApiGetModelInstanceConfigRequest{ - modelID: modelID, - } -} - -/* -GetModelInstanceConfig Get a model’s instance configuration. Wraps GetModelInstanceConfigWithContext using context.Background. - -Get the configuration for a model that was activated. - -Request can be constructed by NewApiGetModelInstanceConfigRequest with parameters below. - - @param modelID string - The ID of the model to retrieve. - @return ModelInstance -*/ -func (c *APIClient) GetModelInstanceConfig(r ApiGetModelInstanceConfigRequest, opts ...Option) (*ModelInstance, error) { - return c.GetModelInstanceConfigWithContext(context.Background(), r, opts...) -} - -/* -GetModelInstanceConfig Get a model’s instance configuration. - -Get the configuration for a model that was activated. - -Request can be constructed by NewApiGetModelInstanceConfigRequest with parameters below. - - @param modelID string - The ID of the model to retrieve. - @return ModelInstance -*/ -func (c *APIClient) GetModelInstanceConfigWithContext(ctx context.Context, r ApiGetModelInstanceConfigRequest, opts ...Option) (*ModelInstance, error) { - var ( - postBody any - returnValue *ModelInstance - ) - - requestPath := "/1/predict/models/{modelID}" - requestPath = strings.Replace(requestPath, "{"+"modelID"+"}", url.PathEscape(parameterToString(r.modelID)), -1) - - headers := make(map[string]string) - queryParams := url.Values{} - - // optional params if any - for _, opt := range opts { - switch opt.optionType { - case "query": - queryParams.Set(opt.name, opt.value) - case "header": - headers[opt.name] = opt.value - } - } - - req, err := c.prepareRequest(ctx, requestPath, http.MethodGet, postBody, headers, queryParams) - if err != nil { - return returnValue, err - } - - res, err := c.callAPI(req, call.Write) - if err != nil { - return returnValue, err - } - if res == nil { - return returnValue, reportError("res is nil") - } - - resBody, err := io.ReadAll(res.Body) - res.Body.Close() - res.Body = io.NopCloser(bytes.NewBuffer(resBody)) - if err != nil { - return returnValue, err - } - - if res.StatusCode >= 300 { - newErr := &APIError{ - Message: string(resBody), - Status: res.StatusCode, - } - if res.StatusCode == 401 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 404 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 422 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 500 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - } - return returnValue, newErr - } - - err = c.decode(&returnValue, resBody, res.Header.Get("Content-Type")) - if err != nil { - return returnValue, reportError("cannot decode result: %w", err) - } - - return returnValue, nil -} - -/* -GetModelInstances Get model instances. Wraps GetModelInstancesWithContext using context.Background. - -Get a list of all model instances. - -Request can be constructed by NewApiGetModelInstancesRequest with parameters below. - - @return []ModelInstance -*/ -func (c *APIClient) GetModelInstances(opts ...Option) ([]ModelInstance, error) { - return c.GetModelInstancesWithContext(context.Background(), opts...) -} - -/* -GetModelInstances Get model instances. - -Get a list of all model instances. - -Request can be constructed by NewApiGetModelInstancesRequest with parameters below. - - @return []ModelInstance -*/ -func (c *APIClient) GetModelInstancesWithContext(ctx context.Context, opts ...Option) ([]ModelInstance, error) { - var ( - postBody any - returnValue []ModelInstance - ) - - requestPath := "/1/predict/models" - - headers := make(map[string]string) - queryParams := url.Values{} - - // optional params if any - for _, opt := range opts { - switch opt.optionType { - case "query": - queryParams.Set(opt.name, opt.value) - case "header": - headers[opt.name] = opt.value - } - } - - req, err := c.prepareRequest(ctx, requestPath, http.MethodGet, postBody, headers, queryParams) - if err != nil { - return returnValue, err - } - - res, err := c.callAPI(req, call.Write) - if err != nil { - return returnValue, err - } - if res == nil { - return returnValue, reportError("res is nil") - } - - resBody, err := io.ReadAll(res.Body) - res.Body.Close() - res.Body = io.NopCloser(bytes.NewBuffer(resBody)) - if err != nil { - return returnValue, err - } - - if res.StatusCode >= 300 { - newErr := &APIError{ - Message: string(resBody), - Status: res.StatusCode, - } - if res.StatusCode == 401 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 422 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 500 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - } - return returnValue, newErr - } - - err = c.decode(&returnValue, resBody, res.Header.Get("Content-Type")) - if err != nil { - return returnValue, reportError("cannot decode result: %w", err) - } - - return returnValue, nil -} - -func (r *ApiGetModelMetricsRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - if v, ok := req["modelID"]; ok { - err = json.Unmarshal(v, &r.modelID) - if err != nil { - err = json.Unmarshal(b, &r.modelID) - if err != nil { - return err - } - } - } - - return nil -} - -// ApiGetModelMetricsRequest represents the request with all the parameters for the API call. -type ApiGetModelMetricsRequest struct { - modelID string -} - -// NewApiGetModelMetricsRequest creates an instance of the ApiGetModelMetricsRequest to be used for the API call. -func (c *APIClient) NewApiGetModelMetricsRequest(modelID string) ApiGetModelMetricsRequest { - return ApiGetModelMetricsRequest{ - modelID: modelID, - } -} - -/* -GetModelMetrics Get a model’s instance metrics. Wraps GetModelMetricsWithContext using context.Background. - -Get the model instance’ training metrics. - -Request can be constructed by NewApiGetModelMetricsRequest with parameters below. - - @param modelID string - The ID of the model to retrieve. - @return GetModelMetricsResponse -*/ -func (c *APIClient) GetModelMetrics(r ApiGetModelMetricsRequest, opts ...Option) (*GetModelMetricsResponse, error) { - return c.GetModelMetricsWithContext(context.Background(), r, opts...) -} - -/* -GetModelMetrics Get a model’s instance metrics. - -Get the model instance’ training metrics. - -Request can be constructed by NewApiGetModelMetricsRequest with parameters below. - - @param modelID string - The ID of the model to retrieve. - @return GetModelMetricsResponse -*/ -func (c *APIClient) GetModelMetricsWithContext(ctx context.Context, r ApiGetModelMetricsRequest, opts ...Option) (*GetModelMetricsResponse, error) { - var ( - postBody any - returnValue *GetModelMetricsResponse - ) - - requestPath := "/1/predict/models/{modelID}/metrics" - requestPath = strings.Replace(requestPath, "{"+"modelID"+"}", url.PathEscape(parameterToString(r.modelID)), -1) - - headers := make(map[string]string) - queryParams := url.Values{} - - // optional params if any - for _, opt := range opts { - switch opt.optionType { - case "query": - queryParams.Set(opt.name, opt.value) - case "header": - headers[opt.name] = opt.value - } - } - - req, err := c.prepareRequest(ctx, requestPath, http.MethodGet, postBody, headers, queryParams) - if err != nil { - return returnValue, err - } - - res, err := c.callAPI(req, call.Write) - if err != nil { - return returnValue, err - } - if res == nil { - return returnValue, reportError("res is nil") - } - - resBody, err := io.ReadAll(res.Body) - res.Body.Close() - res.Body = io.NopCloser(bytes.NewBuffer(resBody)) - if err != nil { - return returnValue, err - } - - if res.StatusCode >= 300 { - newErr := &APIError{ - Message: string(resBody), - Status: res.StatusCode, - } - if res.StatusCode == 401 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 404 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 422 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 500 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - } - return returnValue, newErr - } - - err = c.decode(&returnValue, resBody, res.Header.Get("Content-Type")) - if err != nil { - return returnValue, reportError("cannot decode result: %w", err) - } - - return returnValue, nil -} - -func (r *ApiGetSegmentUsersRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - if v, ok := req["segmentID"]; ok { - err = json.Unmarshal(v, &r.segmentID) - if err != nil { - err = json.Unmarshal(b, &r.segmentID) - if err != nil { - return err - } - } - } - if v, ok := req["fetchAllUserProfilesParams"]; ok { - err = json.Unmarshal(v, &r.fetchAllUserProfilesParams) - if err != nil { - err = json.Unmarshal(b, &r.fetchAllUserProfilesParams) - if err != nil { - return err - } - } - } else { - err = json.Unmarshal(b, &r.fetchAllUserProfilesParams) - if err != nil { - return err - } - } - - return nil -} - -// ApiGetSegmentUsersRequest represents the request with all the parameters for the API call. -type ApiGetSegmentUsersRequest struct { - segmentID string - fetchAllUserProfilesParams *FetchAllUserProfilesParams -} - -// NewApiGetSegmentUsersRequest creates an instance of the ApiGetSegmentUsersRequest to be used for the API call. -func (c *APIClient) NewApiGetSegmentUsersRequest(segmentID string, fetchAllUserProfilesParams *FetchAllUserProfilesParams) ApiGetSegmentUsersRequest { - return ApiGetSegmentUsersRequest{ - segmentID: segmentID, - fetchAllUserProfilesParams: fetchAllUserProfilesParams, - } -} - -/* -GetSegmentUsers Get segment users. Wraps GetSegmentUsersWithContext using context.Background. - -Get the profiles of users that belong to a segment. - -Request can be constructed by NewApiGetSegmentUsersRequest with parameters below. - - @param segmentID string - The ID of the Segment to fetch. - @param fetchAllUserProfilesParams FetchAllUserProfilesParams - @return GetSegmentUsersResponse -*/ -func (c *APIClient) GetSegmentUsers(r ApiGetSegmentUsersRequest, opts ...Option) (*GetSegmentUsersResponse, error) { - return c.GetSegmentUsersWithContext(context.Background(), r, opts...) -} - -/* -GetSegmentUsers Get segment users. - -Get the profiles of users that belong to a segment. - -Request can be constructed by NewApiGetSegmentUsersRequest with parameters below. - - @param segmentID string - The ID of the Segment to fetch. - @param fetchAllUserProfilesParams FetchAllUserProfilesParams - @return GetSegmentUsersResponse -*/ -func (c *APIClient) GetSegmentUsersWithContext(ctx context.Context, r ApiGetSegmentUsersRequest, opts ...Option) (*GetSegmentUsersResponse, error) { - var ( - postBody any - returnValue *GetSegmentUsersResponse - ) - - requestPath := "/1/segments/{segmentID}/users" - requestPath = strings.Replace(requestPath, "{"+"segmentID"+"}", url.PathEscape(parameterToString(r.segmentID)), -1) - - headers := make(map[string]string) - queryParams := url.Values{} - if r.fetchAllUserProfilesParams == nil { - return returnValue, reportError("fetchAllUserProfilesParams is required and must be specified") - } - - // optional params if any - for _, opt := range opts { - switch opt.optionType { - case "query": - queryParams.Set(opt.name, opt.value) - case "header": - headers[opt.name] = opt.value - } - } - - // body params - postBody = r.fetchAllUserProfilesParams - req, err := c.prepareRequest(ctx, requestPath, http.MethodPost, postBody, headers, queryParams) - if err != nil { - return returnValue, err - } - - res, err := c.callAPI(req, call.Write) - if err != nil { - return returnValue, err - } - if res == nil { - return returnValue, reportError("res is nil") - } - - resBody, err := io.ReadAll(res.Body) - res.Body.Close() - res.Body = io.NopCloser(bytes.NewBuffer(resBody)) - if err != nil { - return returnValue, err - } - - if res.StatusCode >= 300 { - newErr := &APIError{ - Message: string(resBody), - Status: res.StatusCode, - } - if res.StatusCode == 400 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 401 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 404 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 422 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 500 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - } - return returnValue, newErr - } - - err = c.decode(&returnValue, resBody, res.Header.Get("Content-Type")) - if err != nil { - return returnValue, reportError("cannot decode result: %w", err) - } - - return returnValue, nil -} - -func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - if v, ok := req["path"]; ok { - err = json.Unmarshal(v, &r.path) - if err != nil { - err = json.Unmarshal(b, &r.path) - if err != nil { - return err - } - } - } - if v, ok := req["parameters"]; ok { - err = json.Unmarshal(v, &r.parameters) - if err != nil { - err = json.Unmarshal(b, &r.parameters) - if err != nil { - return err - } - } - } - if v, ok := req["body"]; ok { - err = json.Unmarshal(v, &r.body) - if err != nil { - err = json.Unmarshal(b, &r.body) - if err != nil { - return err - } - } - } - - return nil -} - -// ApiPostRequest represents the request with all the parameters for the API call. -type ApiPostRequest struct { - path string - parameters map[string]interface{} - body map[string]interface{} -} - -// NewApiPostRequest creates an instance of the ApiPostRequest to be used for the API call. -func (c *APIClient) NewApiPostRequest(path string) ApiPostRequest { - return ApiPostRequest{ - path: path, - } -} - -// WithParameters adds the parameters to the ApiPostRequest and returns the request for chaining. -func (r ApiPostRequest) WithParameters(parameters map[string]interface{}) ApiPostRequest { - r.parameters = parameters - return r -} - -// WithBody adds the body to the ApiPostRequest and returns the request for chaining. -func (r ApiPostRequest) WithBody(body map[string]interface{}) ApiPostRequest { - r.body = body - return r -} - -/* -Post Send requests to the Algolia REST API. Wraps PostWithContext using context.Background. - -This method allow you to send requests to the Algolia REST API. - -Request can be constructed by NewApiPostRequest with parameters below. - - @param path string - Path of the endpoint, anything after \"/1\" must be specified. - @param parameters map[string]interface{} - Query parameters to apply to the current query. - @param body map[string]interface{} - Parameters to send with the custom request. - @return map[string]interface{} -*/ -func (c *APIClient) Post(r ApiPostRequest, opts ...Option) (map[string]interface{}, error) { - return c.PostWithContext(context.Background(), r, opts...) -} - -/* -Post Send requests to the Algolia REST API. - -This method allow you to send requests to the Algolia REST API. - -Request can be constructed by NewApiPostRequest with parameters below. - - @param path string - Path of the endpoint, anything after \"/1\" must be specified. - @param parameters map[string]interface{} - Query parameters to apply to the current query. - @param body map[string]interface{} - Parameters to send with the custom request. - @return map[string]interface{} -*/ -func (c *APIClient) PostWithContext(ctx context.Context, r ApiPostRequest, opts ...Option) (map[string]interface{}, error) { - var ( - postBody any - returnValue map[string]interface{} - ) - - requestPath := "/1{path}" - requestPath = strings.Replace(requestPath, "{"+"path"+"}", url.PathEscape(parameterToString(r.path)), -1) - - headers := make(map[string]string) - queryParams := url.Values{} - - if !isNilorEmpty(r.parameters) { - for k, v := range r.parameters { - queryParams.Set(k, parameterToString(v)) - } - } - - // optional params if any - for _, opt := range opts { - switch opt.optionType { - case "query": - queryParams.Set(opt.name, opt.value) - case "header": - headers[opt.name] = opt.value - } - } - - // body params - if isNilorEmpty(r.body) { - postBody = "{}" - } else { - postBody = r.body - } - req, err := c.prepareRequest(ctx, requestPath, http.MethodPost, postBody, headers, queryParams) - if err != nil { - return returnValue, err - } - - res, err := c.callAPI(req, call.Write) - if err != nil { - return returnValue, err - } - if res == nil { - return returnValue, reportError("res is nil") - } - - resBody, err := io.ReadAll(res.Body) - res.Body.Close() - res.Body = io.NopCloser(bytes.NewBuffer(resBody)) - if err != nil { - return returnValue, err - } - - if res.StatusCode >= 300 { - newErr := &APIError{ - Message: string(resBody), - Status: res.StatusCode, - } - if res.StatusCode == 400 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 402 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 403 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 404 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - } - return returnValue, newErr - } - - err = c.decode(&returnValue, resBody, res.Header.Get("Content-Type")) - if err != nil { - return returnValue, reportError("cannot decode result: %w", err) - } - - return returnValue, nil -} - -func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - if v, ok := req["path"]; ok { - err = json.Unmarshal(v, &r.path) - if err != nil { - err = json.Unmarshal(b, &r.path) - if err != nil { - return err - } - } - } - if v, ok := req["parameters"]; ok { - err = json.Unmarshal(v, &r.parameters) - if err != nil { - err = json.Unmarshal(b, &r.parameters) - if err != nil { - return err - } - } - } - if v, ok := req["body"]; ok { - err = json.Unmarshal(v, &r.body) - if err != nil { - err = json.Unmarshal(b, &r.body) - if err != nil { - return err - } - } - } - - return nil -} - -// ApiPutRequest represents the request with all the parameters for the API call. -type ApiPutRequest struct { - path string - parameters map[string]interface{} - body map[string]interface{} -} - -// NewApiPutRequest creates an instance of the ApiPutRequest to be used for the API call. -func (c *APIClient) NewApiPutRequest(path string) ApiPutRequest { - return ApiPutRequest{ - path: path, - } -} - -// WithParameters adds the parameters to the ApiPutRequest and returns the request for chaining. -func (r ApiPutRequest) WithParameters(parameters map[string]interface{}) ApiPutRequest { - r.parameters = parameters - return r -} - -// WithBody adds the body to the ApiPutRequest and returns the request for chaining. -func (r ApiPutRequest) WithBody(body map[string]interface{}) ApiPutRequest { - r.body = body - return r -} - -/* -Put Send requests to the Algolia REST API. Wraps PutWithContext using context.Background. - -This method allow you to send requests to the Algolia REST API. - -Request can be constructed by NewApiPutRequest with parameters below. - - @param path string - Path of the endpoint, anything after \"/1\" must be specified. - @param parameters map[string]interface{} - Query parameters to apply to the current query. - @param body map[string]interface{} - Parameters to send with the custom request. - @return map[string]interface{} -*/ -func (c *APIClient) Put(r ApiPutRequest, opts ...Option) (map[string]interface{}, error) { - return c.PutWithContext(context.Background(), r, opts...) -} - -/* -Put Send requests to the Algolia REST API. - -This method allow you to send requests to the Algolia REST API. - -Request can be constructed by NewApiPutRequest with parameters below. - - @param path string - Path of the endpoint, anything after \"/1\" must be specified. - @param parameters map[string]interface{} - Query parameters to apply to the current query. - @param body map[string]interface{} - Parameters to send with the custom request. - @return map[string]interface{} -*/ -func (c *APIClient) PutWithContext(ctx context.Context, r ApiPutRequest, opts ...Option) (map[string]interface{}, error) { - var ( - postBody any - returnValue map[string]interface{} - ) - - requestPath := "/1{path}" - requestPath = strings.Replace(requestPath, "{"+"path"+"}", url.PathEscape(parameterToString(r.path)), -1) - - headers := make(map[string]string) - queryParams := url.Values{} - - if !isNilorEmpty(r.parameters) { - for k, v := range r.parameters { - queryParams.Set(k, parameterToString(v)) - } - } - - // optional params if any - for _, opt := range opts { - switch opt.optionType { - case "query": - queryParams.Set(opt.name, opt.value) - case "header": - headers[opt.name] = opt.value - } - } - - // body params - if isNilorEmpty(r.body) { - postBody = "{}" - } else { - postBody = r.body - } - req, err := c.prepareRequest(ctx, requestPath, http.MethodPut, postBody, headers, queryParams) - if err != nil { - return returnValue, err - } - - res, err := c.callAPI(req, call.Write) - if err != nil { - return returnValue, err - } - if res == nil { - return returnValue, reportError("res is nil") - } - - resBody, err := io.ReadAll(res.Body) - res.Body.Close() - res.Body = io.NopCloser(bytes.NewBuffer(resBody)) - if err != nil { - return returnValue, err - } - - if res.StatusCode >= 300 { - newErr := &APIError{ - Message: string(resBody), - Status: res.StatusCode, - } - if res.StatusCode == 400 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 402 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 403 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 404 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - } - return returnValue, newErr - } - - err = c.decode(&returnValue, resBody, res.Header.Get("Content-Type")) - if err != nil { - return returnValue, reportError("cannot decode result: %w", err) - } - - return returnValue, nil -} - -func (r *ApiUpdateModelInstanceRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - if v, ok := req["modelID"]; ok { - err = json.Unmarshal(v, &r.modelID) - if err != nil { - err = json.Unmarshal(b, &r.modelID) - if err != nil { - return err - } - } - } - if v, ok := req["updateModelParams"]; ok { - err = json.Unmarshal(v, &r.updateModelParams) - if err != nil { - err = json.Unmarshal(b, &r.updateModelParams) - if err != nil { - return err - } - } - } else { - err = json.Unmarshal(b, &r.updateModelParams) - if err != nil { - return err - } - } - - return nil -} - -// ApiUpdateModelInstanceRequest represents the request with all the parameters for the API call. -type ApiUpdateModelInstanceRequest struct { - modelID string - updateModelParams *UpdateModelParams -} - -// NewApiUpdateModelInstanceRequest creates an instance of the ApiUpdateModelInstanceRequest to be used for the API call. -func (c *APIClient) NewApiUpdateModelInstanceRequest(modelID string, updateModelParams *UpdateModelParams) ApiUpdateModelInstanceRequest { - return ApiUpdateModelInstanceRequest{ - modelID: modelID, - updateModelParams: updateModelParams, - } -} - -/* -UpdateModelInstance Update a model instance. Wraps UpdateModelInstanceWithContext using context.Background. - -Update a model’s configuration. - -Request can be constructed by NewApiUpdateModelInstanceRequest with parameters below. - - @param modelID string - The ID of the model to retrieve. - @param updateModelParams UpdateModelParams - @return UpdateModelInstanceResponse -*/ -func (c *APIClient) UpdateModelInstance(r ApiUpdateModelInstanceRequest, opts ...Option) (*UpdateModelInstanceResponse, error) { - return c.UpdateModelInstanceWithContext(context.Background(), r, opts...) -} - -/* -UpdateModelInstance Update a model instance. - -Update a model’s configuration. - -Request can be constructed by NewApiUpdateModelInstanceRequest with parameters below. - - @param modelID string - The ID of the model to retrieve. - @param updateModelParams UpdateModelParams - @return UpdateModelInstanceResponse -*/ -func (c *APIClient) UpdateModelInstanceWithContext(ctx context.Context, r ApiUpdateModelInstanceRequest, opts ...Option) (*UpdateModelInstanceResponse, error) { - var ( - postBody any - returnValue *UpdateModelInstanceResponse - ) - - requestPath := "/1/predict/models/{modelID}" - requestPath = strings.Replace(requestPath, "{"+"modelID"+"}", url.PathEscape(parameterToString(r.modelID)), -1) - - headers := make(map[string]string) - queryParams := url.Values{} - if r.updateModelParams == nil { - return returnValue, reportError("updateModelParams is required and must be specified") - } - - // optional params if any - for _, opt := range opts { - switch opt.optionType { - case "query": - queryParams.Set(opt.name, opt.value) - case "header": - headers[opt.name] = opt.value - } - } - - // body params - postBody = r.updateModelParams - req, err := c.prepareRequest(ctx, requestPath, http.MethodPost, postBody, headers, queryParams) - if err != nil { - return returnValue, err - } - - res, err := c.callAPI(req, call.Write) - if err != nil { - return returnValue, err - } - if res == nil { - return returnValue, reportError("res is nil") - } - - resBody, err := io.ReadAll(res.Body) - res.Body.Close() - res.Body = io.NopCloser(bytes.NewBuffer(resBody)) - if err != nil { - return returnValue, err - } - - if res.StatusCode >= 300 { - newErr := &APIError{ - Message: string(resBody), - Status: res.StatusCode, - } - if res.StatusCode == 401 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 404 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 422 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 500 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - } - return returnValue, newErr - } - - err = c.decode(&returnValue, resBody, res.Header.Get("Content-Type")) - if err != nil { - return returnValue, reportError("cannot decode result: %w", err) - } - - return returnValue, nil -} - -func (r *ApiUpdateSegmentRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - if v, ok := req["segmentID"]; ok { - err = json.Unmarshal(v, &r.segmentID) - if err != nil { - err = json.Unmarshal(b, &r.segmentID) - if err != nil { - return err - } - } - } - if v, ok := req["updateSegmentParams"]; ok { - err = json.Unmarshal(v, &r.updateSegmentParams) - if err != nil { - err = json.Unmarshal(b, &r.updateSegmentParams) - if err != nil { - return err - } - } - } else { - err = json.Unmarshal(b, &r.updateSegmentParams) - if err != nil { - return err - } - } - - return nil -} - -// ApiUpdateSegmentRequest represents the request with all the parameters for the API call. -type ApiUpdateSegmentRequest struct { - segmentID string - updateSegmentParams *UpdateSegmentParams -} - -// NewApiUpdateSegmentRequest creates an instance of the ApiUpdateSegmentRequest to be used for the API call. -func (c *APIClient) NewApiUpdateSegmentRequest(segmentID string, updateSegmentParams *UpdateSegmentParams) ApiUpdateSegmentRequest { - return ApiUpdateSegmentRequest{ - segmentID: segmentID, - updateSegmentParams: updateSegmentParams, - } -} - -/* -UpdateSegment Update segment. Wraps UpdateSegmentWithContext using context.Background. - -Update a segment’s configuration. - -Request can be constructed by NewApiUpdateSegmentRequest with parameters below. - - @param segmentID string - The ID of the Segment to fetch. - @param updateSegmentParams UpdateSegmentParams - @return UpdateSegmentResponse -*/ -func (c *APIClient) UpdateSegment(r ApiUpdateSegmentRequest, opts ...Option) (*UpdateSegmentResponse, error) { - return c.UpdateSegmentWithContext(context.Background(), r, opts...) -} - -/* -UpdateSegment Update segment. - -Update a segment’s configuration. - -Request can be constructed by NewApiUpdateSegmentRequest with parameters below. - - @param segmentID string - The ID of the Segment to fetch. - @param updateSegmentParams UpdateSegmentParams - @return UpdateSegmentResponse -*/ -func (c *APIClient) UpdateSegmentWithContext(ctx context.Context, r ApiUpdateSegmentRequest, opts ...Option) (*UpdateSegmentResponse, error) { - var ( - postBody any - returnValue *UpdateSegmentResponse - ) - - requestPath := "/1/segments/{segmentID}" - requestPath = strings.Replace(requestPath, "{"+"segmentID"+"}", url.PathEscape(parameterToString(r.segmentID)), -1) - - headers := make(map[string]string) - queryParams := url.Values{} - if r.updateSegmentParams == nil { - return returnValue, reportError("updateSegmentParams is required and must be specified") - } - - // optional params if any - for _, opt := range opts { - switch opt.optionType { - case "query": - queryParams.Set(opt.name, opt.value) - case "header": - headers[opt.name] = opt.value - } - } - - // body params - postBody = r.updateSegmentParams - req, err := c.prepareRequest(ctx, requestPath, http.MethodPost, postBody, headers, queryParams) - if err != nil { - return returnValue, err - } - - res, err := c.callAPI(req, call.Write) - if err != nil { - return returnValue, err - } - if res == nil { - return returnValue, reportError("res is nil") - } - - resBody, err := io.ReadAll(res.Body) - res.Body.Close() - res.Body = io.NopCloser(bytes.NewBuffer(resBody)) - if err != nil { - return returnValue, err - } - - if res.StatusCode >= 300 { - newErr := &APIError{ - Message: string(resBody), - Status: res.StatusCode, - } - if res.StatusCode == 400 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 401 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 404 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 422 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - return returnValue, newErr - } - if res.StatusCode == 500 { - var v ErrorBase - err = c.decode(&v, resBody, res.Header.Get("Content-Type")) - if err != nil { - newErr.Message = err.Error() - return returnValue, newErr - } - } - return returnValue, newErr - } - - err = c.decode(&returnValue, resBody, res.Header.Get("Content-Type")) - if err != nil { - return returnValue, reportError("cannot decode result: %w", err) - } - - return returnValue, nil -} diff --git a/clients/algoliasearch-client-go/algolia/predict/client.go b/clients/algoliasearch-client-go/algolia/predict/client.go deleted file mode 100644 index 17a366b79c..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/client.go +++ /dev/null @@ -1,352 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "bytes" - "compress/gzip" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "log" - "net/http" - "net/http/httputil" - "net/url" - "reflect" - "regexp" - "runtime" - "strconv" - "strings" - "time" - - "github.com/go-playground/validator/v10" - - "github.com/algolia/algoliasearch-client-go/v4/algolia/call" - "github.com/algolia/algoliasearch-client-go/v4/algolia/compression" - "github.com/algolia/algoliasearch-client-go/v4/algolia/internal/transport" -) - -var jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) - -// APIClient manages communication with the Predict API API v1.0.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - appID string - cfg *Configuration - transport *transport.Transport -} - -// NewClient creates a new API client with appID, apiKey and region. -func NewClient(appID, apiKey string, region Region) *APIClient { - return NewClientWithConfig(Configuration{ - AppID: appID, - ApiKey: apiKey, - Region: region, - DefaultHeader: make(map[string]string), - UserAgent: getUserAgent(), - Debug: false, - Requester: newDefaultRequester(), - }) -} - -// NewClientWithConfig creates a new API client with the given configuration to fully customize the client behaviour. -func NewClientWithConfig(cfg Configuration) *APIClient { - var hosts []*transport.StatefulHost - - if cfg.AppID == "" { - panic("appID is required") - } - if cfg.ApiKey == "" { - panic("apiKey is required") - } - if len(cfg.Hosts) == 0 { - if cfg.Region == "" { - panic("region is required") - } - hosts = getDefaultHosts(cfg.Region) - } else { - for _, h := range cfg.Hosts { - hosts = append(hosts, transport.NewStatefulHost(h, call.IsReadWrite)) - } - } - if cfg.Requester == nil { - cfg.Requester = newDefaultRequester() - } - if cfg.UserAgent == "" { - cfg.UserAgent = getUserAgent() - } - - return &APIClient{ - appID: cfg.AppID, - cfg: &cfg, - transport: transport.New( - hosts, - cfg.Requester, - cfg.ReadTimeout, - cfg.WriteTimeout, - cfg.Compression, - ), - } -} - -func getDefaultHosts(r Region) []*transport.StatefulHost { - hosts := []*transport.StatefulHost{} - switch r { - case EU, US: - hosts = append(hosts, transport.NewStatefulHost(strings.Replace("predict.{region}.algolia.com", "{region}", string(r), -1), call.IsReadWrite)) - } - return hosts -} -func getUserAgent() string { - return fmt.Sprintf("Algolia for Go (4.0.0-alpha.22); Go (%s); Predict (4.0.0-alpha.22)", runtime.Version()) -} - -func atoi(in string) (int, error) { - return strconv.Atoi(in) -} - -// contains is a case insensitive match, finding needle in a haystack -func contains(haystack []string, needle string) bool { - for _, a := range haystack { - if strings.EqualFold(a, needle) { - return true - } - } - return false -} - -// Verify optional parameters are of the correct type. -func typeCheckParameter(obj any, expected string, name string) error { - // Make sure there is an object. - if obj == nil { - return nil - } - - // Check the type is as expected. - if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) - } - return nil -} - -// parameterToString convert any parameters to string. -func parameterToString(obj any) string { - if reflect.TypeOf(obj).Kind() == reflect.Slice { - return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", ",", -1), "[]") - } else if t, ok := obj.(time.Time); ok { - return t.Format(time.RFC3339) - } - - return fmt.Sprintf("%v", obj) -} - -// helper for converting any parameters to json strings -func parameterToJson(obj any) (string, error) { - jsonBuf, err := json.Marshal(obj) - if err != nil { - return "", err - } - return string(jsonBuf), err -} - -// AddDefaultHeader adds a new HTTP header to the default header in the request -func (c *APIClient) AddDefaultHeader(key string, value string) { - c.cfg.DefaultHeader[key] = value -} - -// callAPI do the request. -func (c *APIClient) callAPI(request *http.Request, kind call.Kind) (*http.Response, error) { - if c.cfg.Debug { - dump, err := httputil.DumpRequestOut(request, true) - if err != nil { - return nil, err - } - log.Printf("\n%s\n", string(dump)) - } - - resp, err := c.transport.Request(request.Context(), request, kind) - if err != nil { - return nil, err - } - - if c.cfg.Debug { - dump, err := httputil.DumpResponse(resp, true) - if err != nil { - return nil, err - } - log.Printf("\n%s\n", string(dump)) - } - return resp, nil -} - -// Allow modification of underlying config for alternate implementations and testing -// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior -func (c *APIClient) GetConfiguration() *Configuration { - return c.cfg -} - -// prepareRequest build the request -func (c *APIClient) prepareRequest( - ctx context.Context, - path string, method string, - postBody any, - headerParams map[string]string, - queryParams url.Values) (req *http.Request, err error) { - - contentType := "application/json" - - body, err := setBody(postBody, contentType, c.cfg.Compression) - if err != nil { - return nil, err - } - - // Setup path and query parameters - url, err := url.Parse(path) - if err != nil { - return nil, err - } - - // Adding Query Param - query := url.Query() - for k, v := range queryParams { - for _, iv := range v { - query.Add(k, iv) - } - } - - // Encode the parameters. - url.RawQuery = query.Encode() - - // Generate a new request - - // weird nil typing - var bodyReader io.Reader - if body != nil { - bodyReader = body - } - req, err = http.NewRequest(method, url.String(), bodyReader) - if err != nil { - return nil, err - } - - // add header parameters, if any - if len(headerParams) > 0 { - for h, v := range headerParams { - req.Header.Add(h, v) - } - } - - // Add the user agent to the request. - req.Header.Add("User-Agent", c.cfg.UserAgent) - req.Header.Add("X-Algolia-Application-Id", c.cfg.AppID) - req.Header.Add("X-Algolia-API-Key", c.cfg.ApiKey) - req.Header.Add("Content-Type", contentType) - req.Header.Add("Accept", contentType) - - if ctx != nil { - // add context to the request - req = req.WithContext(ctx) - } - - for header, value := range c.cfg.DefaultHeader { - req.Header.Add(header, value) - } - - return req, nil -} - -func (c *APIClient) decode(v any, b []byte, contentType string) (err error) { - if len(b) == 0 { - return nil - } - if s, ok := v.(*string); ok { - *s = string(b) - return nil - } - if jsonCheck.MatchString(contentType) { - if actualObj, ok := v.(interface{ GetActualInstance() any }); ok { // oneOf, anyOf schemas - if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined - if err = unmarshalObj.UnmarshalJSON(b); err != nil { - return err - } - } else { - return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") - } - } else if err = json.Unmarshal(b, v); err != nil { // simple model - return err - } - return nil - } - return errors.New("undefined response type") -} - -// Prevent trying to import "fmt" -func reportError(format string, a ...any) error { - return fmt.Errorf(format, a...) -} - -// A wrapper for strict JSON decoding -func newStrictDecoder(data []byte) *json.Decoder { - dec := json.NewDecoder(bytes.NewBuffer(data)) - dec.DisallowUnknownFields() - return dec -} - -// A wrapper for validating a struct, returns nil if value is not a struct -func validateStruct(v any) error { - err := validator.New().Struct(v) - validationErrors, ok := err.(validator.ValidationErrors) - if ok && len(validationErrors) > 0 { - return validationErrors - } - - return nil -} - -// Set request body from an any -func setBody(body any, contentType string, c compression.Compression) (bodyBuf *bytes.Buffer, err error) { - if body == nil { - return nil, nil - } - - bodyBuf = &bytes.Buffer{} - - switch c { - case compression.GZIP: - gzipWriter := gzip.NewWriter(bodyBuf) - defer gzipWriter.Close() - err = json.NewEncoder(gzipWriter).Encode(body) - default: - if reader, ok := body.(io.Reader); ok { - _, err = bodyBuf.ReadFrom(reader) - } else if b, ok := body.([]byte); ok { - _, err = bodyBuf.Write(b) - } else if s, ok := body.(string); ok { - _, err = bodyBuf.WriteString(s) - } else if s, ok := body.(*string); ok { - _, err = bodyBuf.WriteString(*s) - } else if jsonCheck.MatchString(contentType) { - err = json.NewEncoder(bodyBuf).Encode(body) - } - } - - if err != nil { - return nil, err - } - - if bodyBuf.Len() == 0 { - err = fmt.Errorf("Invalid body type %s\n", contentType) - return nil, err - } - return bodyBuf, nil -} - -type APIError struct { - Message string - Status int -} - -func (e APIError) Error() string { - return fmt.Sprintf("API error [%d] %s", e.Status, e.Message) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/configuration.go b/clients/algoliasearch-client-go/algolia/predict/configuration.go deleted file mode 100644 index 3f43acb2f5..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/configuration.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "net/http" - "time" - - "github.com/algolia/algoliasearch-client-go/v4/algolia/compression" -) - -type Requester interface { - Request(*http.Request) (*http.Response, error) -} - -type defaultRequester struct { - client *http.Client -} - -func newDefaultRequester() *defaultRequester { - return &defaultRequester{ - client: http.DefaultClient, - } -} - -func (r *defaultRequester) Request(req *http.Request) (*http.Response, error) { - return r.client.Do(req) -} - -type Region string - -const ( - EU Region = "eu" - US Region = "us" -) - -// Configuration stores the configuration of the API client -type Configuration struct { - AppID string - ApiKey string - Region Region - - Hosts []string `json:"host,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - Debug bool `json:"debug,omitempty"` - Requester Requester - ReadTimeout time.Duration - WriteTimeout time.Duration - Compression compression.Compression -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_activate_model_instance_response.go b/clients/algoliasearch-client-go/algolia/predict/model_activate_model_instance_response.go deleted file mode 100644 index d372d80348..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_activate_model_instance_response.go +++ /dev/null @@ -1,136 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// ActivateModelInstanceResponse struct for ActivateModelInstanceResponse -type ActivateModelInstanceResponse struct { - // The ID of the model. - ModelID string `json:"modelID" validate:"required"` - // Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - UpdatedAt string `json:"updatedAt" validate:"required"` -} - -// NewActivateModelInstanceResponse instantiates a new ActivateModelInstanceResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewActivateModelInstanceResponse(modelID string, updatedAt string) *ActivateModelInstanceResponse { - this := &ActivateModelInstanceResponse{} - this.ModelID = modelID - this.UpdatedAt = updatedAt - return this -} - -// NewActivateModelInstanceResponseWithDefaults instantiates a new ActivateModelInstanceResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewActivateModelInstanceResponseWithDefaults() *ActivateModelInstanceResponse { - this := &ActivateModelInstanceResponse{} - return this -} - -// GetModelID returns the ModelID field value -func (o *ActivateModelInstanceResponse) GetModelID() string { - if o == nil { - var ret string - return ret - } - - return o.ModelID -} - -// GetModelIDOk returns a tuple with the ModelID field value -// and a boolean to check if the value has been set. -func (o *ActivateModelInstanceResponse) GetModelIDOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ModelID, true -} - -// SetModelID sets field value -func (o *ActivateModelInstanceResponse) SetModelID(v string) { - o.ModelID = v -} - -// GetUpdatedAt returns the UpdatedAt field value -func (o *ActivateModelInstanceResponse) GetUpdatedAt() string { - if o == nil { - var ret string - return ret - } - - return o.UpdatedAt -} - -// GetUpdatedAtOk returns a tuple with the UpdatedAt field value -// and a boolean to check if the value has been set. -func (o *ActivateModelInstanceResponse) GetUpdatedAtOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UpdatedAt, true -} - -// SetUpdatedAt sets field value -func (o *ActivateModelInstanceResponse) SetUpdatedAt(v string) { - o.UpdatedAt = v -} - -func (o ActivateModelInstanceResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["modelID"] = o.ModelID - } - if true { - toSerialize["updatedAt"] = o.UpdatedAt - } - return json.Marshal(toSerialize) -} - -func (o ActivateModelInstanceResponse) String() string { - out := "" - out += fmt.Sprintf(" modelID=%v\n", o.ModelID) - out += fmt.Sprintf(" updatedAt=%v\n", o.UpdatedAt) - return fmt.Sprintf("ActivateModelInstanceResponse {\n%s}", out) -} - -type NullableActivateModelInstanceResponse struct { - value *ActivateModelInstanceResponse - isSet bool -} - -func (v NullableActivateModelInstanceResponse) Get() *ActivateModelInstanceResponse { - return v.value -} - -func (v *NullableActivateModelInstanceResponse) Set(val *ActivateModelInstanceResponse) { - v.value = val - v.isSet = true -} - -func (v NullableActivateModelInstanceResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableActivateModelInstanceResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActivateModelInstanceResponse(val *ActivateModelInstanceResponse) *NullableActivateModelInstanceResponse { - return &NullableActivateModelInstanceResponse{value: val, isSet: true} -} - -func (v NullableActivateModelInstanceResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActivateModelInstanceResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_activate_model_params.go b/clients/algoliasearch-client-go/algolia/predict/model_activate_model_params.go deleted file mode 100644 index 6d96a12067..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_activate_model_params.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// ActivateModelParams struct for ActivateModelParams -type ActivateModelParams struct { - Type ModelsToRetrieve `json:"type" validate:"required"` - // The model’s instance name. - Name string `json:"name" validate:"required"` - // The data source ID, as returned by the (external) sources API. - SourceID string `json:"sourceID" validate:"required"` - // The index name. - Index string `json:"index" validate:"required"` - ModelAttributes []string `json:"modelAttributes,omitempty"` -} - -type ActivateModelParamsOption func(f *ActivateModelParams) - -func WithActivateModelParamsModelAttributes(val []string) ActivateModelParamsOption { - return func(f *ActivateModelParams) { - f.ModelAttributes = val - } -} - -// NewActivateModelParams instantiates a new ActivateModelParams object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewActivateModelParams(type_ ModelsToRetrieve, name string, sourceID string, index string, opts ...ActivateModelParamsOption) *ActivateModelParams { - this := &ActivateModelParams{} - this.Type = type_ - this.Name = name - this.SourceID = sourceID - this.Index = index - for _, opt := range opts { - opt(this) - } - return this -} - -// NewActivateModelParamsWithDefaults instantiates a new ActivateModelParams object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewActivateModelParamsWithDefaults() *ActivateModelParams { - this := &ActivateModelParams{} - return this -} - -// GetType returns the Type field value -func (o *ActivateModelParams) GetType() ModelsToRetrieve { - if o == nil { - var ret ModelsToRetrieve - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *ActivateModelParams) GetTypeOk() (*ModelsToRetrieve, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *ActivateModelParams) SetType(v ModelsToRetrieve) { - o.Type = v -} - -// GetName returns the Name field value -func (o *ActivateModelParams) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *ActivateModelParams) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *ActivateModelParams) SetName(v string) { - o.Name = v -} - -// GetSourceID returns the SourceID field value -func (o *ActivateModelParams) GetSourceID() string { - if o == nil { - var ret string - return ret - } - - return o.SourceID -} - -// GetSourceIDOk returns a tuple with the SourceID field value -// and a boolean to check if the value has been set. -func (o *ActivateModelParams) GetSourceIDOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.SourceID, true -} - -// SetSourceID sets field value -func (o *ActivateModelParams) SetSourceID(v string) { - o.SourceID = v -} - -// GetIndex returns the Index field value -func (o *ActivateModelParams) GetIndex() string { - if o == nil { - var ret string - return ret - } - - return o.Index -} - -// GetIndexOk returns a tuple with the Index field value -// and a boolean to check if the value has been set. -func (o *ActivateModelParams) GetIndexOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Index, true -} - -// SetIndex sets field value -func (o *ActivateModelParams) SetIndex(v string) { - o.Index = v -} - -// GetModelAttributes returns the ModelAttributes field value if set, zero value otherwise. -func (o *ActivateModelParams) GetModelAttributes() []string { - if o == nil || o.ModelAttributes == nil { - var ret []string - return ret - } - return o.ModelAttributes -} - -// GetModelAttributesOk returns a tuple with the ModelAttributes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ActivateModelParams) GetModelAttributesOk() ([]string, bool) { - if o == nil || o.ModelAttributes == nil { - return nil, false - } - return o.ModelAttributes, true -} - -// HasModelAttributes returns a boolean if a field has been set. -func (o *ActivateModelParams) HasModelAttributes() bool { - if o != nil && o.ModelAttributes != nil { - return true - } - - return false -} - -// SetModelAttributes gets a reference to the given []string and assigns it to the ModelAttributes field. -func (o *ActivateModelParams) SetModelAttributes(v []string) { - o.ModelAttributes = v -} - -func (o ActivateModelParams) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["type"] = o.Type - } - if true { - toSerialize["name"] = o.Name - } - if true { - toSerialize["sourceID"] = o.SourceID - } - if true { - toSerialize["index"] = o.Index - } - if o.ModelAttributes != nil { - toSerialize["modelAttributes"] = o.ModelAttributes - } - return json.Marshal(toSerialize) -} - -func (o ActivateModelParams) String() string { - out := "" - out += fmt.Sprintf(" type=%v\n", o.Type) - out += fmt.Sprintf(" name=%v\n", o.Name) - out += fmt.Sprintf(" sourceID=%v\n", o.SourceID) - out += fmt.Sprintf(" index=%v\n", o.Index) - out += fmt.Sprintf(" modelAttributes=%v\n", o.ModelAttributes) - return fmt.Sprintf("ActivateModelParams {\n%s}", out) -} - -type NullableActivateModelParams struct { - value *ActivateModelParams - isSet bool -} - -func (v NullableActivateModelParams) Get() *ActivateModelParams { - return v.value -} - -func (v *NullableActivateModelParams) Set(val *ActivateModelParams) { - v.value = val - v.isSet = true -} - -func (v NullableActivateModelParams) IsSet() bool { - return v.isSet -} - -func (v *NullableActivateModelParams) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableActivateModelParams(val *ActivateModelParams) *NullableActivateModelParams { - return &NullableActivateModelParams{value: val, isSet: true} -} - -func (v NullableActivateModelParams) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableActivateModelParams) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_affinity.go b/clients/algoliasearch-client-go/algolia/predict/model_affinity.go deleted file mode 100644 index f815e8f09b..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_affinity.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// Affinity struct for Affinity -type Affinity struct { - Name string `json:"name" validate:"required"` - Value PredictionAffinityValue `json:"value" validate:"required"` - Probability float64 `json:"probability" validate:"required"` -} - -// NewAffinity instantiates a new Affinity object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewAffinity(name string, value PredictionAffinityValue, probability float64) *Affinity { - this := &Affinity{} - this.Name = name - this.Value = value - this.Probability = probability - return this -} - -// NewAffinityWithDefaults instantiates a new Affinity object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewAffinityWithDefaults() *Affinity { - this := &Affinity{} - return this -} - -// GetName returns the Name field value -func (o *Affinity) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *Affinity) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *Affinity) SetName(v string) { - o.Name = v -} - -// GetValue returns the Value field value -func (o *Affinity) GetValue() PredictionAffinityValue { - if o == nil { - var ret PredictionAffinityValue - return ret - } - - return o.Value -} - -// GetValueOk returns a tuple with the Value field value -// and a boolean to check if the value has been set. -func (o *Affinity) GetValueOk() (*PredictionAffinityValue, bool) { - if o == nil { - return nil, false - } - return &o.Value, true -} - -// SetValue sets field value -func (o *Affinity) SetValue(v PredictionAffinityValue) { - o.Value = v -} - -// GetProbability returns the Probability field value -func (o *Affinity) GetProbability() float64 { - if o == nil { - var ret float64 - return ret - } - - return o.Probability -} - -// GetProbabilityOk returns a tuple with the Probability field value -// and a boolean to check if the value has been set. -func (o *Affinity) GetProbabilityOk() (*float64, bool) { - if o == nil { - return nil, false - } - return &o.Probability, true -} - -// SetProbability sets field value -func (o *Affinity) SetProbability(v float64) { - o.Probability = v -} - -func (o Affinity) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["name"] = o.Name - } - if true { - toSerialize["value"] = o.Value - } - if true { - toSerialize["probability"] = o.Probability - } - return json.Marshal(toSerialize) -} - -func (o Affinity) String() string { - out := "" - out += fmt.Sprintf(" name=%v\n", o.Name) - out += fmt.Sprintf(" value=%v\n", o.Value) - out += fmt.Sprintf(" probability=%v\n", o.Probability) - return fmt.Sprintf("Affinity {\n%s}", out) -} - -type NullableAffinity struct { - value *Affinity - isSet bool -} - -func (v NullableAffinity) Get() *Affinity { - return v.value -} - -func (v *NullableAffinity) Set(val *Affinity) { - v.value = val - v.isSet = true -} - -func (v NullableAffinity) IsSet() bool { - return v.isSet -} - -func (v *NullableAffinity) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAffinity(val *Affinity) *NullableAffinity { - return &NullableAffinity{value: val, isSet: true} -} - -func (v NullableAffinity) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAffinity) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_all_params.go b/clients/algoliasearch-client-go/algolia/predict/model_all_params.go deleted file mode 100644 index 9dae64a8fe..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_all_params.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// AllParams struct for AllParams -type AllParams struct { - ModelsToRetrieve []ModelsToRetrieve `json:"modelsToRetrieve,omitempty"` - TypesToRetrieve []TypesToRetrieve `json:"typesToRetrieve,omitempty"` -} - -type AllParamsOption func(f *AllParams) - -func WithAllParamsModelsToRetrieve(val []ModelsToRetrieve) AllParamsOption { - return func(f *AllParams) { - f.ModelsToRetrieve = val - } -} - -func WithAllParamsTypesToRetrieve(val []TypesToRetrieve) AllParamsOption { - return func(f *AllParams) { - f.TypesToRetrieve = val - } -} - -// NewAllParams instantiates a new AllParams object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewAllParams(opts ...AllParamsOption) *AllParams { - this := &AllParams{} - for _, opt := range opts { - opt(this) - } - return this -} - -// NewAllParamsWithDefaults instantiates a new AllParams object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewAllParamsWithDefaults() *AllParams { - this := &AllParams{} - return this -} - -// GetModelsToRetrieve returns the ModelsToRetrieve field value if set, zero value otherwise. -func (o *AllParams) GetModelsToRetrieve() []ModelsToRetrieve { - if o == nil || o.ModelsToRetrieve == nil { - var ret []ModelsToRetrieve - return ret - } - return o.ModelsToRetrieve -} - -// GetModelsToRetrieveOk returns a tuple with the ModelsToRetrieve field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AllParams) GetModelsToRetrieveOk() ([]ModelsToRetrieve, bool) { - if o == nil || o.ModelsToRetrieve == nil { - return nil, false - } - return o.ModelsToRetrieve, true -} - -// HasModelsToRetrieve returns a boolean if a field has been set. -func (o *AllParams) HasModelsToRetrieve() bool { - if o != nil && o.ModelsToRetrieve != nil { - return true - } - - return false -} - -// SetModelsToRetrieve gets a reference to the given []ModelsToRetrieve and assigns it to the ModelsToRetrieve field. -func (o *AllParams) SetModelsToRetrieve(v []ModelsToRetrieve) { - o.ModelsToRetrieve = v -} - -// GetTypesToRetrieve returns the TypesToRetrieve field value if set, zero value otherwise. -func (o *AllParams) GetTypesToRetrieve() []TypesToRetrieve { - if o == nil || o.TypesToRetrieve == nil { - var ret []TypesToRetrieve - return ret - } - return o.TypesToRetrieve -} - -// GetTypesToRetrieveOk returns a tuple with the TypesToRetrieve field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AllParams) GetTypesToRetrieveOk() ([]TypesToRetrieve, bool) { - if o == nil || o.TypesToRetrieve == nil { - return nil, false - } - return o.TypesToRetrieve, true -} - -// HasTypesToRetrieve returns a boolean if a field has been set. -func (o *AllParams) HasTypesToRetrieve() bool { - if o != nil && o.TypesToRetrieve != nil { - return true - } - - return false -} - -// SetTypesToRetrieve gets a reference to the given []TypesToRetrieve and assigns it to the TypesToRetrieve field. -func (o *AllParams) SetTypesToRetrieve(v []TypesToRetrieve) { - o.TypesToRetrieve = v -} - -func (o AllParams) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if o.ModelsToRetrieve != nil { - toSerialize["modelsToRetrieve"] = o.ModelsToRetrieve - } - if o.TypesToRetrieve != nil { - toSerialize["typesToRetrieve"] = o.TypesToRetrieve - } - return json.Marshal(toSerialize) -} - -func (o AllParams) String() string { - out := "" - out += fmt.Sprintf(" modelsToRetrieve=%v\n", o.ModelsToRetrieve) - out += fmt.Sprintf(" typesToRetrieve=%v\n", o.TypesToRetrieve) - return fmt.Sprintf("AllParams {\n%s}", out) -} - -type NullableAllParams struct { - value *AllParams - isSet bool -} - -func (v NullableAllParams) Get() *AllParams { - return v.value -} - -func (v *NullableAllParams) Set(val *AllParams) { - v.value = val - v.isSet = true -} - -func (v NullableAllParams) IsSet() bool { - return v.isSet -} - -func (v *NullableAllParams) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAllParams(val *AllParams) *NullableAllParams { - return &NullableAllParams{value: val, isSet: true} -} - -func (v NullableAllParams) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAllParams) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_all_update_segment_params.go b/clients/algoliasearch-client-go/algolia/predict/model_all_update_segment_params.go deleted file mode 100644 index 55f2e65e5e..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_all_update_segment_params.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// AllUpdateSegmentParams struct for AllUpdateSegmentParams -type AllUpdateSegmentParams struct { - // The name or description of the segment. - Name *string `json:"name,omitempty"` - Conditions *SegmentParentConditions `json:"conditions,omitempty"` -} - -type AllUpdateSegmentParamsOption func(f *AllUpdateSegmentParams) - -func WithAllUpdateSegmentParamsName(val string) AllUpdateSegmentParamsOption { - return func(f *AllUpdateSegmentParams) { - f.Name = &val - } -} - -func WithAllUpdateSegmentParamsConditions(val SegmentParentConditions) AllUpdateSegmentParamsOption { - return func(f *AllUpdateSegmentParams) { - f.Conditions = &val - } -} - -// NewAllUpdateSegmentParams instantiates a new AllUpdateSegmentParams object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewAllUpdateSegmentParams(opts ...AllUpdateSegmentParamsOption) *AllUpdateSegmentParams { - this := &AllUpdateSegmentParams{} - for _, opt := range opts { - opt(this) - } - return this -} - -// NewAllUpdateSegmentParamsWithDefaults instantiates a new AllUpdateSegmentParams object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewAllUpdateSegmentParamsWithDefaults() *AllUpdateSegmentParams { - this := &AllUpdateSegmentParams{} - return this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *AllUpdateSegmentParams) GetName() string { - if o == nil || o.Name == nil { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AllUpdateSegmentParams) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *AllUpdateSegmentParams) HasName() bool { - if o != nil && o.Name != nil { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *AllUpdateSegmentParams) SetName(v string) { - o.Name = &v -} - -// GetConditions returns the Conditions field value if set, zero value otherwise. -func (o *AllUpdateSegmentParams) GetConditions() SegmentParentConditions { - if o == nil || o.Conditions == nil { - var ret SegmentParentConditions - return ret - } - return *o.Conditions -} - -// GetConditionsOk returns a tuple with the Conditions field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AllUpdateSegmentParams) GetConditionsOk() (*SegmentParentConditions, bool) { - if o == nil || o.Conditions == nil { - return nil, false - } - return o.Conditions, true -} - -// HasConditions returns a boolean if a field has been set. -func (o *AllUpdateSegmentParams) HasConditions() bool { - if o != nil && o.Conditions != nil { - return true - } - - return false -} - -// SetConditions gets a reference to the given SegmentParentConditions and assigns it to the Conditions field. -func (o *AllUpdateSegmentParams) SetConditions(v SegmentParentConditions) { - o.Conditions = &v -} - -func (o AllUpdateSegmentParams) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if o.Name != nil { - toSerialize["name"] = o.Name - } - if o.Conditions != nil { - toSerialize["conditions"] = o.Conditions - } - return json.Marshal(toSerialize) -} - -func (o AllUpdateSegmentParams) String() string { - out := "" - out += fmt.Sprintf(" name=%v\n", o.Name) - out += fmt.Sprintf(" conditions=%v\n", o.Conditions) - return fmt.Sprintf("AllUpdateSegmentParams {\n%s}", out) -} - -type NullableAllUpdateSegmentParams struct { - value *AllUpdateSegmentParams - isSet bool -} - -func (v NullableAllUpdateSegmentParams) Get() *AllUpdateSegmentParams { - return v.value -} - -func (v *NullableAllUpdateSegmentParams) Set(val *AllUpdateSegmentParams) { - v.value = val - v.isSet = true -} - -func (v NullableAllUpdateSegmentParams) IsSet() bool { - return v.isSet -} - -func (v *NullableAllUpdateSegmentParams) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAllUpdateSegmentParams(val *AllUpdateSegmentParams) *NullableAllUpdateSegmentParams { - return &NullableAllUpdateSegmentParams{value: val, isSet: true} -} - -func (v NullableAllUpdateSegmentParams) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAllUpdateSegmentParams) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_compatible_sources.go b/clients/algoliasearch-client-go/algolia/predict/model_compatible_sources.go deleted file mode 100644 index d2e2026fd9..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_compatible_sources.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// CompatibleSources the model 'CompatibleSources' -type CompatibleSources string - -// List of compatibleSources -const ( - COMPATIBLESOURCES_BIGQUERY CompatibleSources = "bigquery" -) - -// All allowed values of CompatibleSources enum -var AllowedCompatibleSourcesEnumValues = []CompatibleSources{ - "bigquery", -} - -func (v *CompatibleSources) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := CompatibleSources(value) - for _, existing := range AllowedCompatibleSourcesEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid CompatibleSources", value) -} - -// NewCompatibleSourcesFromValue returns a pointer to a valid CompatibleSources -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewCompatibleSourcesFromValue(v string) (*CompatibleSources, error) { - ev := CompatibleSources(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for CompatibleSources: valid values are %v", v, AllowedCompatibleSourcesEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v CompatibleSources) IsValid() bool { - for _, existing := range AllowedCompatibleSourcesEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to compatibleSources value -func (v CompatibleSources) Ptr() *CompatibleSources { - return &v -} - -type NullableCompatibleSources struct { - value *CompatibleSources - isSet bool -} - -func (v NullableCompatibleSources) Get() *CompatibleSources { - return v.value -} - -func (v *NullableCompatibleSources) Set(val *CompatibleSources) { - v.value = val - v.isSet = true -} - -func (v NullableCompatibleSources) IsSet() bool { - return v.isSet -} - -func (v *NullableCompatibleSources) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCompatibleSources(val *CompatibleSources) *NullableCompatibleSources { - return &NullableCompatibleSources{value: val, isSet: true} -} - -func (v NullableCompatibleSources) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCompatibleSources) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_create_segment_params.go b/clients/algoliasearch-client-go/algolia/predict/model_create_segment_params.go deleted file mode 100644 index 65fb664348..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_create_segment_params.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// CreateSegmentParams struct for CreateSegmentParams -type CreateSegmentParams struct { - // The name or description of the segment. - Name string `json:"name" validate:"required"` - Conditions SegmentParentConditions `json:"conditions" validate:"required"` -} - -// NewCreateSegmentParams instantiates a new CreateSegmentParams object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCreateSegmentParams(name string, conditions SegmentParentConditions) *CreateSegmentParams { - this := &CreateSegmentParams{} - this.Name = name - this.Conditions = conditions - return this -} - -// NewCreateSegmentParamsWithDefaults instantiates a new CreateSegmentParams object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCreateSegmentParamsWithDefaults() *CreateSegmentParams { - this := &CreateSegmentParams{} - return this -} - -// GetName returns the Name field value -func (o *CreateSegmentParams) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *CreateSegmentParams) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *CreateSegmentParams) SetName(v string) { - o.Name = v -} - -// GetConditions returns the Conditions field value -func (o *CreateSegmentParams) GetConditions() SegmentParentConditions { - if o == nil { - var ret SegmentParentConditions - return ret - } - - return o.Conditions -} - -// GetConditionsOk returns a tuple with the Conditions field value -// and a boolean to check if the value has been set. -func (o *CreateSegmentParams) GetConditionsOk() (*SegmentParentConditions, bool) { - if o == nil { - return nil, false - } - return &o.Conditions, true -} - -// SetConditions sets field value -func (o *CreateSegmentParams) SetConditions(v SegmentParentConditions) { - o.Conditions = v -} - -func (o CreateSegmentParams) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["name"] = o.Name - } - if true { - toSerialize["conditions"] = o.Conditions - } - return json.Marshal(toSerialize) -} - -func (o CreateSegmentParams) String() string { - out := "" - out += fmt.Sprintf(" name=%v\n", o.Name) - out += fmt.Sprintf(" conditions=%v\n", o.Conditions) - return fmt.Sprintf("CreateSegmentParams {\n%s}", out) -} - -type NullableCreateSegmentParams struct { - value *CreateSegmentParams - isSet bool -} - -func (v NullableCreateSegmentParams) Get() *CreateSegmentParams { - return v.value -} - -func (v *NullableCreateSegmentParams) Set(val *CreateSegmentParams) { - v.value = val - v.isSet = true -} - -func (v NullableCreateSegmentParams) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateSegmentParams) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateSegmentParams(val *CreateSegmentParams) *NullableCreateSegmentParams { - return &NullableCreateSegmentParams{value: val, isSet: true} -} - -func (v NullableCreateSegmentParams) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateSegmentParams) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_create_segment_response.go b/clients/algoliasearch-client-go/algolia/predict/model_create_segment_response.go deleted file mode 100644 index dd4205ca13..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_create_segment_response.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// CreateSegmentResponse struct for CreateSegmentResponse -type CreateSegmentResponse struct { - // The ID of the segment. - SegmentID string `json:"segmentID" validate:"required"` - // The approximate number of users that matched the segment conditions when it was created, last updated, or when model inference last ran. - Size *float32 `json:"size,omitempty"` - // The date and time at which the segment was updated (RFC3339). - UpdatedAt string `json:"updatedAt" validate:"required"` -} - -type CreateSegmentResponseOption func(f *CreateSegmentResponse) - -func WithCreateSegmentResponseSize(val float32) CreateSegmentResponseOption { - return func(f *CreateSegmentResponse) { - f.Size = &val - } -} - -// NewCreateSegmentResponse instantiates a new CreateSegmentResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCreateSegmentResponse(segmentID string, updatedAt string, opts ...CreateSegmentResponseOption) *CreateSegmentResponse { - this := &CreateSegmentResponse{} - this.SegmentID = segmentID - this.UpdatedAt = updatedAt - for _, opt := range opts { - opt(this) - } - return this -} - -// NewCreateSegmentResponseWithDefaults instantiates a new CreateSegmentResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCreateSegmentResponseWithDefaults() *CreateSegmentResponse { - this := &CreateSegmentResponse{} - return this -} - -// GetSegmentID returns the SegmentID field value -func (o *CreateSegmentResponse) GetSegmentID() string { - if o == nil { - var ret string - return ret - } - - return o.SegmentID -} - -// GetSegmentIDOk returns a tuple with the SegmentID field value -// and a boolean to check if the value has been set. -func (o *CreateSegmentResponse) GetSegmentIDOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.SegmentID, true -} - -// SetSegmentID sets field value -func (o *CreateSegmentResponse) SetSegmentID(v string) { - o.SegmentID = v -} - -// GetSize returns the Size field value if set, zero value otherwise. -func (o *CreateSegmentResponse) GetSize() float32 { - if o == nil || o.Size == nil { - var ret float32 - return ret - } - return *o.Size -} - -// GetSizeOk returns a tuple with the Size field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateSegmentResponse) GetSizeOk() (*float32, bool) { - if o == nil || o.Size == nil { - return nil, false - } - return o.Size, true -} - -// HasSize returns a boolean if a field has been set. -func (o *CreateSegmentResponse) HasSize() bool { - if o != nil && o.Size != nil { - return true - } - - return false -} - -// SetSize gets a reference to the given float32 and assigns it to the Size field. -func (o *CreateSegmentResponse) SetSize(v float32) { - o.Size = &v -} - -// GetUpdatedAt returns the UpdatedAt field value -func (o *CreateSegmentResponse) GetUpdatedAt() string { - if o == nil { - var ret string - return ret - } - - return o.UpdatedAt -} - -// GetUpdatedAtOk returns a tuple with the UpdatedAt field value -// and a boolean to check if the value has been set. -func (o *CreateSegmentResponse) GetUpdatedAtOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UpdatedAt, true -} - -// SetUpdatedAt sets field value -func (o *CreateSegmentResponse) SetUpdatedAt(v string) { - o.UpdatedAt = v -} - -func (o CreateSegmentResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["segmentID"] = o.SegmentID - } - if o.Size != nil { - toSerialize["size"] = o.Size - } - if true { - toSerialize["updatedAt"] = o.UpdatedAt - } - return json.Marshal(toSerialize) -} - -func (o CreateSegmentResponse) String() string { - out := "" - out += fmt.Sprintf(" segmentID=%v\n", o.SegmentID) - out += fmt.Sprintf(" size=%v\n", o.Size) - out += fmt.Sprintf(" updatedAt=%v\n", o.UpdatedAt) - return fmt.Sprintf("CreateSegmentResponse {\n%s}", out) -} - -type NullableCreateSegmentResponse struct { - value *CreateSegmentResponse - isSet bool -} - -func (v NullableCreateSegmentResponse) Get() *CreateSegmentResponse { - return v.value -} - -func (v *NullableCreateSegmentResponse) Set(val *CreateSegmentResponse) { - v.value = val - v.isSet = true -} - -func (v NullableCreateSegmentResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateSegmentResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateSegmentResponse(val *CreateSegmentResponse) *NullableCreateSegmentResponse { - return &NullableCreateSegmentResponse{value: val, isSet: true} -} - -func (v NullableCreateSegmentResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateSegmentResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_delete_model_instance_response.go b/clients/algoliasearch-client-go/algolia/predict/model_delete_model_instance_response.go deleted file mode 100644 index dfe7435a6a..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_delete_model_instance_response.go +++ /dev/null @@ -1,136 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// DeleteModelInstanceResponse struct for DeleteModelInstanceResponse -type DeleteModelInstanceResponse struct { - // The ID of the model. - ModelID string `json:"modelID" validate:"required"` - // The date until which you can safely consider the data as being deleted. - DeletedUntil string `json:"deletedUntil" validate:"required"` -} - -// NewDeleteModelInstanceResponse instantiates a new DeleteModelInstanceResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDeleteModelInstanceResponse(modelID string, deletedUntil string) *DeleteModelInstanceResponse { - this := &DeleteModelInstanceResponse{} - this.ModelID = modelID - this.DeletedUntil = deletedUntil - return this -} - -// NewDeleteModelInstanceResponseWithDefaults instantiates a new DeleteModelInstanceResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDeleteModelInstanceResponseWithDefaults() *DeleteModelInstanceResponse { - this := &DeleteModelInstanceResponse{} - return this -} - -// GetModelID returns the ModelID field value -func (o *DeleteModelInstanceResponse) GetModelID() string { - if o == nil { - var ret string - return ret - } - - return o.ModelID -} - -// GetModelIDOk returns a tuple with the ModelID field value -// and a boolean to check if the value has been set. -func (o *DeleteModelInstanceResponse) GetModelIDOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ModelID, true -} - -// SetModelID sets field value -func (o *DeleteModelInstanceResponse) SetModelID(v string) { - o.ModelID = v -} - -// GetDeletedUntil returns the DeletedUntil field value -func (o *DeleteModelInstanceResponse) GetDeletedUntil() string { - if o == nil { - var ret string - return ret - } - - return o.DeletedUntil -} - -// GetDeletedUntilOk returns a tuple with the DeletedUntil field value -// and a boolean to check if the value has been set. -func (o *DeleteModelInstanceResponse) GetDeletedUntilOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.DeletedUntil, true -} - -// SetDeletedUntil sets field value -func (o *DeleteModelInstanceResponse) SetDeletedUntil(v string) { - o.DeletedUntil = v -} - -func (o DeleteModelInstanceResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["modelID"] = o.ModelID - } - if true { - toSerialize["deletedUntil"] = o.DeletedUntil - } - return json.Marshal(toSerialize) -} - -func (o DeleteModelInstanceResponse) String() string { - out := "" - out += fmt.Sprintf(" modelID=%v\n", o.ModelID) - out += fmt.Sprintf(" deletedUntil=%v\n", o.DeletedUntil) - return fmt.Sprintf("DeleteModelInstanceResponse {\n%s}", out) -} - -type NullableDeleteModelInstanceResponse struct { - value *DeleteModelInstanceResponse - isSet bool -} - -func (v NullableDeleteModelInstanceResponse) Get() *DeleteModelInstanceResponse { - return v.value -} - -func (v *NullableDeleteModelInstanceResponse) Set(val *DeleteModelInstanceResponse) { - v.value = val - v.isSet = true -} - -func (v NullableDeleteModelInstanceResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableDeleteModelInstanceResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDeleteModelInstanceResponse(val *DeleteModelInstanceResponse) *NullableDeleteModelInstanceResponse { - return &NullableDeleteModelInstanceResponse{value: val, isSet: true} -} - -func (v NullableDeleteModelInstanceResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDeleteModelInstanceResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_delete_segment_response.go b/clients/algoliasearch-client-go/algolia/predict/model_delete_segment_response.go deleted file mode 100644 index 5d5a4a483c..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_delete_segment_response.go +++ /dev/null @@ -1,136 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// DeleteSegmentResponse struct for DeleteSegmentResponse -type DeleteSegmentResponse struct { - // The ID of the segment. - SegmentID string `json:"segmentID" validate:"required"` - // The date and time at which the segment will be re-ingested. - DeletedUntil string `json:"deletedUntil" validate:"required"` -} - -// NewDeleteSegmentResponse instantiates a new DeleteSegmentResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDeleteSegmentResponse(segmentID string, deletedUntil string) *DeleteSegmentResponse { - this := &DeleteSegmentResponse{} - this.SegmentID = segmentID - this.DeletedUntil = deletedUntil - return this -} - -// NewDeleteSegmentResponseWithDefaults instantiates a new DeleteSegmentResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDeleteSegmentResponseWithDefaults() *DeleteSegmentResponse { - this := &DeleteSegmentResponse{} - return this -} - -// GetSegmentID returns the SegmentID field value -func (o *DeleteSegmentResponse) GetSegmentID() string { - if o == nil { - var ret string - return ret - } - - return o.SegmentID -} - -// GetSegmentIDOk returns a tuple with the SegmentID field value -// and a boolean to check if the value has been set. -func (o *DeleteSegmentResponse) GetSegmentIDOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.SegmentID, true -} - -// SetSegmentID sets field value -func (o *DeleteSegmentResponse) SetSegmentID(v string) { - o.SegmentID = v -} - -// GetDeletedUntil returns the DeletedUntil field value -func (o *DeleteSegmentResponse) GetDeletedUntil() string { - if o == nil { - var ret string - return ret - } - - return o.DeletedUntil -} - -// GetDeletedUntilOk returns a tuple with the DeletedUntil field value -// and a boolean to check if the value has been set. -func (o *DeleteSegmentResponse) GetDeletedUntilOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.DeletedUntil, true -} - -// SetDeletedUntil sets field value -func (o *DeleteSegmentResponse) SetDeletedUntil(v string) { - o.DeletedUntil = v -} - -func (o DeleteSegmentResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["segmentID"] = o.SegmentID - } - if true { - toSerialize["deletedUntil"] = o.DeletedUntil - } - return json.Marshal(toSerialize) -} - -func (o DeleteSegmentResponse) String() string { - out := "" - out += fmt.Sprintf(" segmentID=%v\n", o.SegmentID) - out += fmt.Sprintf(" deletedUntil=%v\n", o.DeletedUntil) - return fmt.Sprintf("DeleteSegmentResponse {\n%s}", out) -} - -type NullableDeleteSegmentResponse struct { - value *DeleteSegmentResponse - isSet bool -} - -func (v NullableDeleteSegmentResponse) Get() *DeleteSegmentResponse { - return v.value -} - -func (v *NullableDeleteSegmentResponse) Set(val *DeleteSegmentResponse) { - v.value = val - v.isSet = true -} - -func (v NullableDeleteSegmentResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableDeleteSegmentResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDeleteSegmentResponse(val *DeleteSegmentResponse) *NullableDeleteSegmentResponse { - return &NullableDeleteSegmentResponse{value: val, isSet: true} -} - -func (v NullableDeleteSegmentResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDeleteSegmentResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_delete_user_profile_response.go b/clients/algoliasearch-client-go/algolia/predict/model_delete_user_profile_response.go deleted file mode 100644 index 04404f6db8..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_delete_user_profile_response.go +++ /dev/null @@ -1,136 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// DeleteUserProfileResponse struct for DeleteUserProfileResponse -type DeleteUserProfileResponse struct { - // The ID of the user that was deleted. - User string `json:"user" validate:"required"` - // The time the same user ID will be imported again when the data is ingested. - DeletedUntil string `json:"deletedUntil" validate:"required"` -} - -// NewDeleteUserProfileResponse instantiates a new DeleteUserProfileResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDeleteUserProfileResponse(user string, deletedUntil string) *DeleteUserProfileResponse { - this := &DeleteUserProfileResponse{} - this.User = user - this.DeletedUntil = deletedUntil - return this -} - -// NewDeleteUserProfileResponseWithDefaults instantiates a new DeleteUserProfileResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDeleteUserProfileResponseWithDefaults() *DeleteUserProfileResponse { - this := &DeleteUserProfileResponse{} - return this -} - -// GetUser returns the User field value -func (o *DeleteUserProfileResponse) GetUser() string { - if o == nil { - var ret string - return ret - } - - return o.User -} - -// GetUserOk returns a tuple with the User field value -// and a boolean to check if the value has been set. -func (o *DeleteUserProfileResponse) GetUserOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.User, true -} - -// SetUser sets field value -func (o *DeleteUserProfileResponse) SetUser(v string) { - o.User = v -} - -// GetDeletedUntil returns the DeletedUntil field value -func (o *DeleteUserProfileResponse) GetDeletedUntil() string { - if o == nil { - var ret string - return ret - } - - return o.DeletedUntil -} - -// GetDeletedUntilOk returns a tuple with the DeletedUntil field value -// and a boolean to check if the value has been set. -func (o *DeleteUserProfileResponse) GetDeletedUntilOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.DeletedUntil, true -} - -// SetDeletedUntil sets field value -func (o *DeleteUserProfileResponse) SetDeletedUntil(v string) { - o.DeletedUntil = v -} - -func (o DeleteUserProfileResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["user"] = o.User - } - if true { - toSerialize["deletedUntil"] = o.DeletedUntil - } - return json.Marshal(toSerialize) -} - -func (o DeleteUserProfileResponse) String() string { - out := "" - out += fmt.Sprintf(" user=%v\n", o.User) - out += fmt.Sprintf(" deletedUntil=%v\n", o.DeletedUntil) - return fmt.Sprintf("DeleteUserProfileResponse {\n%s}", out) -} - -type NullableDeleteUserProfileResponse struct { - value *DeleteUserProfileResponse - isSet bool -} - -func (v NullableDeleteUserProfileResponse) Get() *DeleteUserProfileResponse { - return v.value -} - -func (v *NullableDeleteUserProfileResponse) Set(val *DeleteUserProfileResponse) { - v.value = val - v.isSet = true -} - -func (v NullableDeleteUserProfileResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableDeleteUserProfileResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDeleteUserProfileResponse(val *DeleteUserProfileResponse) *NullableDeleteUserProfileResponse { - return &NullableDeleteUserProfileResponse{value: val, isSet: true} -} - -func (v NullableDeleteUserProfileResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDeleteUserProfileResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_error.go b/clients/algoliasearch-client-go/algolia/predict/model_error.go deleted file mode 100644 index f3db57e87b..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_error.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// ModelError The error when the model is not available. -type ModelError struct { - Error string `json:"error" validate:"required"` -} - -// NewModelError instantiates a new ModelError object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewModelError(error_ string) *ModelError { - this := &ModelError{} - this.Error = error_ - return this -} - -// NewModelErrorWithDefaults instantiates a new ModelError object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewModelErrorWithDefaults() *ModelError { - this := &ModelError{} - return this -} - -// GetError returns the Error field value -func (o *ModelError) GetError() string { - if o == nil { - var ret string - return ret - } - - return o.Error -} - -// GetErrorOk returns a tuple with the Error field value -// and a boolean to check if the value has been set. -func (o *ModelError) GetErrorOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Error, true -} - -// SetError sets field value -func (o *ModelError) SetError(v string) { - o.Error = v -} - -func (o ModelError) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["error"] = o.Error - } - return json.Marshal(toSerialize) -} - -func (o ModelError) String() string { - out := "" - out += fmt.Sprintf(" error=%v\n", o.Error) - return fmt.Sprintf("ModelError {\n%s}", out) -} - -type NullableModelError struct { - value *ModelError - isSet bool -} - -func (v NullableModelError) Get() *ModelError { - return v.value -} - -func (v *NullableModelError) Set(val *ModelError) { - v.value = val - v.isSet = true -} - -func (v NullableModelError) IsSet() bool { - return v.isSet -} - -func (v *NullableModelError) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableModelError(val *ModelError) *NullableModelError { - return &NullableModelError{value: val, isSet: true} -} - -func (v NullableModelError) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableModelError) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_error_base.go b/clients/algoliasearch-client-go/algolia/predict/model_error_base.go deleted file mode 100644 index cbd48ddd2b..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_error_base.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// ErrorBase Error. -type ErrorBase struct { - Message *string `json:"message,omitempty"` - AdditionalProperties map[string]any -} - -type _ErrorBase ErrorBase - -type ErrorBaseOption func(f *ErrorBase) - -func WithErrorBaseMessage(val string) ErrorBaseOption { - return func(f *ErrorBase) { - f.Message = &val - } -} - -// NewErrorBase instantiates a new ErrorBase object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewErrorBase(opts ...ErrorBaseOption) *ErrorBase { - this := &ErrorBase{} - for _, opt := range opts { - opt(this) - } - return this -} - -// NewErrorBaseWithDefaults instantiates a new ErrorBase object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewErrorBaseWithDefaults() *ErrorBase { - this := &ErrorBase{} - return this -} - -// GetMessage returns the Message field value if set, zero value otherwise. -func (o *ErrorBase) GetMessage() string { - if o == nil || o.Message == nil { - var ret string - return ret - } - return *o.Message -} - -// GetMessageOk returns a tuple with the Message field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ErrorBase) GetMessageOk() (*string, bool) { - if o == nil || o.Message == nil { - return nil, false - } - return o.Message, true -} - -// HasMessage returns a boolean if a field has been set. -func (o *ErrorBase) HasMessage() bool { - if o != nil && o.Message != nil { - return true - } - - return false -} - -// SetMessage gets a reference to the given string and assigns it to the Message field. -func (o *ErrorBase) SetMessage(v string) { - o.Message = &v -} - -func (o ErrorBase) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if o.Message != nil { - toSerialize["message"] = o.Message - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *ErrorBase) UnmarshalJSON(bytes []byte) (err error) { - varErrorBase := _ErrorBase{} - - if err = json.Unmarshal(bytes, &varErrorBase); err == nil { - *o = ErrorBase(varErrorBase) - } - - additionalProperties := make(map[string]any) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "message") - o.AdditionalProperties = additionalProperties - } - - return err -} - -func (o ErrorBase) String() string { - out := "" - out += fmt.Sprintf(" message=%v\n", o.Message) - for key, value := range o.AdditionalProperties { - out += fmt.Sprintf(" %s=%v\n", key, value) - } - return fmt.Sprintf("ErrorBase {\n%s}", out) -} - -type NullableErrorBase struct { - value *ErrorBase - isSet bool -} - -func (v NullableErrorBase) Get() *ErrorBase { - return v.value -} - -func (v *NullableErrorBase) Set(val *ErrorBase) { - v.value = val - v.isSet = true -} - -func (v NullableErrorBase) IsSet() bool { - return v.isSet -} - -func (v *NullableErrorBase) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableErrorBase(val *ErrorBase) *NullableErrorBase { - return &NullableErrorBase{value: val, isSet: true} -} - -func (v NullableErrorBase) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableErrorBase) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_fetch_all_user_profiles_params.go b/clients/algoliasearch-client-go/algolia/predict/model_fetch_all_user_profiles_params.go deleted file mode 100644 index 2c127a0e02..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_fetch_all_user_profiles_params.go +++ /dev/null @@ -1,212 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// FetchAllUserProfilesParams - struct for FetchAllUserProfilesParams -type FetchAllUserProfilesParams struct { - LimitParam *LimitParam - ModelsToRetrieveParam *ModelsToRetrieveParam - NextPageTokenParam *NextPageTokenParam - PreviousPageTokenParam *PreviousPageTokenParam - TypesToRetrieveParam *TypesToRetrieveParam -} - -// LimitParamAsFetchAllUserProfilesParams is a convenience function that returns LimitParam wrapped in FetchAllUserProfilesParams -func LimitParamAsFetchAllUserProfilesParams(v *LimitParam) FetchAllUserProfilesParams { - return FetchAllUserProfilesParams{ - LimitParam: v, - } -} - -// ModelsToRetrieveParamAsFetchAllUserProfilesParams is a convenience function that returns ModelsToRetrieveParam wrapped in FetchAllUserProfilesParams -func ModelsToRetrieveParamAsFetchAllUserProfilesParams(v *ModelsToRetrieveParam) FetchAllUserProfilesParams { - return FetchAllUserProfilesParams{ - ModelsToRetrieveParam: v, - } -} - -// NextPageTokenParamAsFetchAllUserProfilesParams is a convenience function that returns NextPageTokenParam wrapped in FetchAllUserProfilesParams -func NextPageTokenParamAsFetchAllUserProfilesParams(v *NextPageTokenParam) FetchAllUserProfilesParams { - return FetchAllUserProfilesParams{ - NextPageTokenParam: v, - } -} - -// PreviousPageTokenParamAsFetchAllUserProfilesParams is a convenience function that returns PreviousPageTokenParam wrapped in FetchAllUserProfilesParams -func PreviousPageTokenParamAsFetchAllUserProfilesParams(v *PreviousPageTokenParam) FetchAllUserProfilesParams { - return FetchAllUserProfilesParams{ - PreviousPageTokenParam: v, - } -} - -// TypesToRetrieveParamAsFetchAllUserProfilesParams is a convenience function that returns TypesToRetrieveParam wrapped in FetchAllUserProfilesParams -func TypesToRetrieveParamAsFetchAllUserProfilesParams(v *TypesToRetrieveParam) FetchAllUserProfilesParams { - return FetchAllUserProfilesParams{ - TypesToRetrieveParam: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *FetchAllUserProfilesParams) UnmarshalJSON(data []byte) error { - var err error - // try to unmarshal data into LimitParam - err = newStrictDecoder(data).Decode(&dst.LimitParam) - if err == nil && validateStruct(dst.LimitParam) == nil { - jsonLimitParam, _ := json.Marshal(dst.LimitParam) - if string(jsonLimitParam) == "{}" { // empty struct - dst.LimitParam = nil - } else { - return nil - } - } else { - dst.LimitParam = nil - } - - // try to unmarshal data into ModelsToRetrieveParam - err = newStrictDecoder(data).Decode(&dst.ModelsToRetrieveParam) - if err == nil && validateStruct(dst.ModelsToRetrieveParam) == nil { - jsonModelsToRetrieveParam, _ := json.Marshal(dst.ModelsToRetrieveParam) - if string(jsonModelsToRetrieveParam) == "{}" { // empty struct - dst.ModelsToRetrieveParam = nil - } else { - return nil - } - } else { - dst.ModelsToRetrieveParam = nil - } - - // try to unmarshal data into NextPageTokenParam - err = newStrictDecoder(data).Decode(&dst.NextPageTokenParam) - if err == nil && validateStruct(dst.NextPageTokenParam) == nil { - jsonNextPageTokenParam, _ := json.Marshal(dst.NextPageTokenParam) - if string(jsonNextPageTokenParam) == "{}" { // empty struct - dst.NextPageTokenParam = nil - } else { - return nil - } - } else { - dst.NextPageTokenParam = nil - } - - // try to unmarshal data into PreviousPageTokenParam - err = newStrictDecoder(data).Decode(&dst.PreviousPageTokenParam) - if err == nil && validateStruct(dst.PreviousPageTokenParam) == nil { - jsonPreviousPageTokenParam, _ := json.Marshal(dst.PreviousPageTokenParam) - if string(jsonPreviousPageTokenParam) == "{}" { // empty struct - dst.PreviousPageTokenParam = nil - } else { - return nil - } - } else { - dst.PreviousPageTokenParam = nil - } - - // try to unmarshal data into TypesToRetrieveParam - err = newStrictDecoder(data).Decode(&dst.TypesToRetrieveParam) - if err == nil && validateStruct(dst.TypesToRetrieveParam) == nil { - jsonTypesToRetrieveParam, _ := json.Marshal(dst.TypesToRetrieveParam) - if string(jsonTypesToRetrieveParam) == "{}" { // empty struct - dst.TypesToRetrieveParam = nil - } else { - return nil - } - } else { - dst.TypesToRetrieveParam = nil - } - - return fmt.Errorf("Data failed to match schemas in oneOf(FetchAllUserProfilesParams)") -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src FetchAllUserProfilesParams) MarshalJSON() ([]byte, error) { - if src.LimitParam != nil { - return json.Marshal(&src.LimitParam) - } - - if src.ModelsToRetrieveParam != nil { - return json.Marshal(&src.ModelsToRetrieveParam) - } - - if src.NextPageTokenParam != nil { - return json.Marshal(&src.NextPageTokenParam) - } - - if src.PreviousPageTokenParam != nil { - return json.Marshal(&src.PreviousPageTokenParam) - } - - if src.TypesToRetrieveParam != nil { - return json.Marshal(&src.TypesToRetrieveParam) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *FetchAllUserProfilesParams) GetActualInstance() any { - if obj == nil { - return nil - } - if obj.LimitParam != nil { - return obj.LimitParam - } - - if obj.ModelsToRetrieveParam != nil { - return obj.ModelsToRetrieveParam - } - - if obj.NextPageTokenParam != nil { - return obj.NextPageTokenParam - } - - if obj.PreviousPageTokenParam != nil { - return obj.PreviousPageTokenParam - } - - if obj.TypesToRetrieveParam != nil { - return obj.TypesToRetrieveParam - } - - // all schemas are nil - return nil -} - -type NullableFetchAllUserProfilesParams struct { - value *FetchAllUserProfilesParams - isSet bool -} - -func (v NullableFetchAllUserProfilesParams) Get() *FetchAllUserProfilesParams { - return v.value -} - -func (v *NullableFetchAllUserProfilesParams) Set(val *FetchAllUserProfilesParams) { - v.value = val - v.isSet = true -} - -func (v NullableFetchAllUserProfilesParams) IsSet() bool { - return v.isSet -} - -func (v *NullableFetchAllUserProfilesParams) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFetchAllUserProfilesParams(val *FetchAllUserProfilesParams) *NullableFetchAllUserProfilesParams { - return &NullableFetchAllUserProfilesParams{value: val, isSet: true} -} - -func (v NullableFetchAllUserProfilesParams) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFetchAllUserProfilesParams) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_fetch_all_user_profiles_response.go b/clients/algoliasearch-client-go/algolia/predict/model_fetch_all_user_profiles_response.go deleted file mode 100644 index 3c230a52cf..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_fetch_all_user_profiles_response.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// FetchAllUserProfilesResponse struct for FetchAllUserProfilesResponse -type FetchAllUserProfilesResponse struct { - Users []UserProfile `json:"users" validate:"required"` - // 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. - PreviousPageToken *string `json:"previousPageToken,omitempty"` - // 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. - NextPageToken *string `json:"nextPageToken,omitempty"` -} - -type FetchAllUserProfilesResponseOption func(f *FetchAllUserProfilesResponse) - -func WithFetchAllUserProfilesResponsePreviousPageToken(val string) FetchAllUserProfilesResponseOption { - return func(f *FetchAllUserProfilesResponse) { - f.PreviousPageToken = &val - } -} - -func WithFetchAllUserProfilesResponseNextPageToken(val string) FetchAllUserProfilesResponseOption { - return func(f *FetchAllUserProfilesResponse) { - f.NextPageToken = &val - } -} - -// NewFetchAllUserProfilesResponse instantiates a new FetchAllUserProfilesResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewFetchAllUserProfilesResponse(users []UserProfile, opts ...FetchAllUserProfilesResponseOption) *FetchAllUserProfilesResponse { - this := &FetchAllUserProfilesResponse{} - this.Users = users - for _, opt := range opts { - opt(this) - } - return this -} - -// NewFetchAllUserProfilesResponseWithDefaults instantiates a new FetchAllUserProfilesResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewFetchAllUserProfilesResponseWithDefaults() *FetchAllUserProfilesResponse { - this := &FetchAllUserProfilesResponse{} - return this -} - -// GetUsers returns the Users field value -func (o *FetchAllUserProfilesResponse) GetUsers() []UserProfile { - if o == nil { - var ret []UserProfile - return ret - } - - return o.Users -} - -// GetUsersOk returns a tuple with the Users field value -// and a boolean to check if the value has been set. -func (o *FetchAllUserProfilesResponse) GetUsersOk() ([]UserProfile, bool) { - if o == nil { - return nil, false - } - return o.Users, true -} - -// SetUsers sets field value -func (o *FetchAllUserProfilesResponse) SetUsers(v []UserProfile) { - o.Users = v -} - -// GetPreviousPageToken returns the PreviousPageToken field value if set, zero value otherwise. -func (o *FetchAllUserProfilesResponse) GetPreviousPageToken() string { - if o == nil || o.PreviousPageToken == nil { - var ret string - return ret - } - return *o.PreviousPageToken -} - -// GetPreviousPageTokenOk returns a tuple with the PreviousPageToken field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FetchAllUserProfilesResponse) GetPreviousPageTokenOk() (*string, bool) { - if o == nil || o.PreviousPageToken == nil { - return nil, false - } - return o.PreviousPageToken, true -} - -// HasPreviousPageToken returns a boolean if a field has been set. -func (o *FetchAllUserProfilesResponse) HasPreviousPageToken() bool { - if o != nil && o.PreviousPageToken != nil { - return true - } - - return false -} - -// SetPreviousPageToken gets a reference to the given string and assigns it to the PreviousPageToken field. -func (o *FetchAllUserProfilesResponse) SetPreviousPageToken(v string) { - o.PreviousPageToken = &v -} - -// GetNextPageToken returns the NextPageToken field value if set, zero value otherwise. -func (o *FetchAllUserProfilesResponse) GetNextPageToken() string { - if o == nil || o.NextPageToken == nil { - var ret string - return ret - } - return *o.NextPageToken -} - -// GetNextPageTokenOk returns a tuple with the NextPageToken field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FetchAllUserProfilesResponse) GetNextPageTokenOk() (*string, bool) { - if o == nil || o.NextPageToken == nil { - return nil, false - } - return o.NextPageToken, true -} - -// HasNextPageToken returns a boolean if a field has been set. -func (o *FetchAllUserProfilesResponse) HasNextPageToken() bool { - if o != nil && o.NextPageToken != nil { - return true - } - - return false -} - -// SetNextPageToken gets a reference to the given string and assigns it to the NextPageToken field. -func (o *FetchAllUserProfilesResponse) SetNextPageToken(v string) { - o.NextPageToken = &v -} - -func (o FetchAllUserProfilesResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["users"] = o.Users - } - if o.PreviousPageToken != nil { - toSerialize["previousPageToken"] = o.PreviousPageToken - } - if o.NextPageToken != nil { - toSerialize["nextPageToken"] = o.NextPageToken - } - return json.Marshal(toSerialize) -} - -func (o FetchAllUserProfilesResponse) String() string { - out := "" - out += fmt.Sprintf(" users=%v\n", o.Users) - out += fmt.Sprintf(" previousPageToken=%v\n", o.PreviousPageToken) - out += fmt.Sprintf(" nextPageToken=%v\n", o.NextPageToken) - return fmt.Sprintf("FetchAllUserProfilesResponse {\n%s}", out) -} - -type NullableFetchAllUserProfilesResponse struct { - value *FetchAllUserProfilesResponse - isSet bool -} - -func (v NullableFetchAllUserProfilesResponse) Get() *FetchAllUserProfilesResponse { - return v.value -} - -func (v *NullableFetchAllUserProfilesResponse) Set(val *FetchAllUserProfilesResponse) { - v.value = val - v.isSet = true -} - -func (v NullableFetchAllUserProfilesResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableFetchAllUserProfilesResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFetchAllUserProfilesResponse(val *FetchAllUserProfilesResponse) *NullableFetchAllUserProfilesResponse { - return &NullableFetchAllUserProfilesResponse{value: val, isSet: true} -} - -func (v NullableFetchAllUserProfilesResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFetchAllUserProfilesResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_funnel_stage.go b/clients/algoliasearch-client-go/algolia/predict/model_funnel_stage.go deleted file mode 100644 index d10e1447fa..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_funnel_stage.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// FunnelStage struct for FunnelStage -type FunnelStage struct { - Name string `json:"name" validate:"required"` - Probability float64 `json:"probability" validate:"required"` -} - -// NewFunnelStage instantiates a new FunnelStage object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewFunnelStage(name string, probability float64) *FunnelStage { - this := &FunnelStage{} - this.Name = name - this.Probability = probability - return this -} - -// NewFunnelStageWithDefaults instantiates a new FunnelStage object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewFunnelStageWithDefaults() *FunnelStage { - this := &FunnelStage{} - return this -} - -// GetName returns the Name field value -func (o *FunnelStage) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *FunnelStage) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *FunnelStage) SetName(v string) { - o.Name = v -} - -// GetProbability returns the Probability field value -func (o *FunnelStage) GetProbability() float64 { - if o == nil { - var ret float64 - return ret - } - - return o.Probability -} - -// GetProbabilityOk returns a tuple with the Probability field value -// and a boolean to check if the value has been set. -func (o *FunnelStage) GetProbabilityOk() (*float64, bool) { - if o == nil { - return nil, false - } - return &o.Probability, true -} - -// SetProbability sets field value -func (o *FunnelStage) SetProbability(v float64) { - o.Probability = v -} - -func (o FunnelStage) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["name"] = o.Name - } - if true { - toSerialize["probability"] = o.Probability - } - return json.Marshal(toSerialize) -} - -func (o FunnelStage) String() string { - out := "" - out += fmt.Sprintf(" name=%v\n", o.Name) - out += fmt.Sprintf(" probability=%v\n", o.Probability) - return fmt.Sprintf("FunnelStage {\n%s}", out) -} - -type NullableFunnelStage struct { - value *FunnelStage - isSet bool -} - -func (v NullableFunnelStage) Get() *FunnelStage { - return v.value -} - -func (v *NullableFunnelStage) Set(val *FunnelStage) { - v.value = val - v.isSet = true -} - -func (v NullableFunnelStage) IsSet() bool { - return v.isSet -} - -func (v *NullableFunnelStage) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFunnelStage(val *FunnelStage) *NullableFunnelStage { - return &NullableFunnelStage{value: val, isSet: true} -} - -func (v NullableFunnelStage) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFunnelStage) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_get_available_model_types_response_inner.go b/clients/algoliasearch-client-go/algolia/predict/model_get_available_model_types_response_inner.go deleted file mode 100644 index a2c0f74eb5..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_get_available_model_types_response_inner.go +++ /dev/null @@ -1,196 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// GetAvailableModelTypesResponseInner struct for GetAvailableModelTypesResponseInner -type GetAvailableModelTypesResponseInner struct { - // Name of the model. - Name string `json:"name" validate:"required"` - // Description of the model. - Type string `json:"type" validate:"required"` - CompatibleSources []CompatibleSources `json:"compatibleSources" validate:"required"` - DataRequirements GetAvailableModelTypesResponseInnerDataRequirements `json:"dataRequirements" validate:"required"` -} - -// NewGetAvailableModelTypesResponseInner instantiates a new GetAvailableModelTypesResponseInner object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewGetAvailableModelTypesResponseInner(name string, type_ string, compatibleSources []CompatibleSources, dataRequirements GetAvailableModelTypesResponseInnerDataRequirements) *GetAvailableModelTypesResponseInner { - this := &GetAvailableModelTypesResponseInner{} - this.Name = name - this.Type = type_ - this.CompatibleSources = compatibleSources - this.DataRequirements = dataRequirements - return this -} - -// NewGetAvailableModelTypesResponseInnerWithDefaults instantiates a new GetAvailableModelTypesResponseInner object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewGetAvailableModelTypesResponseInnerWithDefaults() *GetAvailableModelTypesResponseInner { - this := &GetAvailableModelTypesResponseInner{} - return this -} - -// GetName returns the Name field value -func (o *GetAvailableModelTypesResponseInner) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *GetAvailableModelTypesResponseInner) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *GetAvailableModelTypesResponseInner) SetName(v string) { - o.Name = v -} - -// GetType returns the Type field value -func (o *GetAvailableModelTypesResponseInner) GetType() string { - if o == nil { - var ret string - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *GetAvailableModelTypesResponseInner) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *GetAvailableModelTypesResponseInner) SetType(v string) { - o.Type = v -} - -// GetCompatibleSources returns the CompatibleSources field value -func (o *GetAvailableModelTypesResponseInner) GetCompatibleSources() []CompatibleSources { - if o == nil { - var ret []CompatibleSources - return ret - } - - return o.CompatibleSources -} - -// GetCompatibleSourcesOk returns a tuple with the CompatibleSources field value -// and a boolean to check if the value has been set. -func (o *GetAvailableModelTypesResponseInner) GetCompatibleSourcesOk() ([]CompatibleSources, bool) { - if o == nil { - return nil, false - } - return o.CompatibleSources, true -} - -// SetCompatibleSources sets field value -func (o *GetAvailableModelTypesResponseInner) SetCompatibleSources(v []CompatibleSources) { - o.CompatibleSources = v -} - -// GetDataRequirements returns the DataRequirements field value -func (o *GetAvailableModelTypesResponseInner) GetDataRequirements() GetAvailableModelTypesResponseInnerDataRequirements { - if o == nil { - var ret GetAvailableModelTypesResponseInnerDataRequirements - return ret - } - - return o.DataRequirements -} - -// GetDataRequirementsOk returns a tuple with the DataRequirements field value -// and a boolean to check if the value has been set. -func (o *GetAvailableModelTypesResponseInner) GetDataRequirementsOk() (*GetAvailableModelTypesResponseInnerDataRequirements, bool) { - if o == nil { - return nil, false - } - return &o.DataRequirements, true -} - -// SetDataRequirements sets field value -func (o *GetAvailableModelTypesResponseInner) SetDataRequirements(v GetAvailableModelTypesResponseInnerDataRequirements) { - o.DataRequirements = v -} - -func (o GetAvailableModelTypesResponseInner) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["name"] = o.Name - } - if true { - toSerialize["type"] = o.Type - } - if true { - toSerialize["compatibleSources"] = o.CompatibleSources - } - if true { - toSerialize["dataRequirements"] = o.DataRequirements - } - return json.Marshal(toSerialize) -} - -func (o GetAvailableModelTypesResponseInner) String() string { - out := "" - out += fmt.Sprintf(" name=%v\n", o.Name) - out += fmt.Sprintf(" type=%v\n", o.Type) - out += fmt.Sprintf(" compatibleSources=%v\n", o.CompatibleSources) - out += fmt.Sprintf(" dataRequirements=%v\n", o.DataRequirements) - return fmt.Sprintf("GetAvailableModelTypesResponseInner {\n%s}", out) -} - -type NullableGetAvailableModelTypesResponseInner struct { - value *GetAvailableModelTypesResponseInner - isSet bool -} - -func (v NullableGetAvailableModelTypesResponseInner) Get() *GetAvailableModelTypesResponseInner { - return v.value -} - -func (v *NullableGetAvailableModelTypesResponseInner) Set(val *GetAvailableModelTypesResponseInner) { - v.value = val - v.isSet = true -} - -func (v NullableGetAvailableModelTypesResponseInner) IsSet() bool { - return v.isSet -} - -func (v *NullableGetAvailableModelTypesResponseInner) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetAvailableModelTypesResponseInner(val *GetAvailableModelTypesResponseInner) *NullableGetAvailableModelTypesResponseInner { - return &NullableGetAvailableModelTypesResponseInner{value: val, isSet: true} -} - -func (v NullableGetAvailableModelTypesResponseInner) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetAvailableModelTypesResponseInner) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_get_available_model_types_response_inner_data_requirements.go b/clients/algoliasearch-client-go/algolia/predict/model_get_available_model_types_response_inner_data_requirements.go deleted file mode 100644 index fdc9ed21f2..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_get_available_model_types_response_inner_data_requirements.go +++ /dev/null @@ -1,136 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// GetAvailableModelTypesResponseInnerDataRequirements struct for GetAvailableModelTypesResponseInnerDataRequirements -type GetAvailableModelTypesResponseInnerDataRequirements struct { - // Minimum number of users required for this model. - MinUsers int32 `json:"minUsers" validate:"required"` - // Minimum number of days model needs to run. - MinDays int32 `json:"minDays" validate:"required"` -} - -// NewGetAvailableModelTypesResponseInnerDataRequirements instantiates a new GetAvailableModelTypesResponseInnerDataRequirements object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewGetAvailableModelTypesResponseInnerDataRequirements(minUsers int32, minDays int32) *GetAvailableModelTypesResponseInnerDataRequirements { - this := &GetAvailableModelTypesResponseInnerDataRequirements{} - this.MinUsers = minUsers - this.MinDays = minDays - return this -} - -// NewGetAvailableModelTypesResponseInnerDataRequirementsWithDefaults instantiates a new GetAvailableModelTypesResponseInnerDataRequirements object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewGetAvailableModelTypesResponseInnerDataRequirementsWithDefaults() *GetAvailableModelTypesResponseInnerDataRequirements { - this := &GetAvailableModelTypesResponseInnerDataRequirements{} - return this -} - -// GetMinUsers returns the MinUsers field value -func (o *GetAvailableModelTypesResponseInnerDataRequirements) GetMinUsers() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.MinUsers -} - -// GetMinUsersOk returns a tuple with the MinUsers field value -// and a boolean to check if the value has been set. -func (o *GetAvailableModelTypesResponseInnerDataRequirements) GetMinUsersOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.MinUsers, true -} - -// SetMinUsers sets field value -func (o *GetAvailableModelTypesResponseInnerDataRequirements) SetMinUsers(v int32) { - o.MinUsers = v -} - -// GetMinDays returns the MinDays field value -func (o *GetAvailableModelTypesResponseInnerDataRequirements) GetMinDays() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.MinDays -} - -// GetMinDaysOk returns a tuple with the MinDays field value -// and a boolean to check if the value has been set. -func (o *GetAvailableModelTypesResponseInnerDataRequirements) GetMinDaysOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.MinDays, true -} - -// SetMinDays sets field value -func (o *GetAvailableModelTypesResponseInnerDataRequirements) SetMinDays(v int32) { - o.MinDays = v -} - -func (o GetAvailableModelTypesResponseInnerDataRequirements) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["minUsers"] = o.MinUsers - } - if true { - toSerialize["minDays"] = o.MinDays - } - return json.Marshal(toSerialize) -} - -func (o GetAvailableModelTypesResponseInnerDataRequirements) String() string { - out := "" - out += fmt.Sprintf(" minUsers=%v\n", o.MinUsers) - out += fmt.Sprintf(" minDays=%v\n", o.MinDays) - return fmt.Sprintf("GetAvailableModelTypesResponseInnerDataRequirements {\n%s}", out) -} - -type NullableGetAvailableModelTypesResponseInnerDataRequirements struct { - value *GetAvailableModelTypesResponseInnerDataRequirements - isSet bool -} - -func (v NullableGetAvailableModelTypesResponseInnerDataRequirements) Get() *GetAvailableModelTypesResponseInnerDataRequirements { - return v.value -} - -func (v *NullableGetAvailableModelTypesResponseInnerDataRequirements) Set(val *GetAvailableModelTypesResponseInnerDataRequirements) { - v.value = val - v.isSet = true -} - -func (v NullableGetAvailableModelTypesResponseInnerDataRequirements) IsSet() bool { - return v.isSet -} - -func (v *NullableGetAvailableModelTypesResponseInnerDataRequirements) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetAvailableModelTypesResponseInnerDataRequirements(val *GetAvailableModelTypesResponseInnerDataRequirements) *NullableGetAvailableModelTypesResponseInnerDataRequirements { - return &NullableGetAvailableModelTypesResponseInnerDataRequirements{value: val, isSet: true} -} - -func (v NullableGetAvailableModelTypesResponseInnerDataRequirements) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetAvailableModelTypesResponseInnerDataRequirements) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_get_model_instance_config_status.go b/clients/algoliasearch-client-go/algolia/predict/model_get_model_instance_config_status.go deleted file mode 100644 index b38898d933..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_get_model_instance_config_status.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// 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. -type GetModelInstanceConfigStatus string - -// List of getModelInstanceConfigStatus -const ( - GETMODELINSTANCECONFIGSTATUS_PENDING GetModelInstanceConfigStatus = "pending" - GETMODELINSTANCECONFIGSTATUS_ACTIVE GetModelInstanceConfigStatus = "active" - GETMODELINSTANCECONFIGSTATUS_INVALID GetModelInstanceConfigStatus = "invalid" - GETMODELINSTANCECONFIGSTATUS_INACTIVE GetModelInstanceConfigStatus = "inactive" -) - -// All allowed values of GetModelInstanceConfigStatus enum -var AllowedGetModelInstanceConfigStatusEnumValues = []GetModelInstanceConfigStatus{ - "pending", - "active", - "invalid", - "inactive", -} - -func (v *GetModelInstanceConfigStatus) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := GetModelInstanceConfigStatus(value) - for _, existing := range AllowedGetModelInstanceConfigStatusEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid GetModelInstanceConfigStatus", value) -} - -// NewGetModelInstanceConfigStatusFromValue returns a pointer to a valid GetModelInstanceConfigStatus -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewGetModelInstanceConfigStatusFromValue(v string) (*GetModelInstanceConfigStatus, error) { - ev := GetModelInstanceConfigStatus(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for GetModelInstanceConfigStatus: valid values are %v", v, AllowedGetModelInstanceConfigStatusEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v GetModelInstanceConfigStatus) IsValid() bool { - for _, existing := range AllowedGetModelInstanceConfigStatusEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to getModelInstanceConfigStatus value -func (v GetModelInstanceConfigStatus) Ptr() *GetModelInstanceConfigStatus { - return &v -} - -type NullableGetModelInstanceConfigStatus struct { - value *GetModelInstanceConfigStatus - isSet bool -} - -func (v NullableGetModelInstanceConfigStatus) Get() *GetModelInstanceConfigStatus { - return v.value -} - -func (v *NullableGetModelInstanceConfigStatus) Set(val *GetModelInstanceConfigStatus) { - v.value = val - v.isSet = true -} - -func (v NullableGetModelInstanceConfigStatus) IsSet() bool { - return v.isSet -} - -func (v *NullableGetModelInstanceConfigStatus) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetModelInstanceConfigStatus(val *GetModelInstanceConfigStatus) *NullableGetModelInstanceConfigStatus { - return &NullableGetModelInstanceConfigStatus{value: val, isSet: true} -} - -func (v NullableGetModelInstanceConfigStatus) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetModelInstanceConfigStatus) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_get_model_metrics_response.go b/clients/algoliasearch-client-go/algolia/predict/model_get_model_metrics_response.go deleted file mode 100644 index c437e00f5f..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_get_model_metrics_response.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// GetModelMetricsResponse struct for GetModelMetricsResponse -type GetModelMetricsResponse struct { - // The ID of the model. - ModelID string `json:"modelID" validate:"required"` - Metrics []ModelMetrics `json:"metrics" validate:"required"` -} - -// NewGetModelMetricsResponse instantiates a new GetModelMetricsResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewGetModelMetricsResponse(modelID string, metrics []ModelMetrics) *GetModelMetricsResponse { - this := &GetModelMetricsResponse{} - this.ModelID = modelID - this.Metrics = metrics - return this -} - -// NewGetModelMetricsResponseWithDefaults instantiates a new GetModelMetricsResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewGetModelMetricsResponseWithDefaults() *GetModelMetricsResponse { - this := &GetModelMetricsResponse{} - return this -} - -// GetModelID returns the ModelID field value -func (o *GetModelMetricsResponse) GetModelID() string { - if o == nil { - var ret string - return ret - } - - return o.ModelID -} - -// GetModelIDOk returns a tuple with the ModelID field value -// and a boolean to check if the value has been set. -func (o *GetModelMetricsResponse) GetModelIDOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ModelID, true -} - -// SetModelID sets field value -func (o *GetModelMetricsResponse) SetModelID(v string) { - o.ModelID = v -} - -// GetMetrics returns the Metrics field value -func (o *GetModelMetricsResponse) GetMetrics() []ModelMetrics { - if o == nil { - var ret []ModelMetrics - return ret - } - - return o.Metrics -} - -// GetMetricsOk returns a tuple with the Metrics field value -// and a boolean to check if the value has been set. -func (o *GetModelMetricsResponse) GetMetricsOk() ([]ModelMetrics, bool) { - if o == nil { - return nil, false - } - return o.Metrics, true -} - -// SetMetrics sets field value -func (o *GetModelMetricsResponse) SetMetrics(v []ModelMetrics) { - o.Metrics = v -} - -func (o GetModelMetricsResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["modelID"] = o.ModelID - } - if true { - toSerialize["metrics"] = o.Metrics - } - return json.Marshal(toSerialize) -} - -func (o GetModelMetricsResponse) String() string { - out := "" - out += fmt.Sprintf(" modelID=%v\n", o.ModelID) - out += fmt.Sprintf(" metrics=%v\n", o.Metrics) - return fmt.Sprintf("GetModelMetricsResponse {\n%s}", out) -} - -type NullableGetModelMetricsResponse struct { - value *GetModelMetricsResponse - isSet bool -} - -func (v NullableGetModelMetricsResponse) Get() *GetModelMetricsResponse { - return v.value -} - -func (v *NullableGetModelMetricsResponse) Set(val *GetModelMetricsResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGetModelMetricsResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGetModelMetricsResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetModelMetricsResponse(val *GetModelMetricsResponse) *NullableGetModelMetricsResponse { - return &NullableGetModelMetricsResponse{value: val, isSet: true} -} - -func (v NullableGetModelMetricsResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetModelMetricsResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_get_segment_users_response.go b/clients/algoliasearch-client-go/algolia/predict/model_get_segment_users_response.go deleted file mode 100644 index c84ae9ce06..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_get_segment_users_response.go +++ /dev/null @@ -1,228 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// GetSegmentUsersResponse struct for GetSegmentUsersResponse -type GetSegmentUsersResponse struct { - // The ID of the segment. - SegmentID string `json:"segmentID" validate:"required"` - Users []UserProfile `json:"users" validate:"required"` - // 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. - PreviousPageToken *string `json:"previousPageToken,omitempty"` - // 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. - NextPageToken *string `json:"nextPageToken,omitempty"` -} - -type GetSegmentUsersResponseOption func(f *GetSegmentUsersResponse) - -func WithGetSegmentUsersResponsePreviousPageToken(val string) GetSegmentUsersResponseOption { - return func(f *GetSegmentUsersResponse) { - f.PreviousPageToken = &val - } -} - -func WithGetSegmentUsersResponseNextPageToken(val string) GetSegmentUsersResponseOption { - return func(f *GetSegmentUsersResponse) { - f.NextPageToken = &val - } -} - -// NewGetSegmentUsersResponse instantiates a new GetSegmentUsersResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewGetSegmentUsersResponse(segmentID string, users []UserProfile, opts ...GetSegmentUsersResponseOption) *GetSegmentUsersResponse { - this := &GetSegmentUsersResponse{} - this.SegmentID = segmentID - this.Users = users - for _, opt := range opts { - opt(this) - } - return this -} - -// NewGetSegmentUsersResponseWithDefaults instantiates a new GetSegmentUsersResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewGetSegmentUsersResponseWithDefaults() *GetSegmentUsersResponse { - this := &GetSegmentUsersResponse{} - return this -} - -// GetSegmentID returns the SegmentID field value -func (o *GetSegmentUsersResponse) GetSegmentID() string { - if o == nil { - var ret string - return ret - } - - return o.SegmentID -} - -// GetSegmentIDOk returns a tuple with the SegmentID field value -// and a boolean to check if the value has been set. -func (o *GetSegmentUsersResponse) GetSegmentIDOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.SegmentID, true -} - -// SetSegmentID sets field value -func (o *GetSegmentUsersResponse) SetSegmentID(v string) { - o.SegmentID = v -} - -// GetUsers returns the Users field value -func (o *GetSegmentUsersResponse) GetUsers() []UserProfile { - if o == nil { - var ret []UserProfile - return ret - } - - return o.Users -} - -// GetUsersOk returns a tuple with the Users field value -// and a boolean to check if the value has been set. -func (o *GetSegmentUsersResponse) GetUsersOk() ([]UserProfile, bool) { - if o == nil { - return nil, false - } - return o.Users, true -} - -// SetUsers sets field value -func (o *GetSegmentUsersResponse) SetUsers(v []UserProfile) { - o.Users = v -} - -// GetPreviousPageToken returns the PreviousPageToken field value if set, zero value otherwise. -func (o *GetSegmentUsersResponse) GetPreviousPageToken() string { - if o == nil || o.PreviousPageToken == nil { - var ret string - return ret - } - return *o.PreviousPageToken -} - -// GetPreviousPageTokenOk returns a tuple with the PreviousPageToken field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetSegmentUsersResponse) GetPreviousPageTokenOk() (*string, bool) { - if o == nil || o.PreviousPageToken == nil { - return nil, false - } - return o.PreviousPageToken, true -} - -// HasPreviousPageToken returns a boolean if a field has been set. -func (o *GetSegmentUsersResponse) HasPreviousPageToken() bool { - if o != nil && o.PreviousPageToken != nil { - return true - } - - return false -} - -// SetPreviousPageToken gets a reference to the given string and assigns it to the PreviousPageToken field. -func (o *GetSegmentUsersResponse) SetPreviousPageToken(v string) { - o.PreviousPageToken = &v -} - -// GetNextPageToken returns the NextPageToken field value if set, zero value otherwise. -func (o *GetSegmentUsersResponse) GetNextPageToken() string { - if o == nil || o.NextPageToken == nil { - var ret string - return ret - } - return *o.NextPageToken -} - -// GetNextPageTokenOk returns a tuple with the NextPageToken field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetSegmentUsersResponse) GetNextPageTokenOk() (*string, bool) { - if o == nil || o.NextPageToken == nil { - return nil, false - } - return o.NextPageToken, true -} - -// HasNextPageToken returns a boolean if a field has been set. -func (o *GetSegmentUsersResponse) HasNextPageToken() bool { - if o != nil && o.NextPageToken != nil { - return true - } - - return false -} - -// SetNextPageToken gets a reference to the given string and assigns it to the NextPageToken field. -func (o *GetSegmentUsersResponse) SetNextPageToken(v string) { - o.NextPageToken = &v -} - -func (o GetSegmentUsersResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["segmentID"] = o.SegmentID - } - if true { - toSerialize["users"] = o.Users - } - if o.PreviousPageToken != nil { - toSerialize["previousPageToken"] = o.PreviousPageToken - } - if o.NextPageToken != nil { - toSerialize["nextPageToken"] = o.NextPageToken - } - return json.Marshal(toSerialize) -} - -func (o GetSegmentUsersResponse) String() string { - out := "" - out += fmt.Sprintf(" segmentID=%v\n", o.SegmentID) - out += fmt.Sprintf(" users=%v\n", o.Users) - out += fmt.Sprintf(" previousPageToken=%v\n", o.PreviousPageToken) - out += fmt.Sprintf(" nextPageToken=%v\n", o.NextPageToken) - return fmt.Sprintf("GetSegmentUsersResponse {\n%s}", out) -} - -type NullableGetSegmentUsersResponse struct { - value *GetSegmentUsersResponse - isSet bool -} - -func (v NullableGetSegmentUsersResponse) Get() *GetSegmentUsersResponse { - return v.value -} - -func (v *NullableGetSegmentUsersResponse) Set(val *GetSegmentUsersResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGetSegmentUsersResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGetSegmentUsersResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetSegmentUsersResponse(val *GetSegmentUsersResponse) *NullableGetSegmentUsersResponse { - return &NullableGetSegmentUsersResponse{value: val, isSet: true} -} - -func (v NullableGetSegmentUsersResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetSegmentUsersResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_limit_param.go b/clients/algoliasearch-client-go/algolia/predict/model_limit_param.go deleted file mode 100644 index 4b5e741cbb..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_limit_param.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// LimitParam struct for LimitParam -type LimitParam struct { - Limit *int32 `json:"limit,omitempty"` -} - -type LimitParamOption func(f *LimitParam) - -func WithLimitParamLimit(val int32) LimitParamOption { - return func(f *LimitParam) { - f.Limit = &val - } -} - -// NewLimitParam instantiates a new LimitParam object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewLimitParam(opts ...LimitParamOption) *LimitParam { - this := &LimitParam{} - for _, opt := range opts { - opt(this) - } - return this -} - -// NewLimitParamWithDefaults instantiates a new LimitParam object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewLimitParamWithDefaults() *LimitParam { - this := &LimitParam{} - return this -} - -// GetLimit returns the Limit field value if set, zero value otherwise. -func (o *LimitParam) GetLimit() int32 { - if o == nil || o.Limit == nil { - var ret int32 - return ret - } - return *o.Limit -} - -// GetLimitOk returns a tuple with the Limit field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *LimitParam) GetLimitOk() (*int32, bool) { - if o == nil || o.Limit == nil { - return nil, false - } - return o.Limit, true -} - -// HasLimit returns a boolean if a field has been set. -func (o *LimitParam) HasLimit() bool { - if o != nil && o.Limit != nil { - return true - } - - return false -} - -// SetLimit gets a reference to the given int32 and assigns it to the Limit field. -func (o *LimitParam) SetLimit(v int32) { - o.Limit = &v -} - -func (o LimitParam) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if o.Limit != nil { - toSerialize["limit"] = o.Limit - } - return json.Marshal(toSerialize) -} - -func (o LimitParam) String() string { - out := "" - out += fmt.Sprintf(" limit=%v\n", o.Limit) - return fmt.Sprintf("LimitParam {\n%s}", out) -} - -type NullableLimitParam struct { - value *LimitParam - isSet bool -} - -func (v NullableLimitParam) Get() *LimitParam { - return v.value -} - -func (v *NullableLimitParam) Set(val *LimitParam) { - v.value = val - v.isSet = true -} - -func (v NullableLimitParam) IsSet() bool { - return v.isSet -} - -func (v *NullableLimitParam) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableLimitParam(val *LimitParam) *NullableLimitParam { - return &NullableLimitParam{value: val, isSet: true} -} - -func (v NullableLimitParam) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableLimitParam) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_model_attributes.go b/clients/algoliasearch-client-go/algolia/predict/model_model_attributes.go deleted file mode 100644 index b85cadcbc0..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_model_attributes.go +++ /dev/null @@ -1,152 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// ModelAttributes struct for ModelAttributes -type ModelAttributes struct { - Name string `json:"name" validate:"required"` - Values []string `json:"values,omitempty"` -} - -type ModelAttributesOption func(f *ModelAttributes) - -func WithModelAttributesValues(val []string) ModelAttributesOption { - return func(f *ModelAttributes) { - f.Values = val - } -} - -// NewModelAttributes instantiates a new ModelAttributes object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewModelAttributes(name string, opts ...ModelAttributesOption) *ModelAttributes { - this := &ModelAttributes{} - this.Name = name - for _, opt := range opts { - opt(this) - } - return this -} - -// NewModelAttributesWithDefaults instantiates a new ModelAttributes object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewModelAttributesWithDefaults() *ModelAttributes { - this := &ModelAttributes{} - return this -} - -// GetName returns the Name field value -func (o *ModelAttributes) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *ModelAttributes) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *ModelAttributes) SetName(v string) { - o.Name = v -} - -// GetValues returns the Values field value if set, zero value otherwise. -func (o *ModelAttributes) GetValues() []string { - if o == nil || o.Values == nil { - var ret []string - return ret - } - return o.Values -} - -// GetValuesOk returns a tuple with the Values field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ModelAttributes) GetValuesOk() ([]string, bool) { - if o == nil || o.Values == nil { - return nil, false - } - return o.Values, true -} - -// HasValues returns a boolean if a field has been set. -func (o *ModelAttributes) HasValues() bool { - if o != nil && o.Values != nil { - return true - } - - return false -} - -// SetValues gets a reference to the given []string and assigns it to the Values field. -func (o *ModelAttributes) SetValues(v []string) { - o.Values = v -} - -func (o ModelAttributes) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["name"] = o.Name - } - if o.Values != nil { - toSerialize["values"] = o.Values - } - return json.Marshal(toSerialize) -} - -func (o ModelAttributes) String() string { - out := "" - out += fmt.Sprintf(" name=%v\n", o.Name) - out += fmt.Sprintf(" values=%v\n", o.Values) - return fmt.Sprintf("ModelAttributes {\n%s}", out) -} - -type NullableModelAttributes struct { - value *ModelAttributes - isSet bool -} - -func (v NullableModelAttributes) Get() *ModelAttributes { - return v.value -} - -func (v *NullableModelAttributes) Set(val *ModelAttributes) { - v.value = val - v.isSet = true -} - -func (v NullableModelAttributes) IsSet() bool { - return v.isSet -} - -func (v *NullableModelAttributes) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableModelAttributes(val *ModelAttributes) *NullableModelAttributes { - return &NullableModelAttributes{value: val, isSet: true} -} - -func (v NullableModelAttributes) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableModelAttributes) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_model_instance.go b/clients/algoliasearch-client-go/algolia/predict/model_model_instance.go deleted file mode 100644 index 6fb42deda1..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_model_instance.go +++ /dev/null @@ -1,409 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// ModelInstance struct for ModelInstance -type ModelInstance struct { - // ID of the model. - ModelID string `json:"modelID" validate:"required"` - // Name of model instance. - Name string `json:"name" validate:"required"` - Type ModelsToRetrieve `json:"type" validate:"required"` - SourceID string `json:"sourceID" validate:"required"` - Index string `json:"index" validate:"required"` - ModelAttributes []ModelAttributes `json:"modelAttributes,omitempty"` - // The date and time this model instance was last trained. - LastTrained string `json:"lastTrained" validate:"required"` - // The date and time this model instance generated its last inference. - LastInference string `json:"lastInference" validate:"required"` - ErrorMessage *string `json:"errorMessage,omitempty"` - ModelStatus GetModelInstanceConfigStatus `json:"modelStatus" validate:"required"` -} - -type ModelInstanceOption func(f *ModelInstance) - -func WithModelInstanceModelAttributes(val []ModelAttributes) ModelInstanceOption { - return func(f *ModelInstance) { - f.ModelAttributes = val - } -} - -func WithModelInstanceErrorMessage(val string) ModelInstanceOption { - return func(f *ModelInstance) { - f.ErrorMessage = &val - } -} - -// NewModelInstance instantiates a new ModelInstance object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewModelInstance(modelID string, name string, type_ ModelsToRetrieve, sourceID string, index string, lastTrained string, lastInference string, modelStatus GetModelInstanceConfigStatus, opts ...ModelInstanceOption) *ModelInstance { - this := &ModelInstance{} - this.ModelID = modelID - this.Name = name - this.Type = type_ - this.SourceID = sourceID - this.Index = index - this.LastTrained = lastTrained - this.LastInference = lastInference - this.ModelStatus = modelStatus - for _, opt := range opts { - opt(this) - } - return this -} - -// NewModelInstanceWithDefaults instantiates a new ModelInstance object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewModelInstanceWithDefaults() *ModelInstance { - this := &ModelInstance{} - return this -} - -// GetModelID returns the ModelID field value -func (o *ModelInstance) GetModelID() string { - if o == nil { - var ret string - return ret - } - - return o.ModelID -} - -// GetModelIDOk returns a tuple with the ModelID field value -// and a boolean to check if the value has been set. -func (o *ModelInstance) GetModelIDOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ModelID, true -} - -// SetModelID sets field value -func (o *ModelInstance) SetModelID(v string) { - o.ModelID = v -} - -// GetName returns the Name field value -func (o *ModelInstance) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *ModelInstance) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *ModelInstance) SetName(v string) { - o.Name = v -} - -// GetType returns the Type field value -func (o *ModelInstance) GetType() ModelsToRetrieve { - if o == nil { - var ret ModelsToRetrieve - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *ModelInstance) GetTypeOk() (*ModelsToRetrieve, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *ModelInstance) SetType(v ModelsToRetrieve) { - o.Type = v -} - -// GetSourceID returns the SourceID field value -func (o *ModelInstance) GetSourceID() string { - if o == nil { - var ret string - return ret - } - - return o.SourceID -} - -// GetSourceIDOk returns a tuple with the SourceID field value -// and a boolean to check if the value has been set. -func (o *ModelInstance) GetSourceIDOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.SourceID, true -} - -// SetSourceID sets field value -func (o *ModelInstance) SetSourceID(v string) { - o.SourceID = v -} - -// GetIndex returns the Index field value -func (o *ModelInstance) GetIndex() string { - if o == nil { - var ret string - return ret - } - - return o.Index -} - -// GetIndexOk returns a tuple with the Index field value -// and a boolean to check if the value has been set. -func (o *ModelInstance) GetIndexOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Index, true -} - -// SetIndex sets field value -func (o *ModelInstance) SetIndex(v string) { - o.Index = v -} - -// GetModelAttributes returns the ModelAttributes field value if set, zero value otherwise. -func (o *ModelInstance) GetModelAttributes() []ModelAttributes { - if o == nil || o.ModelAttributes == nil { - var ret []ModelAttributes - return ret - } - return o.ModelAttributes -} - -// GetModelAttributesOk returns a tuple with the ModelAttributes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ModelInstance) GetModelAttributesOk() ([]ModelAttributes, bool) { - if o == nil || o.ModelAttributes == nil { - return nil, false - } - return o.ModelAttributes, true -} - -// HasModelAttributes returns a boolean if a field has been set. -func (o *ModelInstance) HasModelAttributes() bool { - if o != nil && o.ModelAttributes != nil { - return true - } - - return false -} - -// SetModelAttributes gets a reference to the given []ModelAttributes and assigns it to the ModelAttributes field. -func (o *ModelInstance) SetModelAttributes(v []ModelAttributes) { - o.ModelAttributes = v -} - -// GetLastTrained returns the LastTrained field value -func (o *ModelInstance) GetLastTrained() string { - if o == nil { - var ret string - return ret - } - - return o.LastTrained -} - -// GetLastTrainedOk returns a tuple with the LastTrained field value -// and a boolean to check if the value has been set. -func (o *ModelInstance) GetLastTrainedOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.LastTrained, true -} - -// SetLastTrained sets field value -func (o *ModelInstance) SetLastTrained(v string) { - o.LastTrained = v -} - -// GetLastInference returns the LastInference field value -func (o *ModelInstance) GetLastInference() string { - if o == nil { - var ret string - return ret - } - - return o.LastInference -} - -// GetLastInferenceOk returns a tuple with the LastInference field value -// and a boolean to check if the value has been set. -func (o *ModelInstance) GetLastInferenceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.LastInference, true -} - -// SetLastInference sets field value -func (o *ModelInstance) SetLastInference(v string) { - o.LastInference = v -} - -// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. -func (o *ModelInstance) GetErrorMessage() string { - if o == nil || o.ErrorMessage == nil { - var ret string - return ret - } - return *o.ErrorMessage -} - -// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ModelInstance) GetErrorMessageOk() (*string, bool) { - if o == nil || o.ErrorMessage == nil { - return nil, false - } - return o.ErrorMessage, true -} - -// HasErrorMessage returns a boolean if a field has been set. -func (o *ModelInstance) HasErrorMessage() bool { - if o != nil && o.ErrorMessage != nil { - return true - } - - return false -} - -// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. -func (o *ModelInstance) SetErrorMessage(v string) { - o.ErrorMessage = &v -} - -// GetModelStatus returns the ModelStatus field value -func (o *ModelInstance) GetModelStatus() GetModelInstanceConfigStatus { - if o == nil { - var ret GetModelInstanceConfigStatus - return ret - } - - return o.ModelStatus -} - -// GetModelStatusOk returns a tuple with the ModelStatus field value -// and a boolean to check if the value has been set. -func (o *ModelInstance) GetModelStatusOk() (*GetModelInstanceConfigStatus, bool) { - if o == nil { - return nil, false - } - return &o.ModelStatus, true -} - -// SetModelStatus sets field value -func (o *ModelInstance) SetModelStatus(v GetModelInstanceConfigStatus) { - o.ModelStatus = v -} - -func (o ModelInstance) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["modelID"] = o.ModelID - } - if true { - toSerialize["name"] = o.Name - } - if true { - toSerialize["type"] = o.Type - } - if true { - toSerialize["sourceID"] = o.SourceID - } - if true { - toSerialize["index"] = o.Index - } - if o.ModelAttributes != nil { - toSerialize["modelAttributes"] = o.ModelAttributes - } - if true { - toSerialize["lastTrained"] = o.LastTrained - } - if true { - toSerialize["lastInference"] = o.LastInference - } - if o.ErrorMessage != nil { - toSerialize["errorMessage"] = o.ErrorMessage - } - if true { - toSerialize["modelStatus"] = o.ModelStatus - } - return json.Marshal(toSerialize) -} - -func (o ModelInstance) String() string { - out := "" - out += fmt.Sprintf(" modelID=%v\n", o.ModelID) - out += fmt.Sprintf(" name=%v\n", o.Name) - out += fmt.Sprintf(" type=%v\n", o.Type) - out += fmt.Sprintf(" sourceID=%v\n", o.SourceID) - out += fmt.Sprintf(" index=%v\n", o.Index) - out += fmt.Sprintf(" modelAttributes=%v\n", o.ModelAttributes) - out += fmt.Sprintf(" lastTrained=%v\n", o.LastTrained) - out += fmt.Sprintf(" lastInference=%v\n", o.LastInference) - out += fmt.Sprintf(" errorMessage=%v\n", o.ErrorMessage) - out += fmt.Sprintf(" modelStatus=%v\n", o.ModelStatus) - return fmt.Sprintf("ModelInstance {\n%s}", out) -} - -type NullableModelInstance struct { - value *ModelInstance - isSet bool -} - -func (v NullableModelInstance) Get() *ModelInstance { - return v.value -} - -func (v *NullableModelInstance) Set(val *ModelInstance) { - v.value = val - v.isSet = true -} - -func (v NullableModelInstance) IsSet() bool { - return v.isSet -} - -func (v *NullableModelInstance) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableModelInstance(val *ModelInstance) *NullableModelInstance { - return &NullableModelInstance{value: val, isSet: true} -} - -func (v NullableModelInstance) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableModelInstance) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_model_metrics.go b/clients/algoliasearch-client-go/algolia/predict/model_model_metrics.go deleted file mode 100644 index ce151e7446..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_model_metrics.go +++ /dev/null @@ -1,338 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// ModelMetrics struct for ModelMetrics -type ModelMetrics struct { - Precision *float64 `json:"precision,omitempty"` - Recall *float64 `json:"recall,omitempty"` - Mrr *float64 `json:"mrr,omitempty"` - Coverage *float64 `json:"coverage,omitempty"` - F1Score *float64 `json:"f1_score,omitempty"` - // Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - UpdatedAt *string `json:"updatedAt,omitempty"` -} - -type ModelMetricsOption func(f *ModelMetrics) - -func WithModelMetricsPrecision(val float64) ModelMetricsOption { - return func(f *ModelMetrics) { - f.Precision = &val - } -} - -func WithModelMetricsRecall(val float64) ModelMetricsOption { - return func(f *ModelMetrics) { - f.Recall = &val - } -} - -func WithModelMetricsMrr(val float64) ModelMetricsOption { - return func(f *ModelMetrics) { - f.Mrr = &val - } -} - -func WithModelMetricsCoverage(val float64) ModelMetricsOption { - return func(f *ModelMetrics) { - f.Coverage = &val - } -} - -func WithModelMetricsF1Score(val float64) ModelMetricsOption { - return func(f *ModelMetrics) { - f.F1Score = &val - } -} - -func WithModelMetricsUpdatedAt(val string) ModelMetricsOption { - return func(f *ModelMetrics) { - f.UpdatedAt = &val - } -} - -// NewModelMetrics instantiates a new ModelMetrics object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewModelMetrics(opts ...ModelMetricsOption) *ModelMetrics { - this := &ModelMetrics{} - for _, opt := range opts { - opt(this) - } - return this -} - -// NewModelMetricsWithDefaults instantiates a new ModelMetrics object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewModelMetricsWithDefaults() *ModelMetrics { - this := &ModelMetrics{} - return this -} - -// GetPrecision returns the Precision field value if set, zero value otherwise. -func (o *ModelMetrics) GetPrecision() float64 { - if o == nil || o.Precision == nil { - var ret float64 - return ret - } - return *o.Precision -} - -// GetPrecisionOk returns a tuple with the Precision field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ModelMetrics) GetPrecisionOk() (*float64, bool) { - if o == nil || o.Precision == nil { - return nil, false - } - return o.Precision, true -} - -// HasPrecision returns a boolean if a field has been set. -func (o *ModelMetrics) HasPrecision() bool { - if o != nil && o.Precision != nil { - return true - } - - return false -} - -// SetPrecision gets a reference to the given float64 and assigns it to the Precision field. -func (o *ModelMetrics) SetPrecision(v float64) { - o.Precision = &v -} - -// GetRecall returns the Recall field value if set, zero value otherwise. -func (o *ModelMetrics) GetRecall() float64 { - if o == nil || o.Recall == nil { - var ret float64 - return ret - } - return *o.Recall -} - -// GetRecallOk returns a tuple with the Recall field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ModelMetrics) GetRecallOk() (*float64, bool) { - if o == nil || o.Recall == nil { - return nil, false - } - return o.Recall, true -} - -// HasRecall returns a boolean if a field has been set. -func (o *ModelMetrics) HasRecall() bool { - if o != nil && o.Recall != nil { - return true - } - - return false -} - -// SetRecall gets a reference to the given float64 and assigns it to the Recall field. -func (o *ModelMetrics) SetRecall(v float64) { - o.Recall = &v -} - -// GetMrr returns the Mrr field value if set, zero value otherwise. -func (o *ModelMetrics) GetMrr() float64 { - if o == nil || o.Mrr == nil { - var ret float64 - return ret - } - return *o.Mrr -} - -// GetMrrOk returns a tuple with the Mrr field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ModelMetrics) GetMrrOk() (*float64, bool) { - if o == nil || o.Mrr == nil { - return nil, false - } - return o.Mrr, true -} - -// HasMrr returns a boolean if a field has been set. -func (o *ModelMetrics) HasMrr() bool { - if o != nil && o.Mrr != nil { - return true - } - - return false -} - -// SetMrr gets a reference to the given float64 and assigns it to the Mrr field. -func (o *ModelMetrics) SetMrr(v float64) { - o.Mrr = &v -} - -// GetCoverage returns the Coverage field value if set, zero value otherwise. -func (o *ModelMetrics) GetCoverage() float64 { - if o == nil || o.Coverage == nil { - var ret float64 - return ret - } - return *o.Coverage -} - -// GetCoverageOk returns a tuple with the Coverage field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ModelMetrics) GetCoverageOk() (*float64, bool) { - if o == nil || o.Coverage == nil { - return nil, false - } - return o.Coverage, true -} - -// HasCoverage returns a boolean if a field has been set. -func (o *ModelMetrics) HasCoverage() bool { - if o != nil && o.Coverage != nil { - return true - } - - return false -} - -// SetCoverage gets a reference to the given float64 and assigns it to the Coverage field. -func (o *ModelMetrics) SetCoverage(v float64) { - o.Coverage = &v -} - -// GetF1Score returns the F1Score field value if set, zero value otherwise. -func (o *ModelMetrics) GetF1Score() float64 { - if o == nil || o.F1Score == nil { - var ret float64 - return ret - } - return *o.F1Score -} - -// GetF1ScoreOk returns a tuple with the F1Score field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ModelMetrics) GetF1ScoreOk() (*float64, bool) { - if o == nil || o.F1Score == nil { - return nil, false - } - return o.F1Score, true -} - -// HasF1Score returns a boolean if a field has been set. -func (o *ModelMetrics) HasF1Score() bool { - if o != nil && o.F1Score != nil { - return true - } - - return false -} - -// SetF1Score gets a reference to the given float64 and assigns it to the F1Score field. -func (o *ModelMetrics) SetF1Score(v float64) { - o.F1Score = &v -} - -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *ModelMetrics) GetUpdatedAt() string { - if o == nil || o.UpdatedAt == nil { - var ret string - return ret - } - return *o.UpdatedAt -} - -// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ModelMetrics) GetUpdatedAtOk() (*string, bool) { - if o == nil || o.UpdatedAt == nil { - return nil, false - } - return o.UpdatedAt, true -} - -// HasUpdatedAt returns a boolean if a field has been set. -func (o *ModelMetrics) HasUpdatedAt() bool { - if o != nil && o.UpdatedAt != nil { - return true - } - - return false -} - -// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field. -func (o *ModelMetrics) SetUpdatedAt(v string) { - o.UpdatedAt = &v -} - -func (o ModelMetrics) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if o.Precision != nil { - toSerialize["precision"] = o.Precision - } - if o.Recall != nil { - toSerialize["recall"] = o.Recall - } - if o.Mrr != nil { - toSerialize["mrr"] = o.Mrr - } - if o.Coverage != nil { - toSerialize["coverage"] = o.Coverage - } - if o.F1Score != nil { - toSerialize["f1_score"] = o.F1Score - } - if o.UpdatedAt != nil { - toSerialize["updatedAt"] = o.UpdatedAt - } - return json.Marshal(toSerialize) -} - -func (o ModelMetrics) String() string { - out := "" - out += fmt.Sprintf(" precision=%v\n", o.Precision) - out += fmt.Sprintf(" recall=%v\n", o.Recall) - out += fmt.Sprintf(" mrr=%v\n", o.Mrr) - out += fmt.Sprintf(" coverage=%v\n", o.Coverage) - out += fmt.Sprintf(" f1_score=%v\n", o.F1Score) - out += fmt.Sprintf(" updatedAt=%v\n", o.UpdatedAt) - return fmt.Sprintf("ModelMetrics {\n%s}", out) -} - -type NullableModelMetrics struct { - value *ModelMetrics - isSet bool -} - -func (v NullableModelMetrics) Get() *ModelMetrics { - return v.value -} - -func (v *NullableModelMetrics) Set(val *ModelMetrics) { - v.value = val - v.isSet = true -} - -func (v NullableModelMetrics) IsSet() bool { - return v.isSet -} - -func (v *NullableModelMetrics) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableModelMetrics(val *ModelMetrics) *NullableModelMetrics { - return &NullableModelMetrics{value: val, isSet: true} -} - -func (v NullableModelMetrics) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableModelMetrics) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_model_status.go b/clients/algoliasearch-client-go/algolia/predict/model_model_status.go deleted file mode 100644 index bb2dea3a51..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_model_status.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// 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`. -type ModelStatus string - -// List of modelStatus -const ( - MODELSTATUS_ACTIVE ModelStatus = "active" - MODELSTATUS_INACTIVE ModelStatus = "inactive" -) - -// All allowed values of ModelStatus enum -var AllowedModelStatusEnumValues = []ModelStatus{ - "active", - "inactive", -} - -func (v *ModelStatus) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ModelStatus(value) - for _, existing := range AllowedModelStatusEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid ModelStatus", value) -} - -// NewModelStatusFromValue returns a pointer to a valid ModelStatus -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewModelStatusFromValue(v string) (*ModelStatus, error) { - ev := ModelStatus(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ModelStatus: valid values are %v", v, AllowedModelStatusEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ModelStatus) IsValid() bool { - for _, existing := range AllowedModelStatusEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to modelStatus value -func (v ModelStatus) Ptr() *ModelStatus { - return &v -} - -type NullableModelStatus struct { - value *ModelStatus - isSet bool -} - -func (v NullableModelStatus) Get() *ModelStatus { - return v.value -} - -func (v *NullableModelStatus) Set(val *ModelStatus) { - v.value = val - v.isSet = true -} - -func (v NullableModelStatus) IsSet() bool { - return v.isSet -} - -func (v *NullableModelStatus) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableModelStatus(val *ModelStatus) *NullableModelStatus { - return &NullableModelStatus{value: val, isSet: true} -} - -func (v NullableModelStatus) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableModelStatus) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_models_to_retrieve.go b/clients/algoliasearch-client-go/algolia/predict/model_models_to_retrieve.go deleted file mode 100644 index 856b0267f2..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_models_to_retrieve.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// ModelsToRetrieve the model 'ModelsToRetrieve' -type ModelsToRetrieve string - -// List of modelsToRetrieve -const ( - MODELSTORETRIEVE_FUNNEL_STAGE ModelsToRetrieve = "funnel_stage" - MODELSTORETRIEVE_ORDER_VALUE ModelsToRetrieve = "order_value" - MODELSTORETRIEVE_AFFINITIES ModelsToRetrieve = "affinities" -) - -// All allowed values of ModelsToRetrieve enum -var AllowedModelsToRetrieveEnumValues = []ModelsToRetrieve{ - "funnel_stage", - "order_value", - "affinities", -} - -func (v *ModelsToRetrieve) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ModelsToRetrieve(value) - for _, existing := range AllowedModelsToRetrieveEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid ModelsToRetrieve", value) -} - -// NewModelsToRetrieveFromValue returns a pointer to a valid ModelsToRetrieve -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewModelsToRetrieveFromValue(v string) (*ModelsToRetrieve, error) { - ev := ModelsToRetrieve(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ModelsToRetrieve: valid values are %v", v, AllowedModelsToRetrieveEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ModelsToRetrieve) IsValid() bool { - for _, existing := range AllowedModelsToRetrieveEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to modelsToRetrieve value -func (v ModelsToRetrieve) Ptr() *ModelsToRetrieve { - return &v -} - -type NullableModelsToRetrieve struct { - value *ModelsToRetrieve - isSet bool -} - -func (v NullableModelsToRetrieve) Get() *ModelsToRetrieve { - return v.value -} - -func (v *NullableModelsToRetrieve) Set(val *ModelsToRetrieve) { - v.value = val - v.isSet = true -} - -func (v NullableModelsToRetrieve) IsSet() bool { - return v.isSet -} - -func (v *NullableModelsToRetrieve) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableModelsToRetrieve(val *ModelsToRetrieve) *NullableModelsToRetrieve { - return &NullableModelsToRetrieve{value: val, isSet: true} -} - -func (v NullableModelsToRetrieve) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableModelsToRetrieve) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_models_to_retrieve_param.go b/clients/algoliasearch-client-go/algolia/predict/model_models_to_retrieve_param.go deleted file mode 100644 index 542db76f8e..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_models_to_retrieve_param.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// ModelsToRetrieveParam struct for ModelsToRetrieveParam -type ModelsToRetrieveParam struct { - ModelsToRetrieve []ModelsToRetrieve `json:"modelsToRetrieve,omitempty"` -} - -type ModelsToRetrieveParamOption func(f *ModelsToRetrieveParam) - -func WithModelsToRetrieveParamModelsToRetrieve(val []ModelsToRetrieve) ModelsToRetrieveParamOption { - return func(f *ModelsToRetrieveParam) { - f.ModelsToRetrieve = val - } -} - -// NewModelsToRetrieveParam instantiates a new ModelsToRetrieveParam object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewModelsToRetrieveParam(opts ...ModelsToRetrieveParamOption) *ModelsToRetrieveParam { - this := &ModelsToRetrieveParam{} - for _, opt := range opts { - opt(this) - } - return this -} - -// NewModelsToRetrieveParamWithDefaults instantiates a new ModelsToRetrieveParam object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewModelsToRetrieveParamWithDefaults() *ModelsToRetrieveParam { - this := &ModelsToRetrieveParam{} - return this -} - -// GetModelsToRetrieve returns the ModelsToRetrieve field value if set, zero value otherwise. -func (o *ModelsToRetrieveParam) GetModelsToRetrieve() []ModelsToRetrieve { - if o == nil || o.ModelsToRetrieve == nil { - var ret []ModelsToRetrieve - return ret - } - return o.ModelsToRetrieve -} - -// GetModelsToRetrieveOk returns a tuple with the ModelsToRetrieve field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ModelsToRetrieveParam) GetModelsToRetrieveOk() ([]ModelsToRetrieve, bool) { - if o == nil || o.ModelsToRetrieve == nil { - return nil, false - } - return o.ModelsToRetrieve, true -} - -// HasModelsToRetrieve returns a boolean if a field has been set. -func (o *ModelsToRetrieveParam) HasModelsToRetrieve() bool { - if o != nil && o.ModelsToRetrieve != nil { - return true - } - - return false -} - -// SetModelsToRetrieve gets a reference to the given []ModelsToRetrieve and assigns it to the ModelsToRetrieve field. -func (o *ModelsToRetrieveParam) SetModelsToRetrieve(v []ModelsToRetrieve) { - o.ModelsToRetrieve = v -} - -func (o ModelsToRetrieveParam) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if o.ModelsToRetrieve != nil { - toSerialize["modelsToRetrieve"] = o.ModelsToRetrieve - } - return json.Marshal(toSerialize) -} - -func (o ModelsToRetrieveParam) String() string { - out := "" - out += fmt.Sprintf(" modelsToRetrieve=%v\n", o.ModelsToRetrieve) - return fmt.Sprintf("ModelsToRetrieveParam {\n%s}", out) -} - -type NullableModelsToRetrieveParam struct { - value *ModelsToRetrieveParam - isSet bool -} - -func (v NullableModelsToRetrieveParam) Get() *ModelsToRetrieveParam { - return v.value -} - -func (v *NullableModelsToRetrieveParam) Set(val *ModelsToRetrieveParam) { - v.value = val - v.isSet = true -} - -func (v NullableModelsToRetrieveParam) IsSet() bool { - return v.isSet -} - -func (v *NullableModelsToRetrieveParam) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableModelsToRetrieveParam(val *ModelsToRetrieveParam) *NullableModelsToRetrieveParam { - return &NullableModelsToRetrieveParam{value: val, isSet: true} -} - -func (v NullableModelsToRetrieveParam) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableModelsToRetrieveParam) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_next_page_token_param.go b/clients/algoliasearch-client-go/algolia/predict/model_next_page_token_param.go deleted file mode 100644 index 77d916cc78..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_next_page_token_param.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// NextPageTokenParam struct for NextPageTokenParam -type NextPageTokenParam struct { - // 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. - NextPageToken *string `json:"nextPageToken,omitempty"` -} - -type NextPageTokenParamOption func(f *NextPageTokenParam) - -func WithNextPageTokenParamNextPageToken(val string) NextPageTokenParamOption { - return func(f *NextPageTokenParam) { - f.NextPageToken = &val - } -} - -// NewNextPageTokenParam instantiates a new NextPageTokenParam object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewNextPageTokenParam(opts ...NextPageTokenParamOption) *NextPageTokenParam { - this := &NextPageTokenParam{} - for _, opt := range opts { - opt(this) - } - return this -} - -// NewNextPageTokenParamWithDefaults instantiates a new NextPageTokenParam object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewNextPageTokenParamWithDefaults() *NextPageTokenParam { - this := &NextPageTokenParam{} - return this -} - -// GetNextPageToken returns the NextPageToken field value if set, zero value otherwise. -func (o *NextPageTokenParam) GetNextPageToken() string { - if o == nil || o.NextPageToken == nil { - var ret string - return ret - } - return *o.NextPageToken -} - -// GetNextPageTokenOk returns a tuple with the NextPageToken field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NextPageTokenParam) GetNextPageTokenOk() (*string, bool) { - if o == nil || o.NextPageToken == nil { - return nil, false - } - return o.NextPageToken, true -} - -// HasNextPageToken returns a boolean if a field has been set. -func (o *NextPageTokenParam) HasNextPageToken() bool { - if o != nil && o.NextPageToken != nil { - return true - } - - return false -} - -// SetNextPageToken gets a reference to the given string and assigns it to the NextPageToken field. -func (o *NextPageTokenParam) SetNextPageToken(v string) { - o.NextPageToken = &v -} - -func (o NextPageTokenParam) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if o.NextPageToken != nil { - toSerialize["nextPageToken"] = o.NextPageToken - } - return json.Marshal(toSerialize) -} - -func (o NextPageTokenParam) String() string { - out := "" - out += fmt.Sprintf(" nextPageToken=%v\n", o.NextPageToken) - return fmt.Sprintf("NextPageTokenParam {\n%s}", out) -} - -type NullableNextPageTokenParam struct { - value *NextPageTokenParam - isSet bool -} - -func (v NullableNextPageTokenParam) Get() *NextPageTokenParam { - return v.value -} - -func (v *NullableNextPageTokenParam) Set(val *NextPageTokenParam) { - v.value = val - v.isSet = true -} - -func (v NullableNextPageTokenParam) IsSet() bool { - return v.isSet -} - -func (v *NullableNextPageTokenParam) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNextPageTokenParam(val *NextPageTokenParam) *NullableNextPageTokenParam { - return &NullableNextPageTokenParam{value: val, isSet: true} -} - -func (v NullableNextPageTokenParam) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNextPageTokenParam) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_params.go b/clients/algoliasearch-client-go/algolia/predict/model_params.go deleted file mode 100644 index 71d86990c8..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_params.go +++ /dev/null @@ -1,154 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// Params - struct for Params -type Params struct { - AllParams *AllParams - ModelsToRetrieveParam *ModelsToRetrieveParam - TypesToRetrieveParam *TypesToRetrieveParam -} - -// AllParamsAsParams is a convenience function that returns AllParams wrapped in Params -func AllParamsAsParams(v *AllParams) Params { - return Params{ - AllParams: v, - } -} - -// ModelsToRetrieveParamAsParams is a convenience function that returns ModelsToRetrieveParam wrapped in Params -func ModelsToRetrieveParamAsParams(v *ModelsToRetrieveParam) Params { - return Params{ - ModelsToRetrieveParam: v, - } -} - -// TypesToRetrieveParamAsParams is a convenience function that returns TypesToRetrieveParam wrapped in Params -func TypesToRetrieveParamAsParams(v *TypesToRetrieveParam) Params { - return Params{ - TypesToRetrieveParam: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *Params) UnmarshalJSON(data []byte) error { - var err error - // try to unmarshal data into AllParams - err = newStrictDecoder(data).Decode(&dst.AllParams) - if err == nil && validateStruct(dst.AllParams) == nil { - jsonAllParams, _ := json.Marshal(dst.AllParams) - if string(jsonAllParams) == "{}" { // empty struct - dst.AllParams = nil - } else { - return nil - } - } else { - dst.AllParams = nil - } - - // try to unmarshal data into ModelsToRetrieveParam - err = newStrictDecoder(data).Decode(&dst.ModelsToRetrieveParam) - if err == nil && validateStruct(dst.ModelsToRetrieveParam) == nil { - jsonModelsToRetrieveParam, _ := json.Marshal(dst.ModelsToRetrieveParam) - if string(jsonModelsToRetrieveParam) == "{}" { // empty struct - dst.ModelsToRetrieveParam = nil - } else { - return nil - } - } else { - dst.ModelsToRetrieveParam = nil - } - - // try to unmarshal data into TypesToRetrieveParam - err = newStrictDecoder(data).Decode(&dst.TypesToRetrieveParam) - if err == nil && validateStruct(dst.TypesToRetrieveParam) == nil { - jsonTypesToRetrieveParam, _ := json.Marshal(dst.TypesToRetrieveParam) - if string(jsonTypesToRetrieveParam) == "{}" { // empty struct - dst.TypesToRetrieveParam = nil - } else { - return nil - } - } else { - dst.TypesToRetrieveParam = nil - } - - return fmt.Errorf("Data failed to match schemas in oneOf(Params)") -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src Params) MarshalJSON() ([]byte, error) { - if src.AllParams != nil { - return json.Marshal(&src.AllParams) - } - - if src.ModelsToRetrieveParam != nil { - return json.Marshal(&src.ModelsToRetrieveParam) - } - - if src.TypesToRetrieveParam != nil { - return json.Marshal(&src.TypesToRetrieveParam) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *Params) GetActualInstance() any { - if obj == nil { - return nil - } - if obj.AllParams != nil { - return obj.AllParams - } - - if obj.ModelsToRetrieveParam != nil { - return obj.ModelsToRetrieveParam - } - - if obj.TypesToRetrieveParam != nil { - return obj.TypesToRetrieveParam - } - - // all schemas are nil - return nil -} - -type NullableParams struct { - value *Params - isSet bool -} - -func (v NullableParams) Get() *Params { - return v.value -} - -func (v *NullableParams) Set(val *Params) { - v.value = val - v.isSet = true -} - -func (v NullableParams) IsSet() bool { - return v.isSet -} - -func (v *NullableParams) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableParams(val *Params) *NullableParams { - return &NullableParams{value: val, isSet: true} -} - -func (v NullableParams) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableParams) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_prediction_affinity_value.go b/clients/algoliasearch-client-go/algolia/predict/model_prediction_affinity_value.go deleted file mode 100644 index 6f58e599e4..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_prediction_affinity_value.go +++ /dev/null @@ -1,154 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// PredictionAffinityValue - struct for PredictionAffinityValue -type PredictionAffinityValue struct { - Bool *bool - Float64 *float64 - String *string -} - -// boolAsPredictionAffinityValue is a convenience function that returns bool wrapped in PredictionAffinityValue -func BoolAsPredictionAffinityValue(v *bool) PredictionAffinityValue { - return PredictionAffinityValue{ - Bool: v, - } -} - -// float64AsPredictionAffinityValue is a convenience function that returns float64 wrapped in PredictionAffinityValue -func Float64AsPredictionAffinityValue(v *float64) PredictionAffinityValue { - return PredictionAffinityValue{ - Float64: v, - } -} - -// stringAsPredictionAffinityValue is a convenience function that returns string wrapped in PredictionAffinityValue -func StringAsPredictionAffinityValue(v *string) PredictionAffinityValue { - return PredictionAffinityValue{ - String: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *PredictionAffinityValue) UnmarshalJSON(data []byte) error { - var err error - // try to unmarshal data into Bool - err = newStrictDecoder(data).Decode(&dst.Bool) - if err == nil && validateStruct(dst.Bool) == nil { - jsonBool, _ := json.Marshal(dst.Bool) - if string(jsonBool) == "{}" { // empty struct - dst.Bool = nil - } else { - return nil - } - } else { - dst.Bool = nil - } - - // try to unmarshal data into Float64 - err = newStrictDecoder(data).Decode(&dst.Float64) - if err == nil && validateStruct(dst.Float64) == nil { - jsonFloat64, _ := json.Marshal(dst.Float64) - if string(jsonFloat64) == "{}" { // empty struct - dst.Float64 = nil - } else { - return nil - } - } else { - dst.Float64 = nil - } - - // try to unmarshal data into String - err = newStrictDecoder(data).Decode(&dst.String) - if err == nil && validateStruct(dst.String) == nil { - jsonString, _ := json.Marshal(dst.String) - if string(jsonString) == "{}" { // empty struct - dst.String = nil - } else { - return nil - } - } else { - dst.String = nil - } - - return fmt.Errorf("Data failed to match schemas in oneOf(PredictionAffinityValue)") -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src PredictionAffinityValue) MarshalJSON() ([]byte, error) { - if src.Bool != nil { - return json.Marshal(&src.Bool) - } - - if src.Float64 != nil { - return json.Marshal(&src.Float64) - } - - if src.String != nil { - return json.Marshal(&src.String) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *PredictionAffinityValue) GetActualInstance() any { - if obj == nil { - return nil - } - if obj.Bool != nil { - return obj.Bool - } - - if obj.Float64 != nil { - return obj.Float64 - } - - if obj.String != nil { - return obj.String - } - - // all schemas are nil - return nil -} - -type NullablePredictionAffinityValue struct { - value *PredictionAffinityValue - isSet bool -} - -func (v NullablePredictionAffinityValue) Get() *PredictionAffinityValue { - return v.value -} - -func (v *NullablePredictionAffinityValue) Set(val *PredictionAffinityValue) { - v.value = val - v.isSet = true -} - -func (v NullablePredictionAffinityValue) IsSet() bool { - return v.isSet -} - -func (v *NullablePredictionAffinityValue) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePredictionAffinityValue(val *PredictionAffinityValue) *NullablePredictionAffinityValue { - return &NullablePredictionAffinityValue{value: val, isSet: true} -} - -func (v NullablePredictionAffinityValue) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePredictionAffinityValue) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_predictions.go b/clients/algoliasearch-client-go/algolia/predict/model_predictions.go deleted file mode 100644 index 810943d64f..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_predictions.go +++ /dev/null @@ -1,208 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// Predictions struct for Predictions -type Predictions struct { - FunnelStage *PredictionsFunnelStage `json:"funnel_stage,omitempty"` - OrderValue *PredictionsOrderValue `json:"order_value,omitempty"` - Affinities *PredictionsAffinities `json:"affinities,omitempty"` -} - -type PredictionsOption func(f *Predictions) - -func WithPredictionsFunnelStage(val PredictionsFunnelStage) PredictionsOption { - return func(f *Predictions) { - f.FunnelStage = &val - } -} - -func WithPredictionsOrderValue(val PredictionsOrderValue) PredictionsOption { - return func(f *Predictions) { - f.OrderValue = &val - } -} - -func WithPredictionsAffinities(val PredictionsAffinities) PredictionsOption { - return func(f *Predictions) { - f.Affinities = &val - } -} - -// NewPredictions instantiates a new Predictions object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewPredictions(opts ...PredictionsOption) *Predictions { - this := &Predictions{} - for _, opt := range opts { - opt(this) - } - return this -} - -// NewPredictionsWithDefaults instantiates a new Predictions object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewPredictionsWithDefaults() *Predictions { - this := &Predictions{} - return this -} - -// GetFunnelStage returns the FunnelStage field value if set, zero value otherwise. -func (o *Predictions) GetFunnelStage() PredictionsFunnelStage { - if o == nil || o.FunnelStage == nil { - var ret PredictionsFunnelStage - return ret - } - return *o.FunnelStage -} - -// GetFunnelStageOk returns a tuple with the FunnelStage field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Predictions) GetFunnelStageOk() (*PredictionsFunnelStage, bool) { - if o == nil || o.FunnelStage == nil { - return nil, false - } - return o.FunnelStage, true -} - -// HasFunnelStage returns a boolean if a field has been set. -func (o *Predictions) HasFunnelStage() bool { - if o != nil && o.FunnelStage != nil { - return true - } - - return false -} - -// SetFunnelStage gets a reference to the given PredictionsFunnelStage and assigns it to the FunnelStage field. -func (o *Predictions) SetFunnelStage(v PredictionsFunnelStage) { - o.FunnelStage = &v -} - -// GetOrderValue returns the OrderValue field value if set, zero value otherwise. -func (o *Predictions) GetOrderValue() PredictionsOrderValue { - if o == nil || o.OrderValue == nil { - var ret PredictionsOrderValue - return ret - } - return *o.OrderValue -} - -// GetOrderValueOk returns a tuple with the OrderValue field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Predictions) GetOrderValueOk() (*PredictionsOrderValue, bool) { - if o == nil || o.OrderValue == nil { - return nil, false - } - return o.OrderValue, true -} - -// HasOrderValue returns a boolean if a field has been set. -func (o *Predictions) HasOrderValue() bool { - if o != nil && o.OrderValue != nil { - return true - } - - return false -} - -// SetOrderValue gets a reference to the given PredictionsOrderValue and assigns it to the OrderValue field. -func (o *Predictions) SetOrderValue(v PredictionsOrderValue) { - o.OrderValue = &v -} - -// GetAffinities returns the Affinities field value if set, zero value otherwise. -func (o *Predictions) GetAffinities() PredictionsAffinities { - if o == nil || o.Affinities == nil { - var ret PredictionsAffinities - return ret - } - return *o.Affinities -} - -// GetAffinitiesOk returns a tuple with the Affinities field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Predictions) GetAffinitiesOk() (*PredictionsAffinities, bool) { - if o == nil || o.Affinities == nil { - return nil, false - } - return o.Affinities, true -} - -// HasAffinities returns a boolean if a field has been set. -func (o *Predictions) HasAffinities() bool { - if o != nil && o.Affinities != nil { - return true - } - - return false -} - -// SetAffinities gets a reference to the given PredictionsAffinities and assigns it to the Affinities field. -func (o *Predictions) SetAffinities(v PredictionsAffinities) { - o.Affinities = &v -} - -func (o Predictions) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if o.FunnelStage != nil { - toSerialize["funnel_stage"] = o.FunnelStage - } - if o.OrderValue != nil { - toSerialize["order_value"] = o.OrderValue - } - if o.Affinities != nil { - toSerialize["affinities"] = o.Affinities - } - return json.Marshal(toSerialize) -} - -func (o Predictions) String() string { - out := "" - out += fmt.Sprintf(" funnel_stage=%v\n", o.FunnelStage) - out += fmt.Sprintf(" order_value=%v\n", o.OrderValue) - out += fmt.Sprintf(" affinities=%v\n", o.Affinities) - return fmt.Sprintf("Predictions {\n%s}", out) -} - -type NullablePredictions struct { - value *Predictions - isSet bool -} - -func (v NullablePredictions) Get() *Predictions { - return v.value -} - -func (v *NullablePredictions) Set(val *Predictions) { - v.value = val - v.isSet = true -} - -func (v NullablePredictions) IsSet() bool { - return v.isSet -} - -func (v *NullablePredictions) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePredictions(val *Predictions) *NullablePredictions { - return &NullablePredictions{value: val, isSet: true} -} - -func (v NullablePredictions) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePredictions) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_predictions_affinities.go b/clients/algoliasearch-client-go/algolia/predict/model_predictions_affinities.go deleted file mode 100644 index 1f39612ca5..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_predictions_affinities.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// PredictionsAffinities - struct for PredictionsAffinities -type PredictionsAffinities struct { - ModelError *ModelError - PredictionsAffinitiesSuccess *PredictionsAffinitiesSuccess -} - -// ModelErrorAsPredictionsAffinities is a convenience function that returns ModelError wrapped in PredictionsAffinities -func ModelErrorAsPredictionsAffinities(v *ModelError) PredictionsAffinities { - return PredictionsAffinities{ - ModelError: v, - } -} - -// PredictionsAffinitiesSuccessAsPredictionsAffinities is a convenience function that returns PredictionsAffinitiesSuccess wrapped in PredictionsAffinities -func PredictionsAffinitiesSuccessAsPredictionsAffinities(v *PredictionsAffinitiesSuccess) PredictionsAffinities { - return PredictionsAffinities{ - PredictionsAffinitiesSuccess: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *PredictionsAffinities) UnmarshalJSON(data []byte) error { - var err error - // try to unmarshal data into ModelError - err = newStrictDecoder(data).Decode(&dst.ModelError) - if err == nil && validateStruct(dst.ModelError) == nil { - jsonModelError, _ := json.Marshal(dst.ModelError) - if string(jsonModelError) == "{}" { // empty struct - dst.ModelError = nil - } else { - return nil - } - } else { - dst.ModelError = nil - } - - // try to unmarshal data into PredictionsAffinitiesSuccess - err = newStrictDecoder(data).Decode(&dst.PredictionsAffinitiesSuccess) - if err == nil && validateStruct(dst.PredictionsAffinitiesSuccess) == nil { - jsonPredictionsAffinitiesSuccess, _ := json.Marshal(dst.PredictionsAffinitiesSuccess) - if string(jsonPredictionsAffinitiesSuccess) == "{}" { // empty struct - dst.PredictionsAffinitiesSuccess = nil - } else { - return nil - } - } else { - dst.PredictionsAffinitiesSuccess = nil - } - - return fmt.Errorf("Data failed to match schemas in oneOf(PredictionsAffinities)") -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src PredictionsAffinities) MarshalJSON() ([]byte, error) { - if src.ModelError != nil { - return json.Marshal(&src.ModelError) - } - - if src.PredictionsAffinitiesSuccess != nil { - return json.Marshal(&src.PredictionsAffinitiesSuccess) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *PredictionsAffinities) GetActualInstance() any { - if obj == nil { - return nil - } - if obj.ModelError != nil { - return obj.ModelError - } - - if obj.PredictionsAffinitiesSuccess != nil { - return obj.PredictionsAffinitiesSuccess - } - - // all schemas are nil - return nil -} - -type NullablePredictionsAffinities struct { - value *PredictionsAffinities - isSet bool -} - -func (v NullablePredictionsAffinities) Get() *PredictionsAffinities { - return v.value -} - -func (v *NullablePredictionsAffinities) Set(val *PredictionsAffinities) { - v.value = val - v.isSet = true -} - -func (v NullablePredictionsAffinities) IsSet() bool { - return v.isSet -} - -func (v *NullablePredictionsAffinities) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePredictionsAffinities(val *PredictionsAffinities) *NullablePredictionsAffinities { - return &NullablePredictionsAffinities{value: val, isSet: true} -} - -func (v NullablePredictionsAffinities) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePredictionsAffinities) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_predictions_affinities_success.go b/clients/algoliasearch-client-go/algolia/predict/model_predictions_affinities_success.go deleted file mode 100644 index 48c672ced1..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_predictions_affinities_success.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// PredictionsAffinitiesSuccess Prediction for the **affinities** model. -type PredictionsAffinitiesSuccess struct { - Value []Affinity `json:"value" validate:"required"` - LastUpdatedAt string `json:"lastUpdatedAt" validate:"required"` -} - -// NewPredictionsAffinitiesSuccess instantiates a new PredictionsAffinitiesSuccess object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewPredictionsAffinitiesSuccess(value []Affinity, lastUpdatedAt string) *PredictionsAffinitiesSuccess { - this := &PredictionsAffinitiesSuccess{} - this.Value = value - this.LastUpdatedAt = lastUpdatedAt - return this -} - -// NewPredictionsAffinitiesSuccessWithDefaults instantiates a new PredictionsAffinitiesSuccess object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewPredictionsAffinitiesSuccessWithDefaults() *PredictionsAffinitiesSuccess { - this := &PredictionsAffinitiesSuccess{} - return this -} - -// GetValue returns the Value field value -func (o *PredictionsAffinitiesSuccess) GetValue() []Affinity { - if o == nil { - var ret []Affinity - return ret - } - - return o.Value -} - -// GetValueOk returns a tuple with the Value field value -// and a boolean to check if the value has been set. -func (o *PredictionsAffinitiesSuccess) GetValueOk() ([]Affinity, bool) { - if o == nil { - return nil, false - } - return o.Value, true -} - -// SetValue sets field value -func (o *PredictionsAffinitiesSuccess) SetValue(v []Affinity) { - o.Value = v -} - -// GetLastUpdatedAt returns the LastUpdatedAt field value -func (o *PredictionsAffinitiesSuccess) GetLastUpdatedAt() string { - if o == nil { - var ret string - return ret - } - - return o.LastUpdatedAt -} - -// GetLastUpdatedAtOk returns a tuple with the LastUpdatedAt field value -// and a boolean to check if the value has been set. -func (o *PredictionsAffinitiesSuccess) GetLastUpdatedAtOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.LastUpdatedAt, true -} - -// SetLastUpdatedAt sets field value -func (o *PredictionsAffinitiesSuccess) SetLastUpdatedAt(v string) { - o.LastUpdatedAt = v -} - -func (o PredictionsAffinitiesSuccess) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["value"] = o.Value - } - if true { - toSerialize["lastUpdatedAt"] = o.LastUpdatedAt - } - return json.Marshal(toSerialize) -} - -func (o PredictionsAffinitiesSuccess) String() string { - out := "" - out += fmt.Sprintf(" value=%v\n", o.Value) - out += fmt.Sprintf(" lastUpdatedAt=%v\n", o.LastUpdatedAt) - return fmt.Sprintf("PredictionsAffinitiesSuccess {\n%s}", out) -} - -type NullablePredictionsAffinitiesSuccess struct { - value *PredictionsAffinitiesSuccess - isSet bool -} - -func (v NullablePredictionsAffinitiesSuccess) Get() *PredictionsAffinitiesSuccess { - return v.value -} - -func (v *NullablePredictionsAffinitiesSuccess) Set(val *PredictionsAffinitiesSuccess) { - v.value = val - v.isSet = true -} - -func (v NullablePredictionsAffinitiesSuccess) IsSet() bool { - return v.isSet -} - -func (v *NullablePredictionsAffinitiesSuccess) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePredictionsAffinitiesSuccess(val *PredictionsAffinitiesSuccess) *NullablePredictionsAffinitiesSuccess { - return &NullablePredictionsAffinitiesSuccess{value: val, isSet: true} -} - -func (v NullablePredictionsAffinitiesSuccess) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePredictionsAffinitiesSuccess) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_predictions_funnel_stage.go b/clients/algoliasearch-client-go/algolia/predict/model_predictions_funnel_stage.go deleted file mode 100644 index 281500d169..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_predictions_funnel_stage.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// PredictionsFunnelStage - struct for PredictionsFunnelStage -type PredictionsFunnelStage struct { - ModelError *ModelError - PredictionsFunnelStageSuccess *PredictionsFunnelStageSuccess -} - -// ModelErrorAsPredictionsFunnelStage is a convenience function that returns ModelError wrapped in PredictionsFunnelStage -func ModelErrorAsPredictionsFunnelStage(v *ModelError) PredictionsFunnelStage { - return PredictionsFunnelStage{ - ModelError: v, - } -} - -// PredictionsFunnelStageSuccessAsPredictionsFunnelStage is a convenience function that returns PredictionsFunnelStageSuccess wrapped in PredictionsFunnelStage -func PredictionsFunnelStageSuccessAsPredictionsFunnelStage(v *PredictionsFunnelStageSuccess) PredictionsFunnelStage { - return PredictionsFunnelStage{ - PredictionsFunnelStageSuccess: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *PredictionsFunnelStage) UnmarshalJSON(data []byte) error { - var err error - // try to unmarshal data into ModelError - err = newStrictDecoder(data).Decode(&dst.ModelError) - if err == nil && validateStruct(dst.ModelError) == nil { - jsonModelError, _ := json.Marshal(dst.ModelError) - if string(jsonModelError) == "{}" { // empty struct - dst.ModelError = nil - } else { - return nil - } - } else { - dst.ModelError = nil - } - - // try to unmarshal data into PredictionsFunnelStageSuccess - err = newStrictDecoder(data).Decode(&dst.PredictionsFunnelStageSuccess) - if err == nil && validateStruct(dst.PredictionsFunnelStageSuccess) == nil { - jsonPredictionsFunnelStageSuccess, _ := json.Marshal(dst.PredictionsFunnelStageSuccess) - if string(jsonPredictionsFunnelStageSuccess) == "{}" { // empty struct - dst.PredictionsFunnelStageSuccess = nil - } else { - return nil - } - } else { - dst.PredictionsFunnelStageSuccess = nil - } - - return fmt.Errorf("Data failed to match schemas in oneOf(PredictionsFunnelStage)") -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src PredictionsFunnelStage) MarshalJSON() ([]byte, error) { - if src.ModelError != nil { - return json.Marshal(&src.ModelError) - } - - if src.PredictionsFunnelStageSuccess != nil { - return json.Marshal(&src.PredictionsFunnelStageSuccess) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *PredictionsFunnelStage) GetActualInstance() any { - if obj == nil { - return nil - } - if obj.ModelError != nil { - return obj.ModelError - } - - if obj.PredictionsFunnelStageSuccess != nil { - return obj.PredictionsFunnelStageSuccess - } - - // all schemas are nil - return nil -} - -type NullablePredictionsFunnelStage struct { - value *PredictionsFunnelStage - isSet bool -} - -func (v NullablePredictionsFunnelStage) Get() *PredictionsFunnelStage { - return v.value -} - -func (v *NullablePredictionsFunnelStage) Set(val *PredictionsFunnelStage) { - v.value = val - v.isSet = true -} - -func (v NullablePredictionsFunnelStage) IsSet() bool { - return v.isSet -} - -func (v *NullablePredictionsFunnelStage) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePredictionsFunnelStage(val *PredictionsFunnelStage) *NullablePredictionsFunnelStage { - return &NullablePredictionsFunnelStage{value: val, isSet: true} -} - -func (v NullablePredictionsFunnelStage) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePredictionsFunnelStage) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_predictions_funnel_stage_success.go b/clients/algoliasearch-client-go/algolia/predict/model_predictions_funnel_stage_success.go deleted file mode 100644 index 90e8767a55..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_predictions_funnel_stage_success.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// PredictionsFunnelStageSuccess Prediction for the **funnel_stage** model. -type PredictionsFunnelStageSuccess struct { - Value []FunnelStage `json:"value" validate:"required"` - LastUpdatedAt string `json:"lastUpdatedAt" validate:"required"` -} - -// NewPredictionsFunnelStageSuccess instantiates a new PredictionsFunnelStageSuccess object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewPredictionsFunnelStageSuccess(value []FunnelStage, lastUpdatedAt string) *PredictionsFunnelStageSuccess { - this := &PredictionsFunnelStageSuccess{} - this.Value = value - this.LastUpdatedAt = lastUpdatedAt - return this -} - -// NewPredictionsFunnelStageSuccessWithDefaults instantiates a new PredictionsFunnelStageSuccess object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewPredictionsFunnelStageSuccessWithDefaults() *PredictionsFunnelStageSuccess { - this := &PredictionsFunnelStageSuccess{} - return this -} - -// GetValue returns the Value field value -func (o *PredictionsFunnelStageSuccess) GetValue() []FunnelStage { - if o == nil { - var ret []FunnelStage - return ret - } - - return o.Value -} - -// GetValueOk returns a tuple with the Value field value -// and a boolean to check if the value has been set. -func (o *PredictionsFunnelStageSuccess) GetValueOk() ([]FunnelStage, bool) { - if o == nil { - return nil, false - } - return o.Value, true -} - -// SetValue sets field value -func (o *PredictionsFunnelStageSuccess) SetValue(v []FunnelStage) { - o.Value = v -} - -// GetLastUpdatedAt returns the LastUpdatedAt field value -func (o *PredictionsFunnelStageSuccess) GetLastUpdatedAt() string { - if o == nil { - var ret string - return ret - } - - return o.LastUpdatedAt -} - -// GetLastUpdatedAtOk returns a tuple with the LastUpdatedAt field value -// and a boolean to check if the value has been set. -func (o *PredictionsFunnelStageSuccess) GetLastUpdatedAtOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.LastUpdatedAt, true -} - -// SetLastUpdatedAt sets field value -func (o *PredictionsFunnelStageSuccess) SetLastUpdatedAt(v string) { - o.LastUpdatedAt = v -} - -func (o PredictionsFunnelStageSuccess) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["value"] = o.Value - } - if true { - toSerialize["lastUpdatedAt"] = o.LastUpdatedAt - } - return json.Marshal(toSerialize) -} - -func (o PredictionsFunnelStageSuccess) String() string { - out := "" - out += fmt.Sprintf(" value=%v\n", o.Value) - out += fmt.Sprintf(" lastUpdatedAt=%v\n", o.LastUpdatedAt) - return fmt.Sprintf("PredictionsFunnelStageSuccess {\n%s}", out) -} - -type NullablePredictionsFunnelStageSuccess struct { - value *PredictionsFunnelStageSuccess - isSet bool -} - -func (v NullablePredictionsFunnelStageSuccess) Get() *PredictionsFunnelStageSuccess { - return v.value -} - -func (v *NullablePredictionsFunnelStageSuccess) Set(val *PredictionsFunnelStageSuccess) { - v.value = val - v.isSet = true -} - -func (v NullablePredictionsFunnelStageSuccess) IsSet() bool { - return v.isSet -} - -func (v *NullablePredictionsFunnelStageSuccess) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePredictionsFunnelStageSuccess(val *PredictionsFunnelStageSuccess) *NullablePredictionsFunnelStageSuccess { - return &NullablePredictionsFunnelStageSuccess{value: val, isSet: true} -} - -func (v NullablePredictionsFunnelStageSuccess) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePredictionsFunnelStageSuccess) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_predictions_order_value.go b/clients/algoliasearch-client-go/algolia/predict/model_predictions_order_value.go deleted file mode 100644 index 51b07d264d..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_predictions_order_value.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// PredictionsOrderValue - struct for PredictionsOrderValue -type PredictionsOrderValue struct { - ModelError *ModelError - PredictionsOrderValueSuccess *PredictionsOrderValueSuccess -} - -// ModelErrorAsPredictionsOrderValue is a convenience function that returns ModelError wrapped in PredictionsOrderValue -func ModelErrorAsPredictionsOrderValue(v *ModelError) PredictionsOrderValue { - return PredictionsOrderValue{ - ModelError: v, - } -} - -// PredictionsOrderValueSuccessAsPredictionsOrderValue is a convenience function that returns PredictionsOrderValueSuccess wrapped in PredictionsOrderValue -func PredictionsOrderValueSuccessAsPredictionsOrderValue(v *PredictionsOrderValueSuccess) PredictionsOrderValue { - return PredictionsOrderValue{ - PredictionsOrderValueSuccess: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *PredictionsOrderValue) UnmarshalJSON(data []byte) error { - var err error - // try to unmarshal data into ModelError - err = newStrictDecoder(data).Decode(&dst.ModelError) - if err == nil && validateStruct(dst.ModelError) == nil { - jsonModelError, _ := json.Marshal(dst.ModelError) - if string(jsonModelError) == "{}" { // empty struct - dst.ModelError = nil - } else { - return nil - } - } else { - dst.ModelError = nil - } - - // try to unmarshal data into PredictionsOrderValueSuccess - err = newStrictDecoder(data).Decode(&dst.PredictionsOrderValueSuccess) - if err == nil && validateStruct(dst.PredictionsOrderValueSuccess) == nil { - jsonPredictionsOrderValueSuccess, _ := json.Marshal(dst.PredictionsOrderValueSuccess) - if string(jsonPredictionsOrderValueSuccess) == "{}" { // empty struct - dst.PredictionsOrderValueSuccess = nil - } else { - return nil - } - } else { - dst.PredictionsOrderValueSuccess = nil - } - - return fmt.Errorf("Data failed to match schemas in oneOf(PredictionsOrderValue)") -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src PredictionsOrderValue) MarshalJSON() ([]byte, error) { - if src.ModelError != nil { - return json.Marshal(&src.ModelError) - } - - if src.PredictionsOrderValueSuccess != nil { - return json.Marshal(&src.PredictionsOrderValueSuccess) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *PredictionsOrderValue) GetActualInstance() any { - if obj == nil { - return nil - } - if obj.ModelError != nil { - return obj.ModelError - } - - if obj.PredictionsOrderValueSuccess != nil { - return obj.PredictionsOrderValueSuccess - } - - // all schemas are nil - return nil -} - -type NullablePredictionsOrderValue struct { - value *PredictionsOrderValue - isSet bool -} - -func (v NullablePredictionsOrderValue) Get() *PredictionsOrderValue { - return v.value -} - -func (v *NullablePredictionsOrderValue) Set(val *PredictionsOrderValue) { - v.value = val - v.isSet = true -} - -func (v NullablePredictionsOrderValue) IsSet() bool { - return v.isSet -} - -func (v *NullablePredictionsOrderValue) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePredictionsOrderValue(val *PredictionsOrderValue) *NullablePredictionsOrderValue { - return &NullablePredictionsOrderValue{value: val, isSet: true} -} - -func (v NullablePredictionsOrderValue) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePredictionsOrderValue) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_predictions_order_value_success.go b/clients/algoliasearch-client-go/algolia/predict/model_predictions_order_value_success.go deleted file mode 100644 index 65f275fe78..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_predictions_order_value_success.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// PredictionsOrderValueSuccess Prediction for the **order_value** model. -type PredictionsOrderValueSuccess struct { - Value float64 `json:"value" validate:"required"` - LastUpdatedAt string `json:"lastUpdatedAt" validate:"required"` -} - -// NewPredictionsOrderValueSuccess instantiates a new PredictionsOrderValueSuccess object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewPredictionsOrderValueSuccess(value float64, lastUpdatedAt string) *PredictionsOrderValueSuccess { - this := &PredictionsOrderValueSuccess{} - this.Value = value - this.LastUpdatedAt = lastUpdatedAt - return this -} - -// NewPredictionsOrderValueSuccessWithDefaults instantiates a new PredictionsOrderValueSuccess object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewPredictionsOrderValueSuccessWithDefaults() *PredictionsOrderValueSuccess { - this := &PredictionsOrderValueSuccess{} - return this -} - -// GetValue returns the Value field value -func (o *PredictionsOrderValueSuccess) GetValue() float64 { - if o == nil { - var ret float64 - return ret - } - - return o.Value -} - -// GetValueOk returns a tuple with the Value field value -// and a boolean to check if the value has been set. -func (o *PredictionsOrderValueSuccess) GetValueOk() (*float64, bool) { - if o == nil { - return nil, false - } - return &o.Value, true -} - -// SetValue sets field value -func (o *PredictionsOrderValueSuccess) SetValue(v float64) { - o.Value = v -} - -// GetLastUpdatedAt returns the LastUpdatedAt field value -func (o *PredictionsOrderValueSuccess) GetLastUpdatedAt() string { - if o == nil { - var ret string - return ret - } - - return o.LastUpdatedAt -} - -// GetLastUpdatedAtOk returns a tuple with the LastUpdatedAt field value -// and a boolean to check if the value has been set. -func (o *PredictionsOrderValueSuccess) GetLastUpdatedAtOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.LastUpdatedAt, true -} - -// SetLastUpdatedAt sets field value -func (o *PredictionsOrderValueSuccess) SetLastUpdatedAt(v string) { - o.LastUpdatedAt = v -} - -func (o PredictionsOrderValueSuccess) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["value"] = o.Value - } - if true { - toSerialize["lastUpdatedAt"] = o.LastUpdatedAt - } - return json.Marshal(toSerialize) -} - -func (o PredictionsOrderValueSuccess) String() string { - out := "" - out += fmt.Sprintf(" value=%v\n", o.Value) - out += fmt.Sprintf(" lastUpdatedAt=%v\n", o.LastUpdatedAt) - return fmt.Sprintf("PredictionsOrderValueSuccess {\n%s}", out) -} - -type NullablePredictionsOrderValueSuccess struct { - value *PredictionsOrderValueSuccess - isSet bool -} - -func (v NullablePredictionsOrderValueSuccess) Get() *PredictionsOrderValueSuccess { - return v.value -} - -func (v *NullablePredictionsOrderValueSuccess) Set(val *PredictionsOrderValueSuccess) { - v.value = val - v.isSet = true -} - -func (v NullablePredictionsOrderValueSuccess) IsSet() bool { - return v.isSet -} - -func (v *NullablePredictionsOrderValueSuccess) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePredictionsOrderValueSuccess(val *PredictionsOrderValueSuccess) *NullablePredictionsOrderValueSuccess { - return &NullablePredictionsOrderValueSuccess{value: val, isSet: true} -} - -func (v NullablePredictionsOrderValueSuccess) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePredictionsOrderValueSuccess) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_previous_page_token_param.go b/clients/algoliasearch-client-go/algolia/predict/model_previous_page_token_param.go deleted file mode 100644 index 049efacf0c..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_previous_page_token_param.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// PreviousPageTokenParam struct for PreviousPageTokenParam -type PreviousPageTokenParam struct { - // 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. - PreviousPageToken *string `json:"previousPageToken,omitempty"` -} - -type PreviousPageTokenParamOption func(f *PreviousPageTokenParam) - -func WithPreviousPageTokenParamPreviousPageToken(val string) PreviousPageTokenParamOption { - return func(f *PreviousPageTokenParam) { - f.PreviousPageToken = &val - } -} - -// NewPreviousPageTokenParam instantiates a new PreviousPageTokenParam object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewPreviousPageTokenParam(opts ...PreviousPageTokenParamOption) *PreviousPageTokenParam { - this := &PreviousPageTokenParam{} - for _, opt := range opts { - opt(this) - } - return this -} - -// NewPreviousPageTokenParamWithDefaults instantiates a new PreviousPageTokenParam object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewPreviousPageTokenParamWithDefaults() *PreviousPageTokenParam { - this := &PreviousPageTokenParam{} - return this -} - -// GetPreviousPageToken returns the PreviousPageToken field value if set, zero value otherwise. -func (o *PreviousPageTokenParam) GetPreviousPageToken() string { - if o == nil || o.PreviousPageToken == nil { - var ret string - return ret - } - return *o.PreviousPageToken -} - -// GetPreviousPageTokenOk returns a tuple with the PreviousPageToken field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PreviousPageTokenParam) GetPreviousPageTokenOk() (*string, bool) { - if o == nil || o.PreviousPageToken == nil { - return nil, false - } - return o.PreviousPageToken, true -} - -// HasPreviousPageToken returns a boolean if a field has been set. -func (o *PreviousPageTokenParam) HasPreviousPageToken() bool { - if o != nil && o.PreviousPageToken != nil { - return true - } - - return false -} - -// SetPreviousPageToken gets a reference to the given string and assigns it to the PreviousPageToken field. -func (o *PreviousPageTokenParam) SetPreviousPageToken(v string) { - o.PreviousPageToken = &v -} - -func (o PreviousPageTokenParam) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if o.PreviousPageToken != nil { - toSerialize["previousPageToken"] = o.PreviousPageToken - } - return json.Marshal(toSerialize) -} - -func (o PreviousPageTokenParam) String() string { - out := "" - out += fmt.Sprintf(" previousPageToken=%v\n", o.PreviousPageToken) - return fmt.Sprintf("PreviousPageTokenParam {\n%s}", out) -} - -type NullablePreviousPageTokenParam struct { - value *PreviousPageTokenParam - isSet bool -} - -func (v NullablePreviousPageTokenParam) Get() *PreviousPageTokenParam { - return v.value -} - -func (v *NullablePreviousPageTokenParam) Set(val *PreviousPageTokenParam) { - v.value = val - v.isSet = true -} - -func (v NullablePreviousPageTokenParam) IsSet() bool { - return v.isSet -} - -func (v *NullablePreviousPageTokenParam) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePreviousPageTokenParam(val *PreviousPageTokenParam) *NullablePreviousPageTokenParam { - return &NullablePreviousPageTokenParam{value: val, isSet: true} -} - -func (v NullablePreviousPageTokenParam) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePreviousPageTokenParam) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_properties.go b/clients/algoliasearch-client-go/algolia/predict/model_properties.go deleted file mode 100644 index 219b2e9b35..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_properties.go +++ /dev/null @@ -1,211 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// Properties Properties for the user profile. -type Properties struct { - // Raw user properties (key-value pairs). - Raw map[string]interface{} `json:"raw,omitempty"` - // Computed user properties (key-value pairs). - Computed map[string]interface{} `json:"computed,omitempty"` - // Custom user properties (key-value pairs). - Custom map[string]interface{} `json:"custom,omitempty"` -} - -type PropertiesOption func(f *Properties) - -func WithPropertiesRaw(val map[string]interface{}) PropertiesOption { - return func(f *Properties) { - f.Raw = val - } -} - -func WithPropertiesComputed(val map[string]interface{}) PropertiesOption { - return func(f *Properties) { - f.Computed = val - } -} - -func WithPropertiesCustom(val map[string]interface{}) PropertiesOption { - return func(f *Properties) { - f.Custom = val - } -} - -// NewProperties instantiates a new Properties object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewProperties(opts ...PropertiesOption) *Properties { - this := &Properties{} - for _, opt := range opts { - opt(this) - } - return this -} - -// NewPropertiesWithDefaults instantiates a new Properties object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewPropertiesWithDefaults() *Properties { - this := &Properties{} - return this -} - -// GetRaw returns the Raw field value if set, zero value otherwise. -func (o *Properties) GetRaw() map[string]interface{} { - if o == nil || o.Raw == nil { - var ret map[string]interface{} - return ret - } - return o.Raw -} - -// GetRawOk returns a tuple with the Raw field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Properties) GetRawOk() (map[string]interface{}, bool) { - if o == nil || o.Raw == nil { - return nil, false - } - return o.Raw, true -} - -// HasRaw returns a boolean if a field has been set. -func (o *Properties) HasRaw() bool { - if o != nil && o.Raw != nil { - return true - } - - return false -} - -// SetRaw gets a reference to the given map[string]interface{} and assigns it to the Raw field. -func (o *Properties) SetRaw(v map[string]interface{}) { - o.Raw = v -} - -// GetComputed returns the Computed field value if set, zero value otherwise. -func (o *Properties) GetComputed() map[string]interface{} { - if o == nil || o.Computed == nil { - var ret map[string]interface{} - return ret - } - return o.Computed -} - -// GetComputedOk returns a tuple with the Computed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Properties) GetComputedOk() (map[string]interface{}, bool) { - if o == nil || o.Computed == nil { - return nil, false - } - return o.Computed, true -} - -// HasComputed returns a boolean if a field has been set. -func (o *Properties) HasComputed() bool { - if o != nil && o.Computed != nil { - return true - } - - return false -} - -// SetComputed gets a reference to the given map[string]interface{} and assigns it to the Computed field. -func (o *Properties) SetComputed(v map[string]interface{}) { - o.Computed = v -} - -// GetCustom returns the Custom field value if set, zero value otherwise. -func (o *Properties) GetCustom() map[string]interface{} { - if o == nil || o.Custom == nil { - var ret map[string]interface{} - return ret - } - return o.Custom -} - -// GetCustomOk returns a tuple with the Custom field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Properties) GetCustomOk() (map[string]interface{}, bool) { - if o == nil || o.Custom == nil { - return nil, false - } - return o.Custom, true -} - -// HasCustom returns a boolean if a field has been set. -func (o *Properties) HasCustom() bool { - if o != nil && o.Custom != nil { - return true - } - - return false -} - -// SetCustom gets a reference to the given map[string]interface{} and assigns it to the Custom field. -func (o *Properties) SetCustom(v map[string]interface{}) { - o.Custom = v -} - -func (o Properties) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if o.Raw != nil { - toSerialize["raw"] = o.Raw - } - if o.Computed != nil { - toSerialize["computed"] = o.Computed - } - if o.Custom != nil { - toSerialize["custom"] = o.Custom - } - return json.Marshal(toSerialize) -} - -func (o Properties) String() string { - out := "" - out += fmt.Sprintf(" raw=%v\n", o.Raw) - out += fmt.Sprintf(" computed=%v\n", o.Computed) - out += fmt.Sprintf(" custom=%v\n", o.Custom) - return fmt.Sprintf("Properties {\n%s}", out) -} - -type NullableProperties struct { - value *Properties - isSet bool -} - -func (v NullableProperties) Get() *Properties { - return v.value -} - -func (v *NullableProperties) Set(val *Properties) { - v.value = val - v.isSet = true -} - -func (v NullableProperties) IsSet() bool { - return v.isSet -} - -func (v *NullableProperties) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableProperties(val *Properties) *NullableProperties { - return &NullableProperties{value: val, isSet: true} -} - -func (v NullableProperties) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableProperties) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment.go b/clients/algoliasearch-client-go/algolia/predict/model_segment.go deleted file mode 100644 index c7cd2edccd..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment.go +++ /dev/null @@ -1,336 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// Segment struct for Segment -type Segment struct { - // The ID of the segment. - SegmentID string `json:"segmentID" validate:"required"` - // The name of the segment. - Name string `json:"name" validate:"required"` - Conditions SegmentParentConditions `json:"conditions" validate:"required"` - // The approximate number of users that matched the segment conditions when it was created, last updated, or when model inference last ran. - Size float32 `json:"size" validate:"required"` - SegmentStatus SegmentStatus `json:"segmentStatus" validate:"required"` - Type SegmentType `json:"type" validate:"required"` - // The date and time at which the segment was last updated (RFC3339). - LastUpdatedAt string `json:"lastUpdatedAt" validate:"required"` - ErrorMessage *string `json:"errorMessage,omitempty"` -} - -type SegmentOption func(f *Segment) - -func WithSegmentErrorMessage(val string) SegmentOption { - return func(f *Segment) { - f.ErrorMessage = &val - } -} - -// NewSegment instantiates a new Segment object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSegment(segmentID string, name string, conditions SegmentParentConditions, size float32, segmentStatus SegmentStatus, type_ SegmentType, lastUpdatedAt string, opts ...SegmentOption) *Segment { - this := &Segment{} - this.SegmentID = segmentID - this.Name = name - this.Conditions = conditions - this.Size = size - this.SegmentStatus = segmentStatus - this.Type = type_ - this.LastUpdatedAt = lastUpdatedAt - for _, opt := range opts { - opt(this) - } - return this -} - -// NewSegmentWithDefaults instantiates a new Segment object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSegmentWithDefaults() *Segment { - this := &Segment{} - return this -} - -// GetSegmentID returns the SegmentID field value -func (o *Segment) GetSegmentID() string { - if o == nil { - var ret string - return ret - } - - return o.SegmentID -} - -// GetSegmentIDOk returns a tuple with the SegmentID field value -// and a boolean to check if the value has been set. -func (o *Segment) GetSegmentIDOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.SegmentID, true -} - -// SetSegmentID sets field value -func (o *Segment) SetSegmentID(v string) { - o.SegmentID = v -} - -// GetName returns the Name field value -func (o *Segment) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *Segment) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *Segment) SetName(v string) { - o.Name = v -} - -// GetConditions returns the Conditions field value -func (o *Segment) GetConditions() SegmentParentConditions { - if o == nil { - var ret SegmentParentConditions - return ret - } - - return o.Conditions -} - -// GetConditionsOk returns a tuple with the Conditions field value -// and a boolean to check if the value has been set. -func (o *Segment) GetConditionsOk() (*SegmentParentConditions, bool) { - if o == nil { - return nil, false - } - return &o.Conditions, true -} - -// SetConditions sets field value -func (o *Segment) SetConditions(v SegmentParentConditions) { - o.Conditions = v -} - -// GetSize returns the Size field value -func (o *Segment) GetSize() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.Size -} - -// GetSizeOk returns a tuple with the Size field value -// and a boolean to check if the value has been set. -func (o *Segment) GetSizeOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.Size, true -} - -// SetSize sets field value -func (o *Segment) SetSize(v float32) { - o.Size = v -} - -// GetSegmentStatus returns the SegmentStatus field value -func (o *Segment) GetSegmentStatus() SegmentStatus { - if o == nil { - var ret SegmentStatus - return ret - } - - return o.SegmentStatus -} - -// GetSegmentStatusOk returns a tuple with the SegmentStatus field value -// and a boolean to check if the value has been set. -func (o *Segment) GetSegmentStatusOk() (*SegmentStatus, bool) { - if o == nil { - return nil, false - } - return &o.SegmentStatus, true -} - -// SetSegmentStatus sets field value -func (o *Segment) SetSegmentStatus(v SegmentStatus) { - o.SegmentStatus = v -} - -// GetType returns the Type field value -func (o *Segment) GetType() SegmentType { - if o == nil { - var ret SegmentType - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *Segment) GetTypeOk() (*SegmentType, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *Segment) SetType(v SegmentType) { - o.Type = v -} - -// GetLastUpdatedAt returns the LastUpdatedAt field value -func (o *Segment) GetLastUpdatedAt() string { - if o == nil { - var ret string - return ret - } - - return o.LastUpdatedAt -} - -// GetLastUpdatedAtOk returns a tuple with the LastUpdatedAt field value -// and a boolean to check if the value has been set. -func (o *Segment) GetLastUpdatedAtOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.LastUpdatedAt, true -} - -// SetLastUpdatedAt sets field value -func (o *Segment) SetLastUpdatedAt(v string) { - o.LastUpdatedAt = v -} - -// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. -func (o *Segment) GetErrorMessage() string { - if o == nil || o.ErrorMessage == nil { - var ret string - return ret - } - return *o.ErrorMessage -} - -// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Segment) GetErrorMessageOk() (*string, bool) { - if o == nil || o.ErrorMessage == nil { - return nil, false - } - return o.ErrorMessage, true -} - -// HasErrorMessage returns a boolean if a field has been set. -func (o *Segment) HasErrorMessage() bool { - if o != nil && o.ErrorMessage != nil { - return true - } - - return false -} - -// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. -func (o *Segment) SetErrorMessage(v string) { - o.ErrorMessage = &v -} - -func (o Segment) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["segmentID"] = o.SegmentID - } - if true { - toSerialize["name"] = o.Name - } - if true { - toSerialize["conditions"] = o.Conditions - } - if true { - toSerialize["size"] = o.Size - } - if true { - toSerialize["segmentStatus"] = o.SegmentStatus - } - if true { - toSerialize["type"] = o.Type - } - if true { - toSerialize["lastUpdatedAt"] = o.LastUpdatedAt - } - if o.ErrorMessage != nil { - toSerialize["errorMessage"] = o.ErrorMessage - } - return json.Marshal(toSerialize) -} - -func (o Segment) String() string { - out := "" - out += fmt.Sprintf(" segmentID=%v\n", o.SegmentID) - out += fmt.Sprintf(" name=%v\n", o.Name) - out += fmt.Sprintf(" conditions=%v\n", o.Conditions) - out += fmt.Sprintf(" size=%v\n", o.Size) - out += fmt.Sprintf(" segmentStatus=%v\n", o.SegmentStatus) - out += fmt.Sprintf(" type=%v\n", o.Type) - out += fmt.Sprintf(" lastUpdatedAt=%v\n", o.LastUpdatedAt) - out += fmt.Sprintf(" errorMessage=%v\n", o.ErrorMessage) - return fmt.Sprintf("Segment {\n%s}", out) -} - -type NullableSegment struct { - value *Segment - isSet bool -} - -func (v NullableSegment) Get() *Segment { - return v.value -} - -func (v *NullableSegment) Set(val *Segment) { - v.value = val - v.isSet = true -} - -func (v NullableSegment) IsSet() bool { - return v.isSet -} - -func (v *NullableSegment) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegment(val *Segment) *NullableSegment { - return &NullableSegment{value: val, isSet: true} -} - -func (v NullableSegment) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegment) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_affinity_filter.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_affinity_filter.go deleted file mode 100644 index c33457ec94..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_affinity_filter.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentAffinityFilter Filter for affinity model predictions. -type SegmentAffinityFilter struct { - Operator SegmentFilterOperatorNumerical `json:"operator" validate:"required"` - Value SegmentAffinityFilterValue `json:"value" validate:"required"` - Probability *SegmentFilterProbability `json:"probability,omitempty"` -} - -type SegmentAffinityFilterOption func(f *SegmentAffinityFilter) - -func WithSegmentAffinityFilterProbability(val SegmentFilterProbability) SegmentAffinityFilterOption { - return func(f *SegmentAffinityFilter) { - f.Probability = &val - } -} - -// NewSegmentAffinityFilter instantiates a new SegmentAffinityFilter object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSegmentAffinityFilter(operator SegmentFilterOperatorNumerical, value SegmentAffinityFilterValue, opts ...SegmentAffinityFilterOption) *SegmentAffinityFilter { - this := &SegmentAffinityFilter{} - this.Operator = operator - this.Value = value - for _, opt := range opts { - opt(this) - } - return this -} - -// NewSegmentAffinityFilterWithDefaults instantiates a new SegmentAffinityFilter object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSegmentAffinityFilterWithDefaults() *SegmentAffinityFilter { - this := &SegmentAffinityFilter{} - var operator SegmentFilterOperatorNumerical = SEGMENTFILTEROPERATORNUMERICAL_EQ - this.Operator = operator - return this -} - -// GetOperator returns the Operator field value -func (o *SegmentAffinityFilter) GetOperator() SegmentFilterOperatorNumerical { - if o == nil { - var ret SegmentFilterOperatorNumerical - return ret - } - - return o.Operator -} - -// GetOperatorOk returns a tuple with the Operator field value -// and a boolean to check if the value has been set. -func (o *SegmentAffinityFilter) GetOperatorOk() (*SegmentFilterOperatorNumerical, bool) { - if o == nil { - return nil, false - } - return &o.Operator, true -} - -// SetOperator sets field value -func (o *SegmentAffinityFilter) SetOperator(v SegmentFilterOperatorNumerical) { - o.Operator = v -} - -// GetValue returns the Value field value -func (o *SegmentAffinityFilter) GetValue() SegmentAffinityFilterValue { - if o == nil { - var ret SegmentAffinityFilterValue - return ret - } - - return o.Value -} - -// GetValueOk returns a tuple with the Value field value -// and a boolean to check if the value has been set. -func (o *SegmentAffinityFilter) GetValueOk() (*SegmentAffinityFilterValue, bool) { - if o == nil { - return nil, false - } - return &o.Value, true -} - -// SetValue sets field value -func (o *SegmentAffinityFilter) SetValue(v SegmentAffinityFilterValue) { - o.Value = v -} - -// GetProbability returns the Probability field value if set, zero value otherwise. -func (o *SegmentAffinityFilter) GetProbability() SegmentFilterProbability { - if o == nil || o.Probability == nil { - var ret SegmentFilterProbability - return ret - } - return *o.Probability -} - -// GetProbabilityOk returns a tuple with the Probability field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SegmentAffinityFilter) GetProbabilityOk() (*SegmentFilterProbability, bool) { - if o == nil || o.Probability == nil { - return nil, false - } - return o.Probability, true -} - -// HasProbability returns a boolean if a field has been set. -func (o *SegmentAffinityFilter) HasProbability() bool { - if o != nil && o.Probability != nil { - return true - } - - return false -} - -// SetProbability gets a reference to the given SegmentFilterProbability and assigns it to the Probability field. -func (o *SegmentAffinityFilter) SetProbability(v SegmentFilterProbability) { - o.Probability = &v -} - -func (o SegmentAffinityFilter) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["operator"] = o.Operator - } - if true { - toSerialize["value"] = o.Value - } - if o.Probability != nil { - toSerialize["probability"] = o.Probability - } - return json.Marshal(toSerialize) -} - -func (o SegmentAffinityFilter) String() string { - out := "" - out += fmt.Sprintf(" operator=%v\n", o.Operator) - out += fmt.Sprintf(" value=%v\n", o.Value) - out += fmt.Sprintf(" probability=%v\n", o.Probability) - return fmt.Sprintf("SegmentAffinityFilter {\n%s}", out) -} - -type NullableSegmentAffinityFilter struct { - value *SegmentAffinityFilter - isSet bool -} - -func (v NullableSegmentAffinityFilter) Get() *SegmentAffinityFilter { - return v.value -} - -func (v *NullableSegmentAffinityFilter) Set(val *SegmentAffinityFilter) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentAffinityFilter) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentAffinityFilter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentAffinityFilter(val *SegmentAffinityFilter) *NullableSegmentAffinityFilter { - return &NullableSegmentAffinityFilter{value: val, isSet: true} -} - -func (v NullableSegmentAffinityFilter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentAffinityFilter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_affinity_filter_value.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_affinity_filter_value.go deleted file mode 100644 index 37b4ab0884..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_affinity_filter_value.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentAffinityFilterValue - struct for SegmentAffinityFilterValue -type SegmentAffinityFilterValue struct { - ArrayOfString *[]string - Bool *bool - Float32 *float32 - String *string -} - -// []stringAsSegmentAffinityFilterValue is a convenience function that returns []string wrapped in SegmentAffinityFilterValue -func ArrayOfStringAsSegmentAffinityFilterValue(v *[]string) SegmentAffinityFilterValue { - return SegmentAffinityFilterValue{ - ArrayOfString: v, - } -} - -// boolAsSegmentAffinityFilterValue is a convenience function that returns bool wrapped in SegmentAffinityFilterValue -func BoolAsSegmentAffinityFilterValue(v *bool) SegmentAffinityFilterValue { - return SegmentAffinityFilterValue{ - Bool: v, - } -} - -// float32AsSegmentAffinityFilterValue is a convenience function that returns float32 wrapped in SegmentAffinityFilterValue -func Float32AsSegmentAffinityFilterValue(v *float32) SegmentAffinityFilterValue { - return SegmentAffinityFilterValue{ - Float32: v, - } -} - -// stringAsSegmentAffinityFilterValue is a convenience function that returns string wrapped in SegmentAffinityFilterValue -func StringAsSegmentAffinityFilterValue(v *string) SegmentAffinityFilterValue { - return SegmentAffinityFilterValue{ - String: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *SegmentAffinityFilterValue) UnmarshalJSON(data []byte) error { - var err error - // try to unmarshal data into ArrayOfString - err = newStrictDecoder(data).Decode(&dst.ArrayOfString) - if err == nil && validateStruct(dst.ArrayOfString) == nil { - jsonArrayOfString, _ := json.Marshal(dst.ArrayOfString) - if string(jsonArrayOfString) == "{}" { // empty struct - dst.ArrayOfString = nil - } else { - return nil - } - } else { - dst.ArrayOfString = nil - } - - // try to unmarshal data into Bool - err = newStrictDecoder(data).Decode(&dst.Bool) - if err == nil && validateStruct(dst.Bool) == nil { - jsonBool, _ := json.Marshal(dst.Bool) - if string(jsonBool) == "{}" { // empty struct - dst.Bool = nil - } else { - return nil - } - } else { - dst.Bool = nil - } - - // try to unmarshal data into Float32 - err = newStrictDecoder(data).Decode(&dst.Float32) - if err == nil && validateStruct(dst.Float32) == nil { - jsonFloat32, _ := json.Marshal(dst.Float32) - if string(jsonFloat32) == "{}" { // empty struct - dst.Float32 = nil - } else { - return nil - } - } else { - dst.Float32 = nil - } - - // try to unmarshal data into String - err = newStrictDecoder(data).Decode(&dst.String) - if err == nil && validateStruct(dst.String) == nil { - jsonString, _ := json.Marshal(dst.String) - if string(jsonString) == "{}" { // empty struct - dst.String = nil - } else { - return nil - } - } else { - dst.String = nil - } - - return fmt.Errorf("Data failed to match schemas in oneOf(SegmentAffinityFilterValue)") -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src SegmentAffinityFilterValue) MarshalJSON() ([]byte, error) { - if src.ArrayOfString != nil { - return json.Marshal(&src.ArrayOfString) - } - - if src.Bool != nil { - return json.Marshal(&src.Bool) - } - - if src.Float32 != nil { - return json.Marshal(&src.Float32) - } - - if src.String != nil { - return json.Marshal(&src.String) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *SegmentAffinityFilterValue) GetActualInstance() any { - if obj == nil { - return nil - } - if obj.ArrayOfString != nil { - return obj.ArrayOfString - } - - if obj.Bool != nil { - return obj.Bool - } - - if obj.Float32 != nil { - return obj.Float32 - } - - if obj.String != nil { - return obj.String - } - - // all schemas are nil - return nil -} - -type NullableSegmentAffinityFilterValue struct { - value *SegmentAffinityFilterValue - isSet bool -} - -func (v NullableSegmentAffinityFilterValue) Get() *SegmentAffinityFilterValue { - return v.value -} - -func (v *NullableSegmentAffinityFilterValue) Set(val *SegmentAffinityFilterValue) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentAffinityFilterValue) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentAffinityFilterValue) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentAffinityFilterValue(val *SegmentAffinityFilterValue) *NullableSegmentAffinityFilterValue { - return &NullableSegmentAffinityFilterValue{value: val, isSet: true} -} - -func (v NullableSegmentAffinityFilterValue) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentAffinityFilterValue) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_child_condition_operands.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_child_condition_operands.go deleted file mode 100644 index 3fb9e2f19b..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_child_condition_operands.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentChildConditionOperands - struct for SegmentChildConditionOperands -type SegmentChildConditionOperands struct { - SegmentOperandAffinity *SegmentOperandAffinity - SegmentOperandFunnelStage *SegmentOperandFunnelStage - SegmentOperandOrderValue *SegmentOperandOrderValue - SegmentOperandProperty *SegmentOperandProperty -} - -// SegmentOperandAffinityAsSegmentChildConditionOperands is a convenience function that returns SegmentOperandAffinity wrapped in SegmentChildConditionOperands -func SegmentOperandAffinityAsSegmentChildConditionOperands(v *SegmentOperandAffinity) SegmentChildConditionOperands { - return SegmentChildConditionOperands{ - SegmentOperandAffinity: v, - } -} - -// SegmentOperandFunnelStageAsSegmentChildConditionOperands is a convenience function that returns SegmentOperandFunnelStage wrapped in SegmentChildConditionOperands -func SegmentOperandFunnelStageAsSegmentChildConditionOperands(v *SegmentOperandFunnelStage) SegmentChildConditionOperands { - return SegmentChildConditionOperands{ - SegmentOperandFunnelStage: v, - } -} - -// SegmentOperandOrderValueAsSegmentChildConditionOperands is a convenience function that returns SegmentOperandOrderValue wrapped in SegmentChildConditionOperands -func SegmentOperandOrderValueAsSegmentChildConditionOperands(v *SegmentOperandOrderValue) SegmentChildConditionOperands { - return SegmentChildConditionOperands{ - SegmentOperandOrderValue: v, - } -} - -// SegmentOperandPropertyAsSegmentChildConditionOperands is a convenience function that returns SegmentOperandProperty wrapped in SegmentChildConditionOperands -func SegmentOperandPropertyAsSegmentChildConditionOperands(v *SegmentOperandProperty) SegmentChildConditionOperands { - return SegmentChildConditionOperands{ - SegmentOperandProperty: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *SegmentChildConditionOperands) UnmarshalJSON(data []byte) error { - var err error - // try to unmarshal data into SegmentOperandAffinity - err = newStrictDecoder(data).Decode(&dst.SegmentOperandAffinity) - if err == nil && validateStruct(dst.SegmentOperandAffinity) == nil { - jsonSegmentOperandAffinity, _ := json.Marshal(dst.SegmentOperandAffinity) - if string(jsonSegmentOperandAffinity) == "{}" { // empty struct - dst.SegmentOperandAffinity = nil - } else { - return nil - } - } else { - dst.SegmentOperandAffinity = nil - } - - // try to unmarshal data into SegmentOperandFunnelStage - err = newStrictDecoder(data).Decode(&dst.SegmentOperandFunnelStage) - if err == nil && validateStruct(dst.SegmentOperandFunnelStage) == nil { - jsonSegmentOperandFunnelStage, _ := json.Marshal(dst.SegmentOperandFunnelStage) - if string(jsonSegmentOperandFunnelStage) == "{}" { // empty struct - dst.SegmentOperandFunnelStage = nil - } else { - return nil - } - } else { - dst.SegmentOperandFunnelStage = nil - } - - // try to unmarshal data into SegmentOperandOrderValue - err = newStrictDecoder(data).Decode(&dst.SegmentOperandOrderValue) - if err == nil && validateStruct(dst.SegmentOperandOrderValue) == nil { - jsonSegmentOperandOrderValue, _ := json.Marshal(dst.SegmentOperandOrderValue) - if string(jsonSegmentOperandOrderValue) == "{}" { // empty struct - dst.SegmentOperandOrderValue = nil - } else { - return nil - } - } else { - dst.SegmentOperandOrderValue = nil - } - - // try to unmarshal data into SegmentOperandProperty - err = newStrictDecoder(data).Decode(&dst.SegmentOperandProperty) - if err == nil && validateStruct(dst.SegmentOperandProperty) == nil { - jsonSegmentOperandProperty, _ := json.Marshal(dst.SegmentOperandProperty) - if string(jsonSegmentOperandProperty) == "{}" { // empty struct - dst.SegmentOperandProperty = nil - } else { - return nil - } - } else { - dst.SegmentOperandProperty = nil - } - - return fmt.Errorf("Data failed to match schemas in oneOf(SegmentChildConditionOperands)") -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src SegmentChildConditionOperands) MarshalJSON() ([]byte, error) { - if src.SegmentOperandAffinity != nil { - return json.Marshal(&src.SegmentOperandAffinity) - } - - if src.SegmentOperandFunnelStage != nil { - return json.Marshal(&src.SegmentOperandFunnelStage) - } - - if src.SegmentOperandOrderValue != nil { - return json.Marshal(&src.SegmentOperandOrderValue) - } - - if src.SegmentOperandProperty != nil { - return json.Marshal(&src.SegmentOperandProperty) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *SegmentChildConditionOperands) GetActualInstance() any { - if obj == nil { - return nil - } - if obj.SegmentOperandAffinity != nil { - return obj.SegmentOperandAffinity - } - - if obj.SegmentOperandFunnelStage != nil { - return obj.SegmentOperandFunnelStage - } - - if obj.SegmentOperandOrderValue != nil { - return obj.SegmentOperandOrderValue - } - - if obj.SegmentOperandProperty != nil { - return obj.SegmentOperandProperty - } - - // all schemas are nil - return nil -} - -type NullableSegmentChildConditionOperands struct { - value *SegmentChildConditionOperands - isSet bool -} - -func (v NullableSegmentChildConditionOperands) Get() *SegmentChildConditionOperands { - return v.value -} - -func (v *NullableSegmentChildConditionOperands) Set(val *SegmentChildConditionOperands) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentChildConditionOperands) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentChildConditionOperands) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentChildConditionOperands(val *SegmentChildConditionOperands) *NullableSegmentChildConditionOperands { - return &NullableSegmentChildConditionOperands{value: val, isSet: true} -} - -func (v NullableSegmentChildConditionOperands) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentChildConditionOperands) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_child_conditions.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_child_conditions.go deleted file mode 100644 index cb57847969..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_child_conditions.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentChildConditions Nested segment conditions that only contain operands. -type SegmentChildConditions struct { - Operator SegmentConditionOperator `json:"operator" validate:"required"` - Operands []SegmentChildConditionOperands `json:"operands" validate:"required"` -} - -// NewSegmentChildConditions instantiates a new SegmentChildConditions object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSegmentChildConditions(operator SegmentConditionOperator, operands []SegmentChildConditionOperands) *SegmentChildConditions { - this := &SegmentChildConditions{} - this.Operator = operator - this.Operands = operands - return this -} - -// NewSegmentChildConditionsWithDefaults instantiates a new SegmentChildConditions object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSegmentChildConditionsWithDefaults() *SegmentChildConditions { - this := &SegmentChildConditions{} - return this -} - -// GetOperator returns the Operator field value -func (o *SegmentChildConditions) GetOperator() SegmentConditionOperator { - if o == nil { - var ret SegmentConditionOperator - return ret - } - - return o.Operator -} - -// GetOperatorOk returns a tuple with the Operator field value -// and a boolean to check if the value has been set. -func (o *SegmentChildConditions) GetOperatorOk() (*SegmentConditionOperator, bool) { - if o == nil { - return nil, false - } - return &o.Operator, true -} - -// SetOperator sets field value -func (o *SegmentChildConditions) SetOperator(v SegmentConditionOperator) { - o.Operator = v -} - -// GetOperands returns the Operands field value -func (o *SegmentChildConditions) GetOperands() []SegmentChildConditionOperands { - if o == nil { - var ret []SegmentChildConditionOperands - return ret - } - - return o.Operands -} - -// GetOperandsOk returns a tuple with the Operands field value -// and a boolean to check if the value has been set. -func (o *SegmentChildConditions) GetOperandsOk() ([]SegmentChildConditionOperands, bool) { - if o == nil { - return nil, false - } - return o.Operands, true -} - -// SetOperands sets field value -func (o *SegmentChildConditions) SetOperands(v []SegmentChildConditionOperands) { - o.Operands = v -} - -func (o SegmentChildConditions) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["operator"] = o.Operator - } - if true { - toSerialize["operands"] = o.Operands - } - return json.Marshal(toSerialize) -} - -func (o SegmentChildConditions) String() string { - out := "" - out += fmt.Sprintf(" operator=%v\n", o.Operator) - out += fmt.Sprintf(" operands=%v\n", o.Operands) - return fmt.Sprintf("SegmentChildConditions {\n%s}", out) -} - -type NullableSegmentChildConditions struct { - value *SegmentChildConditions - isSet bool -} - -func (v NullableSegmentChildConditions) Get() *SegmentChildConditions { - return v.value -} - -func (v *NullableSegmentChildConditions) Set(val *SegmentChildConditions) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentChildConditions) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentChildConditions) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentChildConditions(val *SegmentChildConditions) *NullableSegmentChildConditions { - return &NullableSegmentChildConditions{value: val, isSet: true} -} - -func (v NullableSegmentChildConditions) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentChildConditions) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_condition_operator.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_condition_operator.go deleted file mode 100644 index 55466d5e25..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_condition_operator.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentConditionOperator Operator used to combine the operands. -type SegmentConditionOperator string - -// List of segmentConditionOperator -const ( - SEGMENTCONDITIONOPERATOR_AND SegmentConditionOperator = "AND" - SEGMENTCONDITIONOPERATOR_OR SegmentConditionOperator = "OR" -) - -// All allowed values of SegmentConditionOperator enum -var AllowedSegmentConditionOperatorEnumValues = []SegmentConditionOperator{ - "AND", - "OR", -} - -func (v *SegmentConditionOperator) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := SegmentConditionOperator(value) - for _, existing := range AllowedSegmentConditionOperatorEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid SegmentConditionOperator", value) -} - -// NewSegmentConditionOperatorFromValue returns a pointer to a valid SegmentConditionOperator -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewSegmentConditionOperatorFromValue(v string) (*SegmentConditionOperator, error) { - ev := SegmentConditionOperator(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for SegmentConditionOperator: valid values are %v", v, AllowedSegmentConditionOperatorEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v SegmentConditionOperator) IsValid() bool { - for _, existing := range AllowedSegmentConditionOperatorEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to segmentConditionOperator value -func (v SegmentConditionOperator) Ptr() *SegmentConditionOperator { - return &v -} - -type NullableSegmentConditionOperator struct { - value *SegmentConditionOperator - isSet bool -} - -func (v NullableSegmentConditionOperator) Get() *SegmentConditionOperator { - return v.value -} - -func (v *NullableSegmentConditionOperator) Set(val *SegmentConditionOperator) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentConditionOperator) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentConditionOperator) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentConditionOperator(val *SegmentConditionOperator) *NullableSegmentConditionOperator { - return &NullableSegmentConditionOperator{value: val, isSet: true} -} - -func (v NullableSegmentConditionOperator) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentConditionOperator) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_conditions_param.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_conditions_param.go deleted file mode 100644 index 21eca6bbf9..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_conditions_param.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentConditionsParam struct for SegmentConditionsParam -type SegmentConditionsParam struct { - Conditions *SegmentParentConditions `json:"conditions,omitempty"` -} - -type SegmentConditionsParamOption func(f *SegmentConditionsParam) - -func WithSegmentConditionsParamConditions(val SegmentParentConditions) SegmentConditionsParamOption { - return func(f *SegmentConditionsParam) { - f.Conditions = &val - } -} - -// NewSegmentConditionsParam instantiates a new SegmentConditionsParam object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSegmentConditionsParam(opts ...SegmentConditionsParamOption) *SegmentConditionsParam { - this := &SegmentConditionsParam{} - for _, opt := range opts { - opt(this) - } - return this -} - -// NewSegmentConditionsParamWithDefaults instantiates a new SegmentConditionsParam object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSegmentConditionsParamWithDefaults() *SegmentConditionsParam { - this := &SegmentConditionsParam{} - return this -} - -// GetConditions returns the Conditions field value if set, zero value otherwise. -func (o *SegmentConditionsParam) GetConditions() SegmentParentConditions { - if o == nil || o.Conditions == nil { - var ret SegmentParentConditions - return ret - } - return *o.Conditions -} - -// GetConditionsOk returns a tuple with the Conditions field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SegmentConditionsParam) GetConditionsOk() (*SegmentParentConditions, bool) { - if o == nil || o.Conditions == nil { - return nil, false - } - return o.Conditions, true -} - -// HasConditions returns a boolean if a field has been set. -func (o *SegmentConditionsParam) HasConditions() bool { - if o != nil && o.Conditions != nil { - return true - } - - return false -} - -// SetConditions gets a reference to the given SegmentParentConditions and assigns it to the Conditions field. -func (o *SegmentConditionsParam) SetConditions(v SegmentParentConditions) { - o.Conditions = &v -} - -func (o SegmentConditionsParam) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if o.Conditions != nil { - toSerialize["conditions"] = o.Conditions - } - return json.Marshal(toSerialize) -} - -func (o SegmentConditionsParam) String() string { - out := "" - out += fmt.Sprintf(" conditions=%v\n", o.Conditions) - return fmt.Sprintf("SegmentConditionsParam {\n%s}", out) -} - -type NullableSegmentConditionsParam struct { - value *SegmentConditionsParam - isSet bool -} - -func (v NullableSegmentConditionsParam) Get() *SegmentConditionsParam { - return v.value -} - -func (v *NullableSegmentConditionsParam) Set(val *SegmentConditionsParam) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentConditionsParam) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentConditionsParam) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentConditionsParam(val *SegmentConditionsParam) *NullableSegmentConditionsParam { - return &NullableSegmentConditionsParam{value: val, isSet: true} -} - -func (v NullableSegmentConditionsParam) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentConditionsParam) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_filter_operator_boolean.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_filter_operator_boolean.go deleted file mode 100644 index e12e1f8017..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_filter_operator_boolean.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentFilterOperatorBoolean The operator used on the boolean filter value. -type SegmentFilterOperatorBoolean string - -// List of segmentFilterOperatorBoolean -const ( - SEGMENTFILTEROPERATORBOOLEAN_EQ SegmentFilterOperatorBoolean = "EQ" - SEGMENTFILTEROPERATORBOOLEAN_NEQ SegmentFilterOperatorBoolean = "NEQ" -) - -// All allowed values of SegmentFilterOperatorBoolean enum -var AllowedSegmentFilterOperatorBooleanEnumValues = []SegmentFilterOperatorBoolean{ - "EQ", - "NEQ", -} - -func (v *SegmentFilterOperatorBoolean) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := SegmentFilterOperatorBoolean(value) - for _, existing := range AllowedSegmentFilterOperatorBooleanEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid SegmentFilterOperatorBoolean", value) -} - -// NewSegmentFilterOperatorBooleanFromValue returns a pointer to a valid SegmentFilterOperatorBoolean -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewSegmentFilterOperatorBooleanFromValue(v string) (*SegmentFilterOperatorBoolean, error) { - ev := SegmentFilterOperatorBoolean(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for SegmentFilterOperatorBoolean: valid values are %v", v, AllowedSegmentFilterOperatorBooleanEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v SegmentFilterOperatorBoolean) IsValid() bool { - for _, existing := range AllowedSegmentFilterOperatorBooleanEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to segmentFilterOperatorBoolean value -func (v SegmentFilterOperatorBoolean) Ptr() *SegmentFilterOperatorBoolean { - return &v -} - -type NullableSegmentFilterOperatorBoolean struct { - value *SegmentFilterOperatorBoolean - isSet bool -} - -func (v NullableSegmentFilterOperatorBoolean) Get() *SegmentFilterOperatorBoolean { - return v.value -} - -func (v *NullableSegmentFilterOperatorBoolean) Set(val *SegmentFilterOperatorBoolean) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentFilterOperatorBoolean) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentFilterOperatorBoolean) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentFilterOperatorBoolean(val *SegmentFilterOperatorBoolean) *NullableSegmentFilterOperatorBoolean { - return &NullableSegmentFilterOperatorBoolean{value: val, isSet: true} -} - -func (v NullableSegmentFilterOperatorBoolean) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentFilterOperatorBoolean) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_filter_operator_numerical.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_filter_operator_numerical.go deleted file mode 100644 index 786019ae66..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_filter_operator_numerical.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentFilterOperatorNumerical The operator used on the numerical filter value. -type SegmentFilterOperatorNumerical string - -// List of segmentFilterOperatorNumerical -const ( - SEGMENTFILTEROPERATORNUMERICAL_EQ SegmentFilterOperatorNumerical = "EQ" - SEGMENTFILTEROPERATORNUMERICAL_NEQ SegmentFilterOperatorNumerical = "NEQ" - SEGMENTFILTEROPERATORNUMERICAL_GT SegmentFilterOperatorNumerical = "GT" - SEGMENTFILTEROPERATORNUMERICAL_GTE SegmentFilterOperatorNumerical = "GTE" - SEGMENTFILTEROPERATORNUMERICAL_LT SegmentFilterOperatorNumerical = "LT" - SEGMENTFILTEROPERATORNUMERICAL_LTE SegmentFilterOperatorNumerical = "LTE" -) - -// All allowed values of SegmentFilterOperatorNumerical enum -var AllowedSegmentFilterOperatorNumericalEnumValues = []SegmentFilterOperatorNumerical{ - "EQ", - "NEQ", - "GT", - "GTE", - "LT", - "LTE", -} - -func (v *SegmentFilterOperatorNumerical) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := SegmentFilterOperatorNumerical(value) - for _, existing := range AllowedSegmentFilterOperatorNumericalEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid SegmentFilterOperatorNumerical", value) -} - -// NewSegmentFilterOperatorNumericalFromValue returns a pointer to a valid SegmentFilterOperatorNumerical -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewSegmentFilterOperatorNumericalFromValue(v string) (*SegmentFilterOperatorNumerical, error) { - ev := SegmentFilterOperatorNumerical(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for SegmentFilterOperatorNumerical: valid values are %v", v, AllowedSegmentFilterOperatorNumericalEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v SegmentFilterOperatorNumerical) IsValid() bool { - for _, existing := range AllowedSegmentFilterOperatorNumericalEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to segmentFilterOperatorNumerical value -func (v SegmentFilterOperatorNumerical) Ptr() *SegmentFilterOperatorNumerical { - return &v -} - -type NullableSegmentFilterOperatorNumerical struct { - value *SegmentFilterOperatorNumerical - isSet bool -} - -func (v NullableSegmentFilterOperatorNumerical) Get() *SegmentFilterOperatorNumerical { - return v.value -} - -func (v *NullableSegmentFilterOperatorNumerical) Set(val *SegmentFilterOperatorNumerical) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentFilterOperatorNumerical) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentFilterOperatorNumerical) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentFilterOperatorNumerical(val *SegmentFilterOperatorNumerical) *NullableSegmentFilterOperatorNumerical { - return &NullableSegmentFilterOperatorNumerical{value: val, isSet: true} -} - -func (v NullableSegmentFilterOperatorNumerical) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentFilterOperatorNumerical) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_filter_probability.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_filter_probability.go deleted file mode 100644 index 2649021348..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_filter_probability.go +++ /dev/null @@ -1,251 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentFilterProbability Probability of the filter. -type SegmentFilterProbability struct { - LT *float32 `json:"LT,omitempty"` - LTE *float32 `json:"LTE,omitempty"` - GT *float32 `json:"GT,omitempty"` - GTE *float32 `json:"GTE,omitempty"` -} - -type SegmentFilterProbabilityOption func(f *SegmentFilterProbability) - -func WithSegmentFilterProbabilityLT(val float32) SegmentFilterProbabilityOption { - return func(f *SegmentFilterProbability) { - f.LT = &val - } -} - -func WithSegmentFilterProbabilityLTE(val float32) SegmentFilterProbabilityOption { - return func(f *SegmentFilterProbability) { - f.LTE = &val - } -} - -func WithSegmentFilterProbabilityGT(val float32) SegmentFilterProbabilityOption { - return func(f *SegmentFilterProbability) { - f.GT = &val - } -} - -func WithSegmentFilterProbabilityGTE(val float32) SegmentFilterProbabilityOption { - return func(f *SegmentFilterProbability) { - f.GTE = &val - } -} - -// NewSegmentFilterProbability instantiates a new SegmentFilterProbability object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSegmentFilterProbability(opts ...SegmentFilterProbabilityOption) *SegmentFilterProbability { - this := &SegmentFilterProbability{} - for _, opt := range opts { - opt(this) - } - return this -} - -// NewSegmentFilterProbabilityWithDefaults instantiates a new SegmentFilterProbability object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSegmentFilterProbabilityWithDefaults() *SegmentFilterProbability { - this := &SegmentFilterProbability{} - return this -} - -// GetLT returns the LT field value if set, zero value otherwise. -func (o *SegmentFilterProbability) GetLT() float32 { - if o == nil || o.LT == nil { - var ret float32 - return ret - } - return *o.LT -} - -// GetLTOk returns a tuple with the LT field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SegmentFilterProbability) GetLTOk() (*float32, bool) { - if o == nil || o.LT == nil { - return nil, false - } - return o.LT, true -} - -// HasLT returns a boolean if a field has been set. -func (o *SegmentFilterProbability) HasLT() bool { - if o != nil && o.LT != nil { - return true - } - - return false -} - -// SetLT gets a reference to the given float32 and assigns it to the LT field. -func (o *SegmentFilterProbability) SetLT(v float32) { - o.LT = &v -} - -// GetLTE returns the LTE field value if set, zero value otherwise. -func (o *SegmentFilterProbability) GetLTE() float32 { - if o == nil || o.LTE == nil { - var ret float32 - return ret - } - return *o.LTE -} - -// GetLTEOk returns a tuple with the LTE field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SegmentFilterProbability) GetLTEOk() (*float32, bool) { - if o == nil || o.LTE == nil { - return nil, false - } - return o.LTE, true -} - -// HasLTE returns a boolean if a field has been set. -func (o *SegmentFilterProbability) HasLTE() bool { - if o != nil && o.LTE != nil { - return true - } - - return false -} - -// SetLTE gets a reference to the given float32 and assigns it to the LTE field. -func (o *SegmentFilterProbability) SetLTE(v float32) { - o.LTE = &v -} - -// GetGT returns the GT field value if set, zero value otherwise. -func (o *SegmentFilterProbability) GetGT() float32 { - if o == nil || o.GT == nil { - var ret float32 - return ret - } - return *o.GT -} - -// GetGTOk returns a tuple with the GT field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SegmentFilterProbability) GetGTOk() (*float32, bool) { - if o == nil || o.GT == nil { - return nil, false - } - return o.GT, true -} - -// HasGT returns a boolean if a field has been set. -func (o *SegmentFilterProbability) HasGT() bool { - if o != nil && o.GT != nil { - return true - } - - return false -} - -// SetGT gets a reference to the given float32 and assigns it to the GT field. -func (o *SegmentFilterProbability) SetGT(v float32) { - o.GT = &v -} - -// GetGTE returns the GTE field value if set, zero value otherwise. -func (o *SegmentFilterProbability) GetGTE() float32 { - if o == nil || o.GTE == nil { - var ret float32 - return ret - } - return *o.GTE -} - -// GetGTEOk returns a tuple with the GTE field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SegmentFilterProbability) GetGTEOk() (*float32, bool) { - if o == nil || o.GTE == nil { - return nil, false - } - return o.GTE, true -} - -// HasGTE returns a boolean if a field has been set. -func (o *SegmentFilterProbability) HasGTE() bool { - if o != nil && o.GTE != nil { - return true - } - - return false -} - -// SetGTE gets a reference to the given float32 and assigns it to the GTE field. -func (o *SegmentFilterProbability) SetGTE(v float32) { - o.GTE = &v -} - -func (o SegmentFilterProbability) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if o.LT != nil { - toSerialize["LT"] = o.LT - } - if o.LTE != nil { - toSerialize["LTE"] = o.LTE - } - if o.GT != nil { - toSerialize["GT"] = o.GT - } - if o.GTE != nil { - toSerialize["GTE"] = o.GTE - } - return json.Marshal(toSerialize) -} - -func (o SegmentFilterProbability) String() string { - out := "" - out += fmt.Sprintf(" LT=%v\n", o.LT) - out += fmt.Sprintf(" LTE=%v\n", o.LTE) - out += fmt.Sprintf(" GT=%v\n", o.GT) - out += fmt.Sprintf(" GTE=%v\n", o.GTE) - return fmt.Sprintf("SegmentFilterProbability {\n%s}", out) -} - -type NullableSegmentFilterProbability struct { - value *SegmentFilterProbability - isSet bool -} - -func (v NullableSegmentFilterProbability) Get() *SegmentFilterProbability { - return v.value -} - -func (v *NullableSegmentFilterProbability) Set(val *SegmentFilterProbability) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentFilterProbability) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentFilterProbability) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentFilterProbability(val *SegmentFilterProbability) *NullableSegmentFilterProbability { - return &NullableSegmentFilterProbability{value: val, isSet: true} -} - -func (v NullableSegmentFilterProbability) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentFilterProbability) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_funnel_stage_filter.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_funnel_stage_filter.go deleted file mode 100644 index d9faa5b8a7..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_funnel_stage_filter.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentFunnelStageFilter Filter for funnel stage model predictions. -type SegmentFunnelStageFilter struct { - Operator *SegmentFilterOperatorBoolean `json:"operator,omitempty"` - Value string `json:"value" validate:"required"` - Probability SegmentFilterProbability `json:"probability" validate:"required"` -} - -type SegmentFunnelStageFilterOption func(f *SegmentFunnelStageFilter) - -func WithSegmentFunnelStageFilterOperator(val SegmentFilterOperatorBoolean) SegmentFunnelStageFilterOption { - return func(f *SegmentFunnelStageFilter) { - f.Operator = &val - } -} - -// NewSegmentFunnelStageFilter instantiates a new SegmentFunnelStageFilter object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSegmentFunnelStageFilter(value string, probability SegmentFilterProbability, opts ...SegmentFunnelStageFilterOption) *SegmentFunnelStageFilter { - this := &SegmentFunnelStageFilter{} - this.Value = value - this.Probability = probability - for _, opt := range opts { - opt(this) - } - return this -} - -// NewSegmentFunnelStageFilterWithDefaults instantiates a new SegmentFunnelStageFilter object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSegmentFunnelStageFilterWithDefaults() *SegmentFunnelStageFilter { - this := &SegmentFunnelStageFilter{} - var operator SegmentFilterOperatorBoolean = SEGMENTFILTEROPERATORBOOLEAN_EQ - this.Operator = &operator - return this -} - -// GetOperator returns the Operator field value if set, zero value otherwise. -func (o *SegmentFunnelStageFilter) GetOperator() SegmentFilterOperatorBoolean { - if o == nil || o.Operator == nil { - var ret SegmentFilterOperatorBoolean - return ret - } - return *o.Operator -} - -// GetOperatorOk returns a tuple with the Operator field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SegmentFunnelStageFilter) GetOperatorOk() (*SegmentFilterOperatorBoolean, bool) { - if o == nil || o.Operator == nil { - return nil, false - } - return o.Operator, true -} - -// HasOperator returns a boolean if a field has been set. -func (o *SegmentFunnelStageFilter) HasOperator() bool { - if o != nil && o.Operator != nil { - return true - } - - return false -} - -// SetOperator gets a reference to the given SegmentFilterOperatorBoolean and assigns it to the Operator field. -func (o *SegmentFunnelStageFilter) SetOperator(v SegmentFilterOperatorBoolean) { - o.Operator = &v -} - -// GetValue returns the Value field value -func (o *SegmentFunnelStageFilter) GetValue() string { - if o == nil { - var ret string - return ret - } - - return o.Value -} - -// GetValueOk returns a tuple with the Value field value -// and a boolean to check if the value has been set. -func (o *SegmentFunnelStageFilter) GetValueOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Value, true -} - -// SetValue sets field value -func (o *SegmentFunnelStageFilter) SetValue(v string) { - o.Value = v -} - -// GetProbability returns the Probability field value -func (o *SegmentFunnelStageFilter) GetProbability() SegmentFilterProbability { - if o == nil { - var ret SegmentFilterProbability - return ret - } - - return o.Probability -} - -// GetProbabilityOk returns a tuple with the Probability field value -// and a boolean to check if the value has been set. -func (o *SegmentFunnelStageFilter) GetProbabilityOk() (*SegmentFilterProbability, bool) { - if o == nil { - return nil, false - } - return &o.Probability, true -} - -// SetProbability sets field value -func (o *SegmentFunnelStageFilter) SetProbability(v SegmentFilterProbability) { - o.Probability = v -} - -func (o SegmentFunnelStageFilter) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if o.Operator != nil { - toSerialize["operator"] = o.Operator - } - if true { - toSerialize["value"] = o.Value - } - if true { - toSerialize["probability"] = o.Probability - } - return json.Marshal(toSerialize) -} - -func (o SegmentFunnelStageFilter) String() string { - out := "" - out += fmt.Sprintf(" operator=%v\n", o.Operator) - out += fmt.Sprintf(" value=%v\n", o.Value) - out += fmt.Sprintf(" probability=%v\n", o.Probability) - return fmt.Sprintf("SegmentFunnelStageFilter {\n%s}", out) -} - -type NullableSegmentFunnelStageFilter struct { - value *SegmentFunnelStageFilter - isSet bool -} - -func (v NullableSegmentFunnelStageFilter) Get() *SegmentFunnelStageFilter { - return v.value -} - -func (v *NullableSegmentFunnelStageFilter) Set(val *SegmentFunnelStageFilter) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentFunnelStageFilter) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentFunnelStageFilter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentFunnelStageFilter(val *SegmentFunnelStageFilter) *NullableSegmentFunnelStageFilter { - return &NullableSegmentFunnelStageFilter{value: val, isSet: true} -} - -func (v NullableSegmentFunnelStageFilter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentFunnelStageFilter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_name_param.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_name_param.go deleted file mode 100644 index 579d3ebe27..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_name_param.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentNameParam struct for SegmentNameParam -type SegmentNameParam struct { - // The name or description of the segment. - Name *string `json:"name,omitempty"` -} - -type SegmentNameParamOption func(f *SegmentNameParam) - -func WithSegmentNameParamName(val string) SegmentNameParamOption { - return func(f *SegmentNameParam) { - f.Name = &val - } -} - -// NewSegmentNameParam instantiates a new SegmentNameParam object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSegmentNameParam(opts ...SegmentNameParamOption) *SegmentNameParam { - this := &SegmentNameParam{} - for _, opt := range opts { - opt(this) - } - return this -} - -// NewSegmentNameParamWithDefaults instantiates a new SegmentNameParam object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSegmentNameParamWithDefaults() *SegmentNameParam { - this := &SegmentNameParam{} - return this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *SegmentNameParam) GetName() string { - if o == nil || o.Name == nil { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SegmentNameParam) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *SegmentNameParam) HasName() bool { - if o != nil && o.Name != nil { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *SegmentNameParam) SetName(v string) { - o.Name = &v -} - -func (o SegmentNameParam) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if o.Name != nil { - toSerialize["name"] = o.Name - } - return json.Marshal(toSerialize) -} - -func (o SegmentNameParam) String() string { - out := "" - out += fmt.Sprintf(" name=%v\n", o.Name) - return fmt.Sprintf("SegmentNameParam {\n%s}", out) -} - -type NullableSegmentNameParam struct { - value *SegmentNameParam - isSet bool -} - -func (v NullableSegmentNameParam) Get() *SegmentNameParam { - return v.value -} - -func (v *NullableSegmentNameParam) Set(val *SegmentNameParam) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentNameParam) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentNameParam) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentNameParam(val *SegmentNameParam) *NullableSegmentNameParam { - return &NullableSegmentNameParam{value: val, isSet: true} -} - -func (v NullableSegmentNameParam) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentNameParam) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_operand_affinity.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_operand_affinity.go deleted file mode 100644 index 626803ed6b..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_operand_affinity.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentOperandAffinity Operand for affinity model predictions. -type SegmentOperandAffinity struct { - Name string `json:"name" validate:"required"` - Filters []SegmentAffinityFilter `json:"filters" validate:"required"` -} - -// NewSegmentOperandAffinity instantiates a new SegmentOperandAffinity object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSegmentOperandAffinity(name string, filters []SegmentAffinityFilter) *SegmentOperandAffinity { - this := &SegmentOperandAffinity{} - this.Name = name - this.Filters = filters - return this -} - -// NewSegmentOperandAffinityWithDefaults instantiates a new SegmentOperandAffinity object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSegmentOperandAffinityWithDefaults() *SegmentOperandAffinity { - this := &SegmentOperandAffinity{} - return this -} - -// GetName returns the Name field value -func (o *SegmentOperandAffinity) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *SegmentOperandAffinity) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *SegmentOperandAffinity) SetName(v string) { - o.Name = v -} - -// GetFilters returns the Filters field value -func (o *SegmentOperandAffinity) GetFilters() []SegmentAffinityFilter { - if o == nil { - var ret []SegmentAffinityFilter - return ret - } - - return o.Filters -} - -// GetFiltersOk returns a tuple with the Filters field value -// and a boolean to check if the value has been set. -func (o *SegmentOperandAffinity) GetFiltersOk() ([]SegmentAffinityFilter, bool) { - if o == nil { - return nil, false - } - return o.Filters, true -} - -// SetFilters sets field value -func (o *SegmentOperandAffinity) SetFilters(v []SegmentAffinityFilter) { - o.Filters = v -} - -func (o SegmentOperandAffinity) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["name"] = o.Name - } - if true { - toSerialize["filters"] = o.Filters - } - return json.Marshal(toSerialize) -} - -func (o SegmentOperandAffinity) String() string { - out := "" - out += fmt.Sprintf(" name=%v\n", o.Name) - out += fmt.Sprintf(" filters=%v\n", o.Filters) - return fmt.Sprintf("SegmentOperandAffinity {\n%s}", out) -} - -type NullableSegmentOperandAffinity struct { - value *SegmentOperandAffinity - isSet bool -} - -func (v NullableSegmentOperandAffinity) Get() *SegmentOperandAffinity { - return v.value -} - -func (v *NullableSegmentOperandAffinity) Set(val *SegmentOperandAffinity) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentOperandAffinity) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentOperandAffinity) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentOperandAffinity(val *SegmentOperandAffinity) *NullableSegmentOperandAffinity { - return &NullableSegmentOperandAffinity{value: val, isSet: true} -} - -func (v NullableSegmentOperandAffinity) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentOperandAffinity) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_operand_funnel_stage.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_operand_funnel_stage.go deleted file mode 100644 index 94e4e8a569..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_operand_funnel_stage.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentOperandFunnelStage Operand for funnel stage model predictions. -type SegmentOperandFunnelStage struct { - Name string `json:"name" validate:"required"` - Filters []SegmentFunnelStageFilter `json:"filters" validate:"required"` -} - -// NewSegmentOperandFunnelStage instantiates a new SegmentOperandFunnelStage object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSegmentOperandFunnelStage(name string, filters []SegmentFunnelStageFilter) *SegmentOperandFunnelStage { - this := &SegmentOperandFunnelStage{} - this.Name = name - this.Filters = filters - return this -} - -// NewSegmentOperandFunnelStageWithDefaults instantiates a new SegmentOperandFunnelStage object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSegmentOperandFunnelStageWithDefaults() *SegmentOperandFunnelStage { - this := &SegmentOperandFunnelStage{} - return this -} - -// GetName returns the Name field value -func (o *SegmentOperandFunnelStage) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *SegmentOperandFunnelStage) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *SegmentOperandFunnelStage) SetName(v string) { - o.Name = v -} - -// GetFilters returns the Filters field value -func (o *SegmentOperandFunnelStage) GetFilters() []SegmentFunnelStageFilter { - if o == nil { - var ret []SegmentFunnelStageFilter - return ret - } - - return o.Filters -} - -// GetFiltersOk returns a tuple with the Filters field value -// and a boolean to check if the value has been set. -func (o *SegmentOperandFunnelStage) GetFiltersOk() ([]SegmentFunnelStageFilter, bool) { - if o == nil { - return nil, false - } - return o.Filters, true -} - -// SetFilters sets field value -func (o *SegmentOperandFunnelStage) SetFilters(v []SegmentFunnelStageFilter) { - o.Filters = v -} - -func (o SegmentOperandFunnelStage) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["name"] = o.Name - } - if true { - toSerialize["filters"] = o.Filters - } - return json.Marshal(toSerialize) -} - -func (o SegmentOperandFunnelStage) String() string { - out := "" - out += fmt.Sprintf(" name=%v\n", o.Name) - out += fmt.Sprintf(" filters=%v\n", o.Filters) - return fmt.Sprintf("SegmentOperandFunnelStage {\n%s}", out) -} - -type NullableSegmentOperandFunnelStage struct { - value *SegmentOperandFunnelStage - isSet bool -} - -func (v NullableSegmentOperandFunnelStage) Get() *SegmentOperandFunnelStage { - return v.value -} - -func (v *NullableSegmentOperandFunnelStage) Set(val *SegmentOperandFunnelStage) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentOperandFunnelStage) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentOperandFunnelStage) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentOperandFunnelStage(val *SegmentOperandFunnelStage) *NullableSegmentOperandFunnelStage { - return &NullableSegmentOperandFunnelStage{value: val, isSet: true} -} - -func (v NullableSegmentOperandFunnelStage) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentOperandFunnelStage) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_operand_order_value.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_operand_order_value.go deleted file mode 100644 index 442a334732..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_operand_order_value.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentOperandOrderValue Operand for order value model predictions. -type SegmentOperandOrderValue struct { - Name string `json:"name" validate:"required"` - Filters []SegmentOrderValueFilter `json:"filters" validate:"required"` -} - -// NewSegmentOperandOrderValue instantiates a new SegmentOperandOrderValue object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSegmentOperandOrderValue(name string, filters []SegmentOrderValueFilter) *SegmentOperandOrderValue { - this := &SegmentOperandOrderValue{} - this.Name = name - this.Filters = filters - return this -} - -// NewSegmentOperandOrderValueWithDefaults instantiates a new SegmentOperandOrderValue object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSegmentOperandOrderValueWithDefaults() *SegmentOperandOrderValue { - this := &SegmentOperandOrderValue{} - return this -} - -// GetName returns the Name field value -func (o *SegmentOperandOrderValue) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *SegmentOperandOrderValue) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *SegmentOperandOrderValue) SetName(v string) { - o.Name = v -} - -// GetFilters returns the Filters field value -func (o *SegmentOperandOrderValue) GetFilters() []SegmentOrderValueFilter { - if o == nil { - var ret []SegmentOrderValueFilter - return ret - } - - return o.Filters -} - -// GetFiltersOk returns a tuple with the Filters field value -// and a boolean to check if the value has been set. -func (o *SegmentOperandOrderValue) GetFiltersOk() ([]SegmentOrderValueFilter, bool) { - if o == nil { - return nil, false - } - return o.Filters, true -} - -// SetFilters sets field value -func (o *SegmentOperandOrderValue) SetFilters(v []SegmentOrderValueFilter) { - o.Filters = v -} - -func (o SegmentOperandOrderValue) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["name"] = o.Name - } - if true { - toSerialize["filters"] = o.Filters - } - return json.Marshal(toSerialize) -} - -func (o SegmentOperandOrderValue) String() string { - out := "" - out += fmt.Sprintf(" name=%v\n", o.Name) - out += fmt.Sprintf(" filters=%v\n", o.Filters) - return fmt.Sprintf("SegmentOperandOrderValue {\n%s}", out) -} - -type NullableSegmentOperandOrderValue struct { - value *SegmentOperandOrderValue - isSet bool -} - -func (v NullableSegmentOperandOrderValue) Get() *SegmentOperandOrderValue { - return v.value -} - -func (v *NullableSegmentOperandOrderValue) Set(val *SegmentOperandOrderValue) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentOperandOrderValue) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentOperandOrderValue) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentOperandOrderValue(val *SegmentOperandOrderValue) *NullableSegmentOperandOrderValue { - return &NullableSegmentOperandOrderValue{value: val, isSet: true} -} - -func (v NullableSegmentOperandOrderValue) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentOperandOrderValue) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_operand_property.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_operand_property.go deleted file mode 100644 index c8d0e5b7ca..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_operand_property.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentOperandProperty Operand for user profile properties. -type SegmentOperandProperty struct { - Name string `json:"name" validate:"required"` - Filters []SegmentPropertyFilter `json:"filters" validate:"required"` -} - -// NewSegmentOperandProperty instantiates a new SegmentOperandProperty object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSegmentOperandProperty(name string, filters []SegmentPropertyFilter) *SegmentOperandProperty { - this := &SegmentOperandProperty{} - this.Name = name - this.Filters = filters - return this -} - -// NewSegmentOperandPropertyWithDefaults instantiates a new SegmentOperandProperty object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSegmentOperandPropertyWithDefaults() *SegmentOperandProperty { - this := &SegmentOperandProperty{} - return this -} - -// GetName returns the Name field value -func (o *SegmentOperandProperty) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *SegmentOperandProperty) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *SegmentOperandProperty) SetName(v string) { - o.Name = v -} - -// GetFilters returns the Filters field value -func (o *SegmentOperandProperty) GetFilters() []SegmentPropertyFilter { - if o == nil { - var ret []SegmentPropertyFilter - return ret - } - - return o.Filters -} - -// GetFiltersOk returns a tuple with the Filters field value -// and a boolean to check if the value has been set. -func (o *SegmentOperandProperty) GetFiltersOk() ([]SegmentPropertyFilter, bool) { - if o == nil { - return nil, false - } - return o.Filters, true -} - -// SetFilters sets field value -func (o *SegmentOperandProperty) SetFilters(v []SegmentPropertyFilter) { - o.Filters = v -} - -func (o SegmentOperandProperty) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["name"] = o.Name - } - if true { - toSerialize["filters"] = o.Filters - } - return json.Marshal(toSerialize) -} - -func (o SegmentOperandProperty) String() string { - out := "" - out += fmt.Sprintf(" name=%v\n", o.Name) - out += fmt.Sprintf(" filters=%v\n", o.Filters) - return fmt.Sprintf("SegmentOperandProperty {\n%s}", out) -} - -type NullableSegmentOperandProperty struct { - value *SegmentOperandProperty - isSet bool -} - -func (v NullableSegmentOperandProperty) Get() *SegmentOperandProperty { - return v.value -} - -func (v *NullableSegmentOperandProperty) Set(val *SegmentOperandProperty) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentOperandProperty) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentOperandProperty) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentOperandProperty(val *SegmentOperandProperty) *NullableSegmentOperandProperty { - return &NullableSegmentOperandProperty{value: val, isSet: true} -} - -func (v NullableSegmentOperandProperty) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentOperandProperty) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_order_value_filter.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_order_value_filter.go deleted file mode 100644 index 484fdd3647..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_order_value_filter.go +++ /dev/null @@ -1,154 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentOrderValueFilter Filter for order value model predictions. -type SegmentOrderValueFilter struct { - Operator *SegmentFilterOperatorNumerical `json:"operator,omitempty"` - Value float32 `json:"value" validate:"required"` -} - -type SegmentOrderValueFilterOption func(f *SegmentOrderValueFilter) - -func WithSegmentOrderValueFilterOperator(val SegmentFilterOperatorNumerical) SegmentOrderValueFilterOption { - return func(f *SegmentOrderValueFilter) { - f.Operator = &val - } -} - -// NewSegmentOrderValueFilter instantiates a new SegmentOrderValueFilter object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSegmentOrderValueFilter(value float32, opts ...SegmentOrderValueFilterOption) *SegmentOrderValueFilter { - this := &SegmentOrderValueFilter{} - this.Value = value - for _, opt := range opts { - opt(this) - } - return this -} - -// NewSegmentOrderValueFilterWithDefaults instantiates a new SegmentOrderValueFilter object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSegmentOrderValueFilterWithDefaults() *SegmentOrderValueFilter { - this := &SegmentOrderValueFilter{} - var operator SegmentFilterOperatorNumerical = SEGMENTFILTEROPERATORNUMERICAL_EQ - this.Operator = &operator - return this -} - -// GetOperator returns the Operator field value if set, zero value otherwise. -func (o *SegmentOrderValueFilter) GetOperator() SegmentFilterOperatorNumerical { - if o == nil || o.Operator == nil { - var ret SegmentFilterOperatorNumerical - return ret - } - return *o.Operator -} - -// GetOperatorOk returns a tuple with the Operator field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SegmentOrderValueFilter) GetOperatorOk() (*SegmentFilterOperatorNumerical, bool) { - if o == nil || o.Operator == nil { - return nil, false - } - return o.Operator, true -} - -// HasOperator returns a boolean if a field has been set. -func (o *SegmentOrderValueFilter) HasOperator() bool { - if o != nil && o.Operator != nil { - return true - } - - return false -} - -// SetOperator gets a reference to the given SegmentFilterOperatorNumerical and assigns it to the Operator field. -func (o *SegmentOrderValueFilter) SetOperator(v SegmentFilterOperatorNumerical) { - o.Operator = &v -} - -// GetValue returns the Value field value -func (o *SegmentOrderValueFilter) GetValue() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.Value -} - -// GetValueOk returns a tuple with the Value field value -// and a boolean to check if the value has been set. -func (o *SegmentOrderValueFilter) GetValueOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.Value, true -} - -// SetValue sets field value -func (o *SegmentOrderValueFilter) SetValue(v float32) { - o.Value = v -} - -func (o SegmentOrderValueFilter) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if o.Operator != nil { - toSerialize["operator"] = o.Operator - } - if true { - toSerialize["value"] = o.Value - } - return json.Marshal(toSerialize) -} - -func (o SegmentOrderValueFilter) String() string { - out := "" - out += fmt.Sprintf(" operator=%v\n", o.Operator) - out += fmt.Sprintf(" value=%v\n", o.Value) - return fmt.Sprintf("SegmentOrderValueFilter {\n%s}", out) -} - -type NullableSegmentOrderValueFilter struct { - value *SegmentOrderValueFilter - isSet bool -} - -func (v NullableSegmentOrderValueFilter) Get() *SegmentOrderValueFilter { - return v.value -} - -func (v *NullableSegmentOrderValueFilter) Set(val *SegmentOrderValueFilter) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentOrderValueFilter) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentOrderValueFilter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentOrderValueFilter(val *SegmentOrderValueFilter) *NullableSegmentOrderValueFilter { - return &NullableSegmentOrderValueFilter{value: val, isSet: true} -} - -func (v NullableSegmentOrderValueFilter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentOrderValueFilter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_parent_condition_operands.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_parent_condition_operands.go deleted file mode 100644 index ab0fc59177..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_parent_condition_operands.go +++ /dev/null @@ -1,212 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentParentConditionOperands - struct for SegmentParentConditionOperands -type SegmentParentConditionOperands struct { - SegmentChildConditions *SegmentChildConditions - SegmentOperandAffinity *SegmentOperandAffinity - SegmentOperandFunnelStage *SegmentOperandFunnelStage - SegmentOperandOrderValue *SegmentOperandOrderValue - SegmentOperandProperty *SegmentOperandProperty -} - -// SegmentChildConditionsAsSegmentParentConditionOperands is a convenience function that returns SegmentChildConditions wrapped in SegmentParentConditionOperands -func SegmentChildConditionsAsSegmentParentConditionOperands(v *SegmentChildConditions) SegmentParentConditionOperands { - return SegmentParentConditionOperands{ - SegmentChildConditions: v, - } -} - -// SegmentOperandAffinityAsSegmentParentConditionOperands is a convenience function that returns SegmentOperandAffinity wrapped in SegmentParentConditionOperands -func SegmentOperandAffinityAsSegmentParentConditionOperands(v *SegmentOperandAffinity) SegmentParentConditionOperands { - return SegmentParentConditionOperands{ - SegmentOperandAffinity: v, - } -} - -// SegmentOperandFunnelStageAsSegmentParentConditionOperands is a convenience function that returns SegmentOperandFunnelStage wrapped in SegmentParentConditionOperands -func SegmentOperandFunnelStageAsSegmentParentConditionOperands(v *SegmentOperandFunnelStage) SegmentParentConditionOperands { - return SegmentParentConditionOperands{ - SegmentOperandFunnelStage: v, - } -} - -// SegmentOperandOrderValueAsSegmentParentConditionOperands is a convenience function that returns SegmentOperandOrderValue wrapped in SegmentParentConditionOperands -func SegmentOperandOrderValueAsSegmentParentConditionOperands(v *SegmentOperandOrderValue) SegmentParentConditionOperands { - return SegmentParentConditionOperands{ - SegmentOperandOrderValue: v, - } -} - -// SegmentOperandPropertyAsSegmentParentConditionOperands is a convenience function that returns SegmentOperandProperty wrapped in SegmentParentConditionOperands -func SegmentOperandPropertyAsSegmentParentConditionOperands(v *SegmentOperandProperty) SegmentParentConditionOperands { - return SegmentParentConditionOperands{ - SegmentOperandProperty: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *SegmentParentConditionOperands) UnmarshalJSON(data []byte) error { - var err error - // try to unmarshal data into SegmentChildConditions - err = newStrictDecoder(data).Decode(&dst.SegmentChildConditions) - if err == nil && validateStruct(dst.SegmentChildConditions) == nil { - jsonSegmentChildConditions, _ := json.Marshal(dst.SegmentChildConditions) - if string(jsonSegmentChildConditions) == "{}" { // empty struct - dst.SegmentChildConditions = nil - } else { - return nil - } - } else { - dst.SegmentChildConditions = nil - } - - // try to unmarshal data into SegmentOperandAffinity - err = newStrictDecoder(data).Decode(&dst.SegmentOperandAffinity) - if err == nil && validateStruct(dst.SegmentOperandAffinity) == nil { - jsonSegmentOperandAffinity, _ := json.Marshal(dst.SegmentOperandAffinity) - if string(jsonSegmentOperandAffinity) == "{}" { // empty struct - dst.SegmentOperandAffinity = nil - } else { - return nil - } - } else { - dst.SegmentOperandAffinity = nil - } - - // try to unmarshal data into SegmentOperandFunnelStage - err = newStrictDecoder(data).Decode(&dst.SegmentOperandFunnelStage) - if err == nil && validateStruct(dst.SegmentOperandFunnelStage) == nil { - jsonSegmentOperandFunnelStage, _ := json.Marshal(dst.SegmentOperandFunnelStage) - if string(jsonSegmentOperandFunnelStage) == "{}" { // empty struct - dst.SegmentOperandFunnelStage = nil - } else { - return nil - } - } else { - dst.SegmentOperandFunnelStage = nil - } - - // try to unmarshal data into SegmentOperandOrderValue - err = newStrictDecoder(data).Decode(&dst.SegmentOperandOrderValue) - if err == nil && validateStruct(dst.SegmentOperandOrderValue) == nil { - jsonSegmentOperandOrderValue, _ := json.Marshal(dst.SegmentOperandOrderValue) - if string(jsonSegmentOperandOrderValue) == "{}" { // empty struct - dst.SegmentOperandOrderValue = nil - } else { - return nil - } - } else { - dst.SegmentOperandOrderValue = nil - } - - // try to unmarshal data into SegmentOperandProperty - err = newStrictDecoder(data).Decode(&dst.SegmentOperandProperty) - if err == nil && validateStruct(dst.SegmentOperandProperty) == nil { - jsonSegmentOperandProperty, _ := json.Marshal(dst.SegmentOperandProperty) - if string(jsonSegmentOperandProperty) == "{}" { // empty struct - dst.SegmentOperandProperty = nil - } else { - return nil - } - } else { - dst.SegmentOperandProperty = nil - } - - return fmt.Errorf("Data failed to match schemas in oneOf(SegmentParentConditionOperands)") -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src SegmentParentConditionOperands) MarshalJSON() ([]byte, error) { - if src.SegmentChildConditions != nil { - return json.Marshal(&src.SegmentChildConditions) - } - - if src.SegmentOperandAffinity != nil { - return json.Marshal(&src.SegmentOperandAffinity) - } - - if src.SegmentOperandFunnelStage != nil { - return json.Marshal(&src.SegmentOperandFunnelStage) - } - - if src.SegmentOperandOrderValue != nil { - return json.Marshal(&src.SegmentOperandOrderValue) - } - - if src.SegmentOperandProperty != nil { - return json.Marshal(&src.SegmentOperandProperty) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *SegmentParentConditionOperands) GetActualInstance() any { - if obj == nil { - return nil - } - if obj.SegmentChildConditions != nil { - return obj.SegmentChildConditions - } - - if obj.SegmentOperandAffinity != nil { - return obj.SegmentOperandAffinity - } - - if obj.SegmentOperandFunnelStage != nil { - return obj.SegmentOperandFunnelStage - } - - if obj.SegmentOperandOrderValue != nil { - return obj.SegmentOperandOrderValue - } - - if obj.SegmentOperandProperty != nil { - return obj.SegmentOperandProperty - } - - // all schemas are nil - return nil -} - -type NullableSegmentParentConditionOperands struct { - value *SegmentParentConditionOperands - isSet bool -} - -func (v NullableSegmentParentConditionOperands) Get() *SegmentParentConditionOperands { - return v.value -} - -func (v *NullableSegmentParentConditionOperands) Set(val *SegmentParentConditionOperands) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentParentConditionOperands) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentParentConditionOperands) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentParentConditionOperands(val *SegmentParentConditionOperands) *NullableSegmentParentConditionOperands { - return &NullableSegmentParentConditionOperands{value: val, isSet: true} -} - -func (v NullableSegmentParentConditionOperands) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentParentConditionOperands) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_parent_conditions.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_parent_conditions.go deleted file mode 100644 index 472e246ddb..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_parent_conditions.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentParentConditions The conditions that define which user profiles are included in the segment. Can contain operands and a maximum of 1 level of nested conditions. -type SegmentParentConditions struct { - Operator SegmentConditionOperator `json:"operator" validate:"required"` - Operands []SegmentParentConditionOperands `json:"operands" validate:"required"` -} - -// NewSegmentParentConditions instantiates a new SegmentParentConditions object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSegmentParentConditions(operator SegmentConditionOperator, operands []SegmentParentConditionOperands) *SegmentParentConditions { - this := &SegmentParentConditions{} - this.Operator = operator - this.Operands = operands - return this -} - -// NewSegmentParentConditionsWithDefaults instantiates a new SegmentParentConditions object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSegmentParentConditionsWithDefaults() *SegmentParentConditions { - this := &SegmentParentConditions{} - return this -} - -// GetOperator returns the Operator field value -func (o *SegmentParentConditions) GetOperator() SegmentConditionOperator { - if o == nil { - var ret SegmentConditionOperator - return ret - } - - return o.Operator -} - -// GetOperatorOk returns a tuple with the Operator field value -// and a boolean to check if the value has been set. -func (o *SegmentParentConditions) GetOperatorOk() (*SegmentConditionOperator, bool) { - if o == nil { - return nil, false - } - return &o.Operator, true -} - -// SetOperator sets field value -func (o *SegmentParentConditions) SetOperator(v SegmentConditionOperator) { - o.Operator = v -} - -// GetOperands returns the Operands field value -func (o *SegmentParentConditions) GetOperands() []SegmentParentConditionOperands { - if o == nil { - var ret []SegmentParentConditionOperands - return ret - } - - return o.Operands -} - -// GetOperandsOk returns a tuple with the Operands field value -// and a boolean to check if the value has been set. -func (o *SegmentParentConditions) GetOperandsOk() ([]SegmentParentConditionOperands, bool) { - if o == nil { - return nil, false - } - return o.Operands, true -} - -// SetOperands sets field value -func (o *SegmentParentConditions) SetOperands(v []SegmentParentConditionOperands) { - o.Operands = v -} - -func (o SegmentParentConditions) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["operator"] = o.Operator - } - if true { - toSerialize["operands"] = o.Operands - } - return json.Marshal(toSerialize) -} - -func (o SegmentParentConditions) String() string { - out := "" - out += fmt.Sprintf(" operator=%v\n", o.Operator) - out += fmt.Sprintf(" operands=%v\n", o.Operands) - return fmt.Sprintf("SegmentParentConditions {\n%s}", out) -} - -type NullableSegmentParentConditions struct { - value *SegmentParentConditions - isSet bool -} - -func (v NullableSegmentParentConditions) Get() *SegmentParentConditions { - return v.value -} - -func (v *NullableSegmentParentConditions) Set(val *SegmentParentConditions) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentParentConditions) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentParentConditions) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentParentConditions(val *SegmentParentConditions) *NullableSegmentParentConditions { - return &NullableSegmentParentConditions{value: val, isSet: true} -} - -func (v NullableSegmentParentConditions) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentParentConditions) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_property_filter.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_property_filter.go deleted file mode 100644 index 1a30b2dde3..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_property_filter.go +++ /dev/null @@ -1,154 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentPropertyFilter Filter for user profile properties. -type SegmentPropertyFilter struct { - Operator *SegmentFilterOperatorNumerical `json:"operator,omitempty"` - Value SegmentPropertyFilterValue `json:"value" validate:"required"` -} - -type SegmentPropertyFilterOption func(f *SegmentPropertyFilter) - -func WithSegmentPropertyFilterOperator(val SegmentFilterOperatorNumerical) SegmentPropertyFilterOption { - return func(f *SegmentPropertyFilter) { - f.Operator = &val - } -} - -// NewSegmentPropertyFilter instantiates a new SegmentPropertyFilter object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSegmentPropertyFilter(value SegmentPropertyFilterValue, opts ...SegmentPropertyFilterOption) *SegmentPropertyFilter { - this := &SegmentPropertyFilter{} - this.Value = value - for _, opt := range opts { - opt(this) - } - return this -} - -// NewSegmentPropertyFilterWithDefaults instantiates a new SegmentPropertyFilter object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSegmentPropertyFilterWithDefaults() *SegmentPropertyFilter { - this := &SegmentPropertyFilter{} - var operator SegmentFilterOperatorNumerical = SEGMENTFILTEROPERATORNUMERICAL_EQ - this.Operator = &operator - return this -} - -// GetOperator returns the Operator field value if set, zero value otherwise. -func (o *SegmentPropertyFilter) GetOperator() SegmentFilterOperatorNumerical { - if o == nil || o.Operator == nil { - var ret SegmentFilterOperatorNumerical - return ret - } - return *o.Operator -} - -// GetOperatorOk returns a tuple with the Operator field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SegmentPropertyFilter) GetOperatorOk() (*SegmentFilterOperatorNumerical, bool) { - if o == nil || o.Operator == nil { - return nil, false - } - return o.Operator, true -} - -// HasOperator returns a boolean if a field has been set. -func (o *SegmentPropertyFilter) HasOperator() bool { - if o != nil && o.Operator != nil { - return true - } - - return false -} - -// SetOperator gets a reference to the given SegmentFilterOperatorNumerical and assigns it to the Operator field. -func (o *SegmentPropertyFilter) SetOperator(v SegmentFilterOperatorNumerical) { - o.Operator = &v -} - -// GetValue returns the Value field value -func (o *SegmentPropertyFilter) GetValue() SegmentPropertyFilterValue { - if o == nil { - var ret SegmentPropertyFilterValue - return ret - } - - return o.Value -} - -// GetValueOk returns a tuple with the Value field value -// and a boolean to check if the value has been set. -func (o *SegmentPropertyFilter) GetValueOk() (*SegmentPropertyFilterValue, bool) { - if o == nil { - return nil, false - } - return &o.Value, true -} - -// SetValue sets field value -func (o *SegmentPropertyFilter) SetValue(v SegmentPropertyFilterValue) { - o.Value = v -} - -func (o SegmentPropertyFilter) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if o.Operator != nil { - toSerialize["operator"] = o.Operator - } - if true { - toSerialize["value"] = o.Value - } - return json.Marshal(toSerialize) -} - -func (o SegmentPropertyFilter) String() string { - out := "" - out += fmt.Sprintf(" operator=%v\n", o.Operator) - out += fmt.Sprintf(" value=%v\n", o.Value) - return fmt.Sprintf("SegmentPropertyFilter {\n%s}", out) -} - -type NullableSegmentPropertyFilter struct { - value *SegmentPropertyFilter - isSet bool -} - -func (v NullableSegmentPropertyFilter) Get() *SegmentPropertyFilter { - return v.value -} - -func (v *NullableSegmentPropertyFilter) Set(val *SegmentPropertyFilter) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentPropertyFilter) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentPropertyFilter) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentPropertyFilter(val *SegmentPropertyFilter) *NullableSegmentPropertyFilter { - return &NullableSegmentPropertyFilter{value: val, isSet: true} -} - -func (v NullableSegmentPropertyFilter) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentPropertyFilter) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_property_filter_value.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_property_filter_value.go deleted file mode 100644 index 10ec8509b7..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_property_filter_value.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentPropertyFilterValue struct for SegmentPropertyFilterValue -type SegmentPropertyFilterValue struct { -} - -// NewSegmentPropertyFilterValue instantiates a new SegmentPropertyFilterValue object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSegmentPropertyFilterValue() *SegmentPropertyFilterValue { - this := &SegmentPropertyFilterValue{} - return this -} - -// NewSegmentPropertyFilterValueWithDefaults instantiates a new SegmentPropertyFilterValue object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSegmentPropertyFilterValueWithDefaults() *SegmentPropertyFilterValue { - this := &SegmentPropertyFilterValue{} - return this -} - -func (o SegmentPropertyFilterValue) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - return json.Marshal(toSerialize) -} - -func (o SegmentPropertyFilterValue) String() string { - out := "" - return fmt.Sprintf("SegmentPropertyFilterValue {\n%s}", out) -} - -type NullableSegmentPropertyFilterValue struct { - value *SegmentPropertyFilterValue - isSet bool -} - -func (v NullableSegmentPropertyFilterValue) Get() *SegmentPropertyFilterValue { - return v.value -} - -func (v *NullableSegmentPropertyFilterValue) Set(val *SegmentPropertyFilterValue) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentPropertyFilterValue) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentPropertyFilterValue) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentPropertyFilterValue(val *SegmentPropertyFilterValue) *NullableSegmentPropertyFilterValue { - return &NullableSegmentPropertyFilterValue{value: val, isSet: true} -} - -func (v NullableSegmentPropertyFilterValue) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentPropertyFilterValue) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_status.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_status.go deleted file mode 100644 index 247e504505..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_status.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentStatus The status of the segment. -type SegmentStatus string - -// List of segmentStatus -const ( - SEGMENTSTATUS_ACTIVE SegmentStatus = "active" - SEGMENTSTATUS_PENDING SegmentStatus = "pending" - SEGMENTSTATUS_FAILED SegmentStatus = "failed" -) - -// All allowed values of SegmentStatus enum -var AllowedSegmentStatusEnumValues = []SegmentStatus{ - "active", - "pending", - "failed", -} - -func (v *SegmentStatus) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := SegmentStatus(value) - for _, existing := range AllowedSegmentStatusEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid SegmentStatus", value) -} - -// NewSegmentStatusFromValue returns a pointer to a valid SegmentStatus -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewSegmentStatusFromValue(v string) (*SegmentStatus, error) { - ev := SegmentStatus(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for SegmentStatus: valid values are %v", v, AllowedSegmentStatusEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v SegmentStatus) IsValid() bool { - for _, existing := range AllowedSegmentStatusEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to segmentStatus value -func (v SegmentStatus) Ptr() *SegmentStatus { - return &v -} - -type NullableSegmentStatus struct { - value *SegmentStatus - isSet bool -} - -func (v NullableSegmentStatus) Get() *SegmentStatus { - return v.value -} - -func (v *NullableSegmentStatus) Set(val *SegmentStatus) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentStatus) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentStatus) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentStatus(val *SegmentStatus) *NullableSegmentStatus { - return &NullableSegmentStatus{value: val, isSet: true} -} - -func (v NullableSegmentStatus) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentStatus) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segment_type.go b/clients/algoliasearch-client-go/algolia/predict/model_segment_type.go deleted file mode 100644 index b4355cbac6..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segment_type.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// SegmentType The type of the segment. -type SegmentType string - -// List of segmentType -const ( - SEGMENTTYPE_COMPUTED SegmentType = "computed" - SEGMENTTYPE_CUSTOM SegmentType = "custom" -) - -// All allowed values of SegmentType enum -var AllowedSegmentTypeEnumValues = []SegmentType{ - "computed", - "custom", -} - -func (v *SegmentType) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := SegmentType(value) - for _, existing := range AllowedSegmentTypeEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid SegmentType", value) -} - -// NewSegmentTypeFromValue returns a pointer to a valid SegmentType -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewSegmentTypeFromValue(v string) (*SegmentType, error) { - ev := SegmentType(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for SegmentType: valid values are %v", v, AllowedSegmentTypeEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v SegmentType) IsValid() bool { - for _, existing := range AllowedSegmentTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to segmentType value -func (v SegmentType) Ptr() *SegmentType { - return &v -} - -type NullableSegmentType struct { - value *SegmentType - isSet bool -} - -func (v NullableSegmentType) Get() *SegmentType { - return v.value -} - -func (v *NullableSegmentType) Set(val *SegmentType) { - v.value = val - v.isSet = true -} - -func (v NullableSegmentType) IsSet() bool { - return v.isSet -} - -func (v *NullableSegmentType) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegmentType(val *SegmentType) *NullableSegmentType { - return &NullableSegmentType{value: val, isSet: true} -} - -func (v NullableSegmentType) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegmentType) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_segments.go b/clients/algoliasearch-client-go/algolia/predict/model_segments.go deleted file mode 100644 index 33e04417b9..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_segments.go +++ /dev/null @@ -1,136 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// Segments Segments that the user belongs to. -type Segments struct { - // List of computed segments IDs. - Computed []string `json:"computed" validate:"required"` - // List of custom segments IDs. - Custom []string `json:"custom" validate:"required"` -} - -// NewSegments instantiates a new Segments object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSegments(computed []string, custom []string) *Segments { - this := &Segments{} - this.Computed = computed - this.Custom = custom - return this -} - -// NewSegmentsWithDefaults instantiates a new Segments object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSegmentsWithDefaults() *Segments { - this := &Segments{} - return this -} - -// GetComputed returns the Computed field value -func (o *Segments) GetComputed() []string { - if o == nil { - var ret []string - return ret - } - - return o.Computed -} - -// GetComputedOk returns a tuple with the Computed field value -// and a boolean to check if the value has been set. -func (o *Segments) GetComputedOk() ([]string, bool) { - if o == nil { - return nil, false - } - return o.Computed, true -} - -// SetComputed sets field value -func (o *Segments) SetComputed(v []string) { - o.Computed = v -} - -// GetCustom returns the Custom field value -func (o *Segments) GetCustom() []string { - if o == nil { - var ret []string - return ret - } - - return o.Custom -} - -// GetCustomOk returns a tuple with the Custom field value -// and a boolean to check if the value has been set. -func (o *Segments) GetCustomOk() ([]string, bool) { - if o == nil { - return nil, false - } - return o.Custom, true -} - -// SetCustom sets field value -func (o *Segments) SetCustom(v []string) { - o.Custom = v -} - -func (o Segments) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["computed"] = o.Computed - } - if true { - toSerialize["custom"] = o.Custom - } - return json.Marshal(toSerialize) -} - -func (o Segments) String() string { - out := "" - out += fmt.Sprintf(" computed=%v\n", o.Computed) - out += fmt.Sprintf(" custom=%v\n", o.Custom) - return fmt.Sprintf("Segments {\n%s}", out) -} - -type NullableSegments struct { - value *Segments - isSet bool -} - -func (v NullableSegments) Get() *Segments { - return v.value -} - -func (v *NullableSegments) Set(val *Segments) { - v.value = val - v.isSet = true -} - -func (v NullableSegments) IsSet() bool { - return v.isSet -} - -func (v *NullableSegments) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSegments(val *Segments) *NullableSegments { - return &NullableSegments{value: val, isSet: true} -} - -func (v NullableSegments) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSegments) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_types_to_retrieve.go b/clients/algoliasearch-client-go/algolia/predict/model_types_to_retrieve.go deleted file mode 100644 index 6c20b3a5f2..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_types_to_retrieve.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// TypesToRetrieve the model 'TypesToRetrieve' -type TypesToRetrieve string - -// List of typesToRetrieve -const ( - TYPESTORETRIEVE_PROPERTIES TypesToRetrieve = "properties" - TYPESTORETRIEVE_SEGMENTS TypesToRetrieve = "segments" -) - -// All allowed values of TypesToRetrieve enum -var AllowedTypesToRetrieveEnumValues = []TypesToRetrieve{ - "properties", - "segments", -} - -func (v *TypesToRetrieve) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := TypesToRetrieve(value) - for _, existing := range AllowedTypesToRetrieveEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid TypesToRetrieve", value) -} - -// NewTypesToRetrieveFromValue returns a pointer to a valid TypesToRetrieve -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewTypesToRetrieveFromValue(v string) (*TypesToRetrieve, error) { - ev := TypesToRetrieve(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for TypesToRetrieve: valid values are %v", v, AllowedTypesToRetrieveEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v TypesToRetrieve) IsValid() bool { - for _, existing := range AllowedTypesToRetrieveEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to typesToRetrieve value -func (v TypesToRetrieve) Ptr() *TypesToRetrieve { - return &v -} - -type NullableTypesToRetrieve struct { - value *TypesToRetrieve - isSet bool -} - -func (v NullableTypesToRetrieve) Get() *TypesToRetrieve { - return v.value -} - -func (v *NullableTypesToRetrieve) Set(val *TypesToRetrieve) { - v.value = val - v.isSet = true -} - -func (v NullableTypesToRetrieve) IsSet() bool { - return v.isSet -} - -func (v *NullableTypesToRetrieve) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTypesToRetrieve(val *TypesToRetrieve) *NullableTypesToRetrieve { - return &NullableTypesToRetrieve{value: val, isSet: true} -} - -func (v NullableTypesToRetrieve) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTypesToRetrieve) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_types_to_retrieve_param.go b/clients/algoliasearch-client-go/algolia/predict/model_types_to_retrieve_param.go deleted file mode 100644 index 74562e93cf..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_types_to_retrieve_param.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// TypesToRetrieveParam struct for TypesToRetrieveParam -type TypesToRetrieveParam struct { - TypesToRetrieve []TypesToRetrieve `json:"typesToRetrieve,omitempty"` -} - -type TypesToRetrieveParamOption func(f *TypesToRetrieveParam) - -func WithTypesToRetrieveParamTypesToRetrieve(val []TypesToRetrieve) TypesToRetrieveParamOption { - return func(f *TypesToRetrieveParam) { - f.TypesToRetrieve = val - } -} - -// NewTypesToRetrieveParam instantiates a new TypesToRetrieveParam object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewTypesToRetrieveParam(opts ...TypesToRetrieveParamOption) *TypesToRetrieveParam { - this := &TypesToRetrieveParam{} - for _, opt := range opts { - opt(this) - } - return this -} - -// NewTypesToRetrieveParamWithDefaults instantiates a new TypesToRetrieveParam object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewTypesToRetrieveParamWithDefaults() *TypesToRetrieveParam { - this := &TypesToRetrieveParam{} - return this -} - -// GetTypesToRetrieve returns the TypesToRetrieve field value if set, zero value otherwise. -func (o *TypesToRetrieveParam) GetTypesToRetrieve() []TypesToRetrieve { - if o == nil || o.TypesToRetrieve == nil { - var ret []TypesToRetrieve - return ret - } - return o.TypesToRetrieve -} - -// GetTypesToRetrieveOk returns a tuple with the TypesToRetrieve field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TypesToRetrieveParam) GetTypesToRetrieveOk() ([]TypesToRetrieve, bool) { - if o == nil || o.TypesToRetrieve == nil { - return nil, false - } - return o.TypesToRetrieve, true -} - -// HasTypesToRetrieve returns a boolean if a field has been set. -func (o *TypesToRetrieveParam) HasTypesToRetrieve() bool { - if o != nil && o.TypesToRetrieve != nil { - return true - } - - return false -} - -// SetTypesToRetrieve gets a reference to the given []TypesToRetrieve and assigns it to the TypesToRetrieve field. -func (o *TypesToRetrieveParam) SetTypesToRetrieve(v []TypesToRetrieve) { - o.TypesToRetrieve = v -} - -func (o TypesToRetrieveParam) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if o.TypesToRetrieve != nil { - toSerialize["typesToRetrieve"] = o.TypesToRetrieve - } - return json.Marshal(toSerialize) -} - -func (o TypesToRetrieveParam) String() string { - out := "" - out += fmt.Sprintf(" typesToRetrieve=%v\n", o.TypesToRetrieve) - return fmt.Sprintf("TypesToRetrieveParam {\n%s}", out) -} - -type NullableTypesToRetrieveParam struct { - value *TypesToRetrieveParam - isSet bool -} - -func (v NullableTypesToRetrieveParam) Get() *TypesToRetrieveParam { - return v.value -} - -func (v *NullableTypesToRetrieveParam) Set(val *TypesToRetrieveParam) { - v.value = val - v.isSet = true -} - -func (v NullableTypesToRetrieveParam) IsSet() bool { - return v.isSet -} - -func (v *NullableTypesToRetrieveParam) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTypesToRetrieveParam(val *TypesToRetrieveParam) *NullableTypesToRetrieveParam { - return &NullableTypesToRetrieveParam{value: val, isSet: true} -} - -func (v NullableTypesToRetrieveParam) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTypesToRetrieveParam) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_update_model_instance_response.go b/clients/algoliasearch-client-go/algolia/predict/model_update_model_instance_response.go deleted file mode 100644 index d64d7d33b0..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_update_model_instance_response.go +++ /dev/null @@ -1,136 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// UpdateModelInstanceResponse struct for UpdateModelInstanceResponse -type UpdateModelInstanceResponse struct { - // The ID of the model. - ModelID string `json:"modelID" validate:"required"` - // Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - UpdatedAt string `json:"updatedAt" validate:"required"` -} - -// NewUpdateModelInstanceResponse instantiates a new UpdateModelInstanceResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewUpdateModelInstanceResponse(modelID string, updatedAt string) *UpdateModelInstanceResponse { - this := &UpdateModelInstanceResponse{} - this.ModelID = modelID - this.UpdatedAt = updatedAt - return this -} - -// NewUpdateModelInstanceResponseWithDefaults instantiates a new UpdateModelInstanceResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUpdateModelInstanceResponseWithDefaults() *UpdateModelInstanceResponse { - this := &UpdateModelInstanceResponse{} - return this -} - -// GetModelID returns the ModelID field value -func (o *UpdateModelInstanceResponse) GetModelID() string { - if o == nil { - var ret string - return ret - } - - return o.ModelID -} - -// GetModelIDOk returns a tuple with the ModelID field value -// and a boolean to check if the value has been set. -func (o *UpdateModelInstanceResponse) GetModelIDOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ModelID, true -} - -// SetModelID sets field value -func (o *UpdateModelInstanceResponse) SetModelID(v string) { - o.ModelID = v -} - -// GetUpdatedAt returns the UpdatedAt field value -func (o *UpdateModelInstanceResponse) GetUpdatedAt() string { - if o == nil { - var ret string - return ret - } - - return o.UpdatedAt -} - -// GetUpdatedAtOk returns a tuple with the UpdatedAt field value -// and a boolean to check if the value has been set. -func (o *UpdateModelInstanceResponse) GetUpdatedAtOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UpdatedAt, true -} - -// SetUpdatedAt sets field value -func (o *UpdateModelInstanceResponse) SetUpdatedAt(v string) { - o.UpdatedAt = v -} - -func (o UpdateModelInstanceResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["modelID"] = o.ModelID - } - if true { - toSerialize["updatedAt"] = o.UpdatedAt - } - return json.Marshal(toSerialize) -} - -func (o UpdateModelInstanceResponse) String() string { - out := "" - out += fmt.Sprintf(" modelID=%v\n", o.ModelID) - out += fmt.Sprintf(" updatedAt=%v\n", o.UpdatedAt) - return fmt.Sprintf("UpdateModelInstanceResponse {\n%s}", out) -} - -type NullableUpdateModelInstanceResponse struct { - value *UpdateModelInstanceResponse - isSet bool -} - -func (v NullableUpdateModelInstanceResponse) Get() *UpdateModelInstanceResponse { - return v.value -} - -func (v *NullableUpdateModelInstanceResponse) Set(val *UpdateModelInstanceResponse) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateModelInstanceResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateModelInstanceResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateModelInstanceResponse(val *UpdateModelInstanceResponse) *NullableUpdateModelInstanceResponse { - return &NullableUpdateModelInstanceResponse{value: val, isSet: true} -} - -func (v NullableUpdateModelInstanceResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateModelInstanceResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_update_model_params.go b/clients/algoliasearch-client-go/algolia/predict/model_update_model_params.go deleted file mode 100644 index df5990e375..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_update_model_params.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// UpdateModelParams struct for UpdateModelParams -type UpdateModelParams struct { - // The model’s instance name. - Name *string `json:"name,omitempty"` - ModelAttributes []string `json:"modelAttributes,omitempty"` - ModelStatus *ModelStatus `json:"modelStatus,omitempty"` -} - -type UpdateModelParamsOption func(f *UpdateModelParams) - -func WithUpdateModelParamsName(val string) UpdateModelParamsOption { - return func(f *UpdateModelParams) { - f.Name = &val - } -} - -func WithUpdateModelParamsModelAttributes(val []string) UpdateModelParamsOption { - return func(f *UpdateModelParams) { - f.ModelAttributes = val - } -} - -func WithUpdateModelParamsModelStatus(val ModelStatus) UpdateModelParamsOption { - return func(f *UpdateModelParams) { - f.ModelStatus = &val - } -} - -// NewUpdateModelParams instantiates a new UpdateModelParams object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewUpdateModelParams(opts ...UpdateModelParamsOption) *UpdateModelParams { - this := &UpdateModelParams{} - for _, opt := range opts { - opt(this) - } - return this -} - -// NewUpdateModelParamsWithDefaults instantiates a new UpdateModelParams object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUpdateModelParamsWithDefaults() *UpdateModelParams { - this := &UpdateModelParams{} - return this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateModelParams) GetName() string { - if o == nil || o.Name == nil { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateModelParams) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *UpdateModelParams) HasName() bool { - if o != nil && o.Name != nil { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *UpdateModelParams) SetName(v string) { - o.Name = &v -} - -// GetModelAttributes returns the ModelAttributes field value if set, zero value otherwise. -func (o *UpdateModelParams) GetModelAttributes() []string { - if o == nil || o.ModelAttributes == nil { - var ret []string - return ret - } - return o.ModelAttributes -} - -// GetModelAttributesOk returns a tuple with the ModelAttributes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateModelParams) GetModelAttributesOk() ([]string, bool) { - if o == nil || o.ModelAttributes == nil { - return nil, false - } - return o.ModelAttributes, true -} - -// HasModelAttributes returns a boolean if a field has been set. -func (o *UpdateModelParams) HasModelAttributes() bool { - if o != nil && o.ModelAttributes != nil { - return true - } - - return false -} - -// SetModelAttributes gets a reference to the given []string and assigns it to the ModelAttributes field. -func (o *UpdateModelParams) SetModelAttributes(v []string) { - o.ModelAttributes = v -} - -// GetModelStatus returns the ModelStatus field value if set, zero value otherwise. -func (o *UpdateModelParams) GetModelStatus() ModelStatus { - if o == nil || o.ModelStatus == nil { - var ret ModelStatus - return ret - } - return *o.ModelStatus -} - -// GetModelStatusOk returns a tuple with the ModelStatus field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateModelParams) GetModelStatusOk() (*ModelStatus, bool) { - if o == nil || o.ModelStatus == nil { - return nil, false - } - return o.ModelStatus, true -} - -// HasModelStatus returns a boolean if a field has been set. -func (o *UpdateModelParams) HasModelStatus() bool { - if o != nil && o.ModelStatus != nil { - return true - } - - return false -} - -// SetModelStatus gets a reference to the given ModelStatus and assigns it to the ModelStatus field. -func (o *UpdateModelParams) SetModelStatus(v ModelStatus) { - o.ModelStatus = &v -} - -func (o UpdateModelParams) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if o.Name != nil { - toSerialize["name"] = o.Name - } - if o.ModelAttributes != nil { - toSerialize["modelAttributes"] = o.ModelAttributes - } - if o.ModelStatus != nil { - toSerialize["modelStatus"] = o.ModelStatus - } - return json.Marshal(toSerialize) -} - -func (o UpdateModelParams) String() string { - out := "" - out += fmt.Sprintf(" name=%v\n", o.Name) - out += fmt.Sprintf(" modelAttributes=%v\n", o.ModelAttributes) - out += fmt.Sprintf(" modelStatus=%v\n", o.ModelStatus) - return fmt.Sprintf("UpdateModelParams {\n%s}", out) -} - -type NullableUpdateModelParams struct { - value *UpdateModelParams - isSet bool -} - -func (v NullableUpdateModelParams) Get() *UpdateModelParams { - return v.value -} - -func (v *NullableUpdateModelParams) Set(val *UpdateModelParams) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateModelParams) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateModelParams) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateModelParams(val *UpdateModelParams) *NullableUpdateModelParams { - return &NullableUpdateModelParams{value: val, isSet: true} -} - -func (v NullableUpdateModelParams) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateModelParams) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_update_segment_params.go b/clients/algoliasearch-client-go/algolia/predict/model_update_segment_params.go deleted file mode 100644 index ebc385d3f9..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_update_segment_params.go +++ /dev/null @@ -1,154 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// UpdateSegmentParams - struct for UpdateSegmentParams -type UpdateSegmentParams struct { - AllUpdateSegmentParams *AllUpdateSegmentParams - SegmentConditionsParam *SegmentConditionsParam - SegmentNameParam *SegmentNameParam -} - -// AllUpdateSegmentParamsAsUpdateSegmentParams is a convenience function that returns AllUpdateSegmentParams wrapped in UpdateSegmentParams -func AllUpdateSegmentParamsAsUpdateSegmentParams(v *AllUpdateSegmentParams) UpdateSegmentParams { - return UpdateSegmentParams{ - AllUpdateSegmentParams: v, - } -} - -// SegmentConditionsParamAsUpdateSegmentParams is a convenience function that returns SegmentConditionsParam wrapped in UpdateSegmentParams -func SegmentConditionsParamAsUpdateSegmentParams(v *SegmentConditionsParam) UpdateSegmentParams { - return UpdateSegmentParams{ - SegmentConditionsParam: v, - } -} - -// SegmentNameParamAsUpdateSegmentParams is a convenience function that returns SegmentNameParam wrapped in UpdateSegmentParams -func SegmentNameParamAsUpdateSegmentParams(v *SegmentNameParam) UpdateSegmentParams { - return UpdateSegmentParams{ - SegmentNameParam: v, - } -} - -// Unmarshal JSON data into one of the pointers in the struct -func (dst *UpdateSegmentParams) UnmarshalJSON(data []byte) error { - var err error - // try to unmarshal data into AllUpdateSegmentParams - err = newStrictDecoder(data).Decode(&dst.AllUpdateSegmentParams) - if err == nil && validateStruct(dst.AllUpdateSegmentParams) == nil { - jsonAllUpdateSegmentParams, _ := json.Marshal(dst.AllUpdateSegmentParams) - if string(jsonAllUpdateSegmentParams) == "{}" { // empty struct - dst.AllUpdateSegmentParams = nil - } else { - return nil - } - } else { - dst.AllUpdateSegmentParams = nil - } - - // try to unmarshal data into SegmentConditionsParam - err = newStrictDecoder(data).Decode(&dst.SegmentConditionsParam) - if err == nil && validateStruct(dst.SegmentConditionsParam) == nil { - jsonSegmentConditionsParam, _ := json.Marshal(dst.SegmentConditionsParam) - if string(jsonSegmentConditionsParam) == "{}" { // empty struct - dst.SegmentConditionsParam = nil - } else { - return nil - } - } else { - dst.SegmentConditionsParam = nil - } - - // try to unmarshal data into SegmentNameParam - err = newStrictDecoder(data).Decode(&dst.SegmentNameParam) - if err == nil && validateStruct(dst.SegmentNameParam) == nil { - jsonSegmentNameParam, _ := json.Marshal(dst.SegmentNameParam) - if string(jsonSegmentNameParam) == "{}" { // empty struct - dst.SegmentNameParam = nil - } else { - return nil - } - } else { - dst.SegmentNameParam = nil - } - - return fmt.Errorf("Data failed to match schemas in oneOf(UpdateSegmentParams)") -} - -// Marshal data from the first non-nil pointers in the struct to JSON -func (src UpdateSegmentParams) MarshalJSON() ([]byte, error) { - if src.AllUpdateSegmentParams != nil { - return json.Marshal(&src.AllUpdateSegmentParams) - } - - if src.SegmentConditionsParam != nil { - return json.Marshal(&src.SegmentConditionsParam) - } - - if src.SegmentNameParam != nil { - return json.Marshal(&src.SegmentNameParam) - } - - return nil, nil // no data in oneOf schemas -} - -// Get the actual instance -func (obj *UpdateSegmentParams) GetActualInstance() any { - if obj == nil { - return nil - } - if obj.AllUpdateSegmentParams != nil { - return obj.AllUpdateSegmentParams - } - - if obj.SegmentConditionsParam != nil { - return obj.SegmentConditionsParam - } - - if obj.SegmentNameParam != nil { - return obj.SegmentNameParam - } - - // all schemas are nil - return nil -} - -type NullableUpdateSegmentParams struct { - value *UpdateSegmentParams - isSet bool -} - -func (v NullableUpdateSegmentParams) Get() *UpdateSegmentParams { - return v.value -} - -func (v *NullableUpdateSegmentParams) Set(val *UpdateSegmentParams) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateSegmentParams) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateSegmentParams) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateSegmentParams(val *UpdateSegmentParams) *NullableUpdateSegmentParams { - return &NullableUpdateSegmentParams{value: val, isSet: true} -} - -func (v NullableUpdateSegmentParams) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateSegmentParams) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_update_segment_response.go b/clients/algoliasearch-client-go/algolia/predict/model_update_segment_response.go deleted file mode 100644 index 3ef5ac1267..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_update_segment_response.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// UpdateSegmentResponse struct for UpdateSegmentResponse -type UpdateSegmentResponse struct { - // The ID of the segment. - SegmentID string `json:"segmentID" validate:"required"` - // The approximate number of users that matched the segment conditions when it was created, last updated, or when model inference last ran. - Size *float32 `json:"size,omitempty"` - // The date and time at which the segment was updated (RFC3339). - UpdatedAt string `json:"updatedAt" validate:"required"` -} - -type UpdateSegmentResponseOption func(f *UpdateSegmentResponse) - -func WithUpdateSegmentResponseSize(val float32) UpdateSegmentResponseOption { - return func(f *UpdateSegmentResponse) { - f.Size = &val - } -} - -// NewUpdateSegmentResponse instantiates a new UpdateSegmentResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewUpdateSegmentResponse(segmentID string, updatedAt string, opts ...UpdateSegmentResponseOption) *UpdateSegmentResponse { - this := &UpdateSegmentResponse{} - this.SegmentID = segmentID - this.UpdatedAt = updatedAt - for _, opt := range opts { - opt(this) - } - return this -} - -// NewUpdateSegmentResponseWithDefaults instantiates a new UpdateSegmentResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUpdateSegmentResponseWithDefaults() *UpdateSegmentResponse { - this := &UpdateSegmentResponse{} - return this -} - -// GetSegmentID returns the SegmentID field value -func (o *UpdateSegmentResponse) GetSegmentID() string { - if o == nil { - var ret string - return ret - } - - return o.SegmentID -} - -// GetSegmentIDOk returns a tuple with the SegmentID field value -// and a boolean to check if the value has been set. -func (o *UpdateSegmentResponse) GetSegmentIDOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.SegmentID, true -} - -// SetSegmentID sets field value -func (o *UpdateSegmentResponse) SetSegmentID(v string) { - o.SegmentID = v -} - -// GetSize returns the Size field value if set, zero value otherwise. -func (o *UpdateSegmentResponse) GetSize() float32 { - if o == nil || o.Size == nil { - var ret float32 - return ret - } - return *o.Size -} - -// GetSizeOk returns a tuple with the Size field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateSegmentResponse) GetSizeOk() (*float32, bool) { - if o == nil || o.Size == nil { - return nil, false - } - return o.Size, true -} - -// HasSize returns a boolean if a field has been set. -func (o *UpdateSegmentResponse) HasSize() bool { - if o != nil && o.Size != nil { - return true - } - - return false -} - -// SetSize gets a reference to the given float32 and assigns it to the Size field. -func (o *UpdateSegmentResponse) SetSize(v float32) { - o.Size = &v -} - -// GetUpdatedAt returns the UpdatedAt field value -func (o *UpdateSegmentResponse) GetUpdatedAt() string { - if o == nil { - var ret string - return ret - } - - return o.UpdatedAt -} - -// GetUpdatedAtOk returns a tuple with the UpdatedAt field value -// and a boolean to check if the value has been set. -func (o *UpdateSegmentResponse) GetUpdatedAtOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UpdatedAt, true -} - -// SetUpdatedAt sets field value -func (o *UpdateSegmentResponse) SetUpdatedAt(v string) { - o.UpdatedAt = v -} - -func (o UpdateSegmentResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["segmentID"] = o.SegmentID - } - if o.Size != nil { - toSerialize["size"] = o.Size - } - if true { - toSerialize["updatedAt"] = o.UpdatedAt - } - return json.Marshal(toSerialize) -} - -func (o UpdateSegmentResponse) String() string { - out := "" - out += fmt.Sprintf(" segmentID=%v\n", o.SegmentID) - out += fmt.Sprintf(" size=%v\n", o.Size) - out += fmt.Sprintf(" updatedAt=%v\n", o.UpdatedAt) - return fmt.Sprintf("UpdateSegmentResponse {\n%s}", out) -} - -type NullableUpdateSegmentResponse struct { - value *UpdateSegmentResponse - isSet bool -} - -func (v NullableUpdateSegmentResponse) Get() *UpdateSegmentResponse { - return v.value -} - -func (v *NullableUpdateSegmentResponse) Set(val *UpdateSegmentResponse) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateSegmentResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateSegmentResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateSegmentResponse(val *UpdateSegmentResponse) *NullableUpdateSegmentResponse { - return &NullableUpdateSegmentResponse{value: val, isSet: true} -} - -func (v NullableUpdateSegmentResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateSegmentResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/model_user_profile.go b/clients/algoliasearch-client-go/algolia/predict/model_user_profile.go deleted file mode 100644 index 196d7a6d5b..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/model_user_profile.go +++ /dev/null @@ -1,238 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -package predict - -import ( - "encoding/json" - "fmt" -) - -// UserProfile struct for UserProfile -type UserProfile struct { - User string `json:"user" validate:"required"` - Predictions *Predictions `json:"predictions,omitempty"` - Properties *Properties `json:"properties,omitempty"` - Segments *Segments `json:"segments,omitempty"` -} - -type UserProfileOption func(f *UserProfile) - -func WithUserProfilePredictions(val Predictions) UserProfileOption { - return func(f *UserProfile) { - f.Predictions = &val - } -} - -func WithUserProfileProperties(val Properties) UserProfileOption { - return func(f *UserProfile) { - f.Properties = &val - } -} - -func WithUserProfileSegments(val Segments) UserProfileOption { - return func(f *UserProfile) { - f.Segments = &val - } -} - -// NewUserProfile instantiates a new UserProfile object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewUserProfile(user string, opts ...UserProfileOption) *UserProfile { - this := &UserProfile{} - this.User = user - for _, opt := range opts { - opt(this) - } - return this -} - -// NewUserProfileWithDefaults instantiates a new UserProfile object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUserProfileWithDefaults() *UserProfile { - this := &UserProfile{} - return this -} - -// GetUser returns the User field value -func (o *UserProfile) GetUser() string { - if o == nil { - var ret string - return ret - } - - return o.User -} - -// GetUserOk returns a tuple with the User field value -// and a boolean to check if the value has been set. -func (o *UserProfile) GetUserOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.User, true -} - -// SetUser sets field value -func (o *UserProfile) SetUser(v string) { - o.User = v -} - -// GetPredictions returns the Predictions field value if set, zero value otherwise. -func (o *UserProfile) GetPredictions() Predictions { - if o == nil || o.Predictions == nil { - var ret Predictions - return ret - } - return *o.Predictions -} - -// GetPredictionsOk returns a tuple with the Predictions field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UserProfile) GetPredictionsOk() (*Predictions, bool) { - if o == nil || o.Predictions == nil { - return nil, false - } - return o.Predictions, true -} - -// HasPredictions returns a boolean if a field has been set. -func (o *UserProfile) HasPredictions() bool { - if o != nil && o.Predictions != nil { - return true - } - - return false -} - -// SetPredictions gets a reference to the given Predictions and assigns it to the Predictions field. -func (o *UserProfile) SetPredictions(v Predictions) { - o.Predictions = &v -} - -// GetProperties returns the Properties field value if set, zero value otherwise. -func (o *UserProfile) GetProperties() Properties { - if o == nil || o.Properties == nil { - var ret Properties - return ret - } - return *o.Properties -} - -// GetPropertiesOk returns a tuple with the Properties field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UserProfile) GetPropertiesOk() (*Properties, bool) { - if o == nil || o.Properties == nil { - return nil, false - } - return o.Properties, true -} - -// HasProperties returns a boolean if a field has been set. -func (o *UserProfile) HasProperties() bool { - if o != nil && o.Properties != nil { - return true - } - - return false -} - -// SetProperties gets a reference to the given Properties and assigns it to the Properties field. -func (o *UserProfile) SetProperties(v Properties) { - o.Properties = &v -} - -// GetSegments returns the Segments field value if set, zero value otherwise. -func (o *UserProfile) GetSegments() Segments { - if o == nil || o.Segments == nil { - var ret Segments - return ret - } - return *o.Segments -} - -// GetSegmentsOk returns a tuple with the Segments field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UserProfile) GetSegmentsOk() (*Segments, bool) { - if o == nil || o.Segments == nil { - return nil, false - } - return o.Segments, true -} - -// HasSegments returns a boolean if a field has been set. -func (o *UserProfile) HasSegments() bool { - if o != nil && o.Segments != nil { - return true - } - - return false -} - -// SetSegments gets a reference to the given Segments and assigns it to the Segments field. -func (o *UserProfile) SetSegments(v Segments) { - o.Segments = &v -} - -func (o UserProfile) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["user"] = o.User - } - if o.Predictions != nil { - toSerialize["predictions"] = o.Predictions - } - if o.Properties != nil { - toSerialize["properties"] = o.Properties - } - if o.Segments != nil { - toSerialize["segments"] = o.Segments - } - return json.Marshal(toSerialize) -} - -func (o UserProfile) String() string { - out := "" - out += fmt.Sprintf(" user=%v\n", o.User) - out += fmt.Sprintf(" predictions=%v\n", o.Predictions) - out += fmt.Sprintf(" properties=%v\n", o.Properties) - out += fmt.Sprintf(" segments=%v\n", o.Segments) - return fmt.Sprintf("UserProfile {\n%s}", out) -} - -type NullableUserProfile struct { - value *UserProfile - isSet bool -} - -func (v NullableUserProfile) Get() *UserProfile { - return v.value -} - -func (v *NullableUserProfile) Set(val *UserProfile) { - v.value = val - v.isSet = true -} - -func (v NullableUserProfile) IsSet() bool { - return v.isSet -} - -func (v *NullableUserProfile) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUserProfile(val *UserProfile) *NullableUserProfile { - return &NullableUserProfile{value: val, isSet: true} -} - -func (v NullableUserProfile) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUserProfile) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/clients/algoliasearch-client-go/algolia/predict/response.go b/clients/algoliasearch-client-go/algolia/predict/response.go deleted file mode 100644 index 35ce1cb768..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/response.go +++ /dev/null @@ -1,47 +0,0 @@ -/* -Predict API - -API powering the Predict feature of Algolia. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package predict - -import ( - "net/http" -) - -// APIResponse stores the API response returned by the server. -type APIResponse struct { - *http.Response `json:"-"` - Message string `json:"message,omitempty"` - // Operation is the name of the OpenAPI operation. - Operation string `json:"operation,omitempty"` - // RequestURL is the request URL. This value is always available, even if the - // embedded *http.Response is nil. - RequestURL string `json:"url,omitempty"` - // Method is the HTTP method used for the request. This value is always - // available, even if the embedded *http.Response is nil. - Method string `json:"method,omitempty"` - // Payload holds the contents of the response body (which may be nil or empty). - // This is provided here as the raw response.Body() reader will have already - // been drained. - Payload []byte `json:"-"` -} - -// NewAPIResponse returns a new APIResponse object. -func NewAPIResponse(r *http.Response) *APIResponse { - - response := &APIResponse{Response: r} - return response -} - -// NewAPIResponseWithError returns a new APIResponse object with the provided error message. -func NewAPIResponseWithError(errorMessage string) *APIResponse { - - response := &APIResponse{Message: errorMessage} - return response -} diff --git a/clients/algoliasearch-client-go/algolia/predict/utils.go b/clients/algoliasearch-client-go/algolia/predict/utils.go deleted file mode 100644 index 0e4f1ceb60..0000000000 --- a/clients/algoliasearch-client-go/algolia/predict/utils.go +++ /dev/null @@ -1,344 +0,0 @@ -/* -Predict API - -API powering the Predict feature of Algolia. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package predict - -import ( - "encoding/json" - "reflect" - "time" -) - -// PtrBool is a helper routine that returns a pointer to given boolean value. -func PtrBool(v bool) *bool { return &v } - -// PtrInt is a helper routine that returns a pointer to given integer value. -func PtrInt(v int) *int { return &v } - -// PtrInt32 is a helper routine that returns a pointer to given integer value. -func PtrInt32(v int32) *int32 { return &v } - -// PtrInt64 is a helper routine that returns a pointer to given integer value. -func PtrInt64(v int64) *int64 { return &v } - -// PtrFloat32 is a helper routine that returns a pointer to given float value. -func PtrFloat32(v float32) *float32 { return &v } - -// PtrFloat64 is a helper routine that returns a pointer to given float value. -func PtrFloat64(v float64) *float64 { return &v } - -// PtrString is a helper routine that returns a pointer to given string value. -func PtrString(v string) *string { return &v } - -// PtrTime is helper routine that returns a pointer to given Time value. -func PtrTime(v time.Time) *time.Time { return &v } - -type NullableBool struct { - value *bool - isSet bool -} - -func (v NullableBool) Get() *bool { - return v.value -} - -func (v *NullableBool) Set(val *bool) { - v.value = val - v.isSet = true -} - -func (v NullableBool) IsSet() bool { - return v.isSet -} - -func (v *NullableBool) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBool(val *bool) *NullableBool { - return &NullableBool{value: val, isSet: true} -} - -func (v NullableBool) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBool) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt struct { - value *int - isSet bool -} - -func (v NullableInt) Get() *int { - return v.value -} - -func (v *NullableInt) Set(val *int) { - v.value = val - v.isSet = true -} - -func (v NullableInt) IsSet() bool { - return v.isSet -} - -func (v *NullableInt) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt(val *int) *NullableInt { - return &NullableInt{value: val, isSet: true} -} - -func (v NullableInt) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt32 struct { - value *int32 - isSet bool -} - -func (v NullableInt32) Get() *int32 { - return v.value -} - -func (v *NullableInt32) Set(val *int32) { - v.value = val - v.isSet = true -} - -func (v NullableInt32) IsSet() bool { - return v.isSet -} - -func (v *NullableInt32) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt32(val *int32) *NullableInt32 { - return &NullableInt32{value: val, isSet: true} -} - -func (v NullableInt32) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt32) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt64 struct { - value *int64 - isSet bool -} - -func (v NullableInt64) Get() *int64 { - return v.value -} - -func (v *NullableInt64) Set(val *int64) { - v.value = val - v.isSet = true -} - -func (v NullableInt64) IsSet() bool { - return v.isSet -} - -func (v *NullableInt64) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt64(val *int64) *NullableInt64 { - return &NullableInt64{value: val, isSet: true} -} - -func (v NullableInt64) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt64) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableFloat32 struct { - value *float32 - isSet bool -} - -func (v NullableFloat32) Get() *float32 { - return v.value -} - -func (v *NullableFloat32) Set(val *float32) { - v.value = val - v.isSet = true -} - -func (v NullableFloat32) IsSet() bool { - return v.isSet -} - -func (v *NullableFloat32) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFloat32(val *float32) *NullableFloat32 { - return &NullableFloat32{value: val, isSet: true} -} - -func (v NullableFloat32) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFloat32) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableFloat64 struct { - value *float64 - isSet bool -} - -func (v NullableFloat64) Get() *float64 { - return v.value -} - -func (v *NullableFloat64) Set(val *float64) { - v.value = val - v.isSet = true -} - -func (v NullableFloat64) IsSet() bool { - return v.isSet -} - -func (v *NullableFloat64) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFloat64(val *float64) *NullableFloat64 { - return &NullableFloat64{value: val, isSet: true} -} - -func (v NullableFloat64) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFloat64) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableString struct { - value *string - isSet bool -} - -func (v NullableString) Get() *string { - return v.value -} - -func (v *NullableString) Set(val *string) { - v.value = val - v.isSet = true -} - -func (v NullableString) IsSet() bool { - return v.isSet -} - -func (v *NullableString) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableString(val *string) *NullableString { - return &NullableString{value: val, isSet: true} -} - -func (v NullableString) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableString) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableTime struct { - value *time.Time - isSet bool -} - -func (v NullableTime) Get() *time.Time { - return v.value -} - -func (v *NullableTime) Set(val *time.Time) { - v.value = val - v.isSet = true -} - -func (v NullableTime) IsSet() bool { - return v.isSet -} - -func (v *NullableTime) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTime(val *time.Time) *NullableTime { - return &NullableTime{value: val, isSet: true} -} - -func (v NullableTime) MarshalJSON() ([]byte, error) { - return v.value.MarshalJSON() -} - -func (v *NullableTime) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -// isNilorEmpty checks if an input is nil or empty -func isNilorEmpty(i any) bool { - if i == nil { - return true - } - switch reflect.TypeOf(i).Kind() { - case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: - return reflect.ValueOf(i).IsNil() - case reflect.Bool: - return false - default: - return reflect.ValueOf(i).IsZero() - } -} diff --git a/clients/algoliasearch-client-javascript/bundlesize.config.json b/clients/algoliasearch-client-javascript/bundlesize.config.json index 4ef5c34a87..a9e5fa10d0 100644 --- a/clients/algoliasearch-client-javascript/bundlesize.config.json +++ b/clients/algoliasearch-client-javascript/bundlesize.config.json @@ -40,10 +40,6 @@ "path": "packages/monitoring/dist/monitoring.umd.js", "maxSize": "3.90KB" }, - { - "path": "packages/predict/dist/predict.umd.js", - "maxSize": "4.20KB" - }, { "path": "packages/recommend/dist/recommend.umd.js", "maxSize": "3.70KB" diff --git a/clients/algoliasearch-client-javascript/packages/predict/builds/browser.ts b/clients/algoliasearch-client-javascript/packages/predict/builds/browser.ts deleted file mode 100644 index 85cc46ad32..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/builds/browser.ts +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by 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 type { ClientOptions } from '@algolia/client-common'; -import { - DEFAULT_CONNECT_TIMEOUT_BROWSER, - DEFAULT_READ_TIMEOUT_BROWSER, - DEFAULT_WRITE_TIMEOUT_BROWSER, - createMemoryCache, - createFallbackableCache, - createBrowserLocalStorageCache, -} from '@algolia/client-common'; -import { createXhrRequester } from '@algolia/requester-browser-xhr'; - -import type { PredictClient, Region } from '../src/predictClient'; -import { - createPredictClient, - apiClientVersion, - REGIONS, -} from '../src/predictClient'; - -export { apiClientVersion, PredictClient, Region } from '../src/predictClient'; -export * from '../model'; - -export function predictClient( - appId: string, - apiKey: string, - region: Region, - options?: ClientOptions -): PredictClient { - if (!appId || typeof appId !== 'string') { - throw new Error('`appId` is missing.'); - } - - if (!apiKey || typeof apiKey !== 'string') { - throw new Error('`apiKey` is missing.'); - } - - if ( - !region || - (region && (typeof region !== 'string' || !REGIONS.includes(region))) - ) { - throw new Error( - `\`region\` is required and must be one of the following: ${REGIONS.join( - ', ' - )}` - ); - } - - return createPredictClient({ - appId, - apiKey, - region, - timeouts: { - connect: DEFAULT_CONNECT_TIMEOUT_BROWSER, - read: DEFAULT_READ_TIMEOUT_BROWSER, - write: DEFAULT_WRITE_TIMEOUT_BROWSER, - }, - requester: createXhrRequester(), - algoliaAgents: [{ segment: 'Browser' }], - authMode: 'WithinQueryParameters', - responsesCache: createMemoryCache(), - requestsCache: createMemoryCache({ serializable: false }), - hostsCache: createFallbackableCache({ - caches: [ - createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), - createMemoryCache(), - ], - }), - ...options, - }); -} diff --git a/clients/algoliasearch-client-javascript/packages/predict/builds/node.ts b/clients/algoliasearch-client-javascript/packages/predict/builds/node.ts deleted file mode 100644 index 85fd564726..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/builds/node.ts +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by 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 type { ClientOptions } from '@algolia/client-common'; -import { - DEFAULT_CONNECT_TIMEOUT_NODE, - DEFAULT_READ_TIMEOUT_NODE, - DEFAULT_WRITE_TIMEOUT_NODE, - createMemoryCache, - createNullCache, -} from '@algolia/client-common'; -import { createHttpRequester } from '@algolia/requester-node-http'; - -import type { PredictClient, Region } from '../src/predictClient'; -import { createPredictClient, REGIONS } from '../src/predictClient'; - -export { apiClientVersion, PredictClient, Region } from '../src/predictClient'; -export * from '../model'; - -export function predictClient( - appId: string, - apiKey: string, - region: Region, - options?: ClientOptions -): PredictClient { - if (!appId || typeof appId !== 'string') { - throw new Error('`appId` is missing.'); - } - - if (!apiKey || typeof apiKey !== 'string') { - throw new Error('`apiKey` is missing.'); - } - - if ( - !region || - (region && (typeof region !== 'string' || !REGIONS.includes(region))) - ) { - throw new Error( - `\`region\` is required and must be one of the following: ${REGIONS.join( - ', ' - )}` - ); - } - - return createPredictClient({ - appId, - apiKey, - region, - timeouts: { - connect: DEFAULT_CONNECT_TIMEOUT_NODE, - read: DEFAULT_READ_TIMEOUT_NODE, - write: DEFAULT_WRITE_TIMEOUT_NODE, - }, - requester: createHttpRequester(), - algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }], - responsesCache: createNullCache(), - requestsCache: createNullCache(), - hostsCache: createMemoryCache(), - ...options, - }); -} diff --git a/clients/algoliasearch-client-javascript/packages/predict/index.d.ts b/clients/algoliasearch-client-javascript/packages/predict/index.d.ts deleted file mode 100644 index 8b0a7c887a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line import/no-unresolved -export * from './dist/builds/node'; diff --git a/clients/algoliasearch-client-javascript/packages/predict/index.js b/clients/algoliasearch-client-javascript/packages/predict/index.js deleted file mode 100644 index 7627ec4c4a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/index.js +++ /dev/null @@ -1,2 +0,0 @@ -// eslint-disable-next-line import/no-commonjs,import/extensions -module.exports = require('./dist/predict.cjs.js'); diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/activateModelInstanceResponse.ts b/clients/algoliasearch-client-javascript/packages/predict/model/activateModelInstanceResponse.ts deleted file mode 100644 index fc95633603..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/activateModelInstanceResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -export type ActivateModelInstanceResponse = { - /** - * The ID of the model. - */ - modelID: string; - - /** - * Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - */ - updatedAt: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/activateModelParams.ts b/clients/algoliasearch-client-javascript/packages/predict/model/activateModelParams.ts deleted file mode 100644 index 03d59eb0cb..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/activateModelParams.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by 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 type { ModelsToRetrieve } from './modelsToRetrieve'; - -export type ActivateModelParams = { - type: ModelsToRetrieve; - - /** - * The model’s instance name. - */ - name: string; - - /** - * The data source ID, as returned by the (external) sources API. - */ - sourceID: string; - - /** - * The index name. - */ - index: string; - - modelAttributes?: string[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/affinity.ts b/clients/algoliasearch-client-javascript/packages/predict/model/affinity.ts deleted file mode 100644 index df7569e568..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/affinity.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by 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 type { PredictionAffinityValue } from './predictionAffinityValue'; - -export type Affinity = { - name: string; - - value: PredictionAffinityValue; - - probability: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/allParams.ts b/clients/algoliasearch-client-javascript/packages/predict/model/allParams.ts deleted file mode 100644 index 05f71d6897..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/allParams.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by 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 type { ModelsToRetrieveParam } from './modelsToRetrieveParam'; -import type { TypesToRetrieveParam } from './typesToRetrieveParam'; - -export type AllParams = ModelsToRetrieveParam & TypesToRetrieveParam; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/allUpdateSegmentParams.ts b/clients/algoliasearch-client-javascript/packages/predict/model/allUpdateSegmentParams.ts deleted file mode 100644 index 5438f1833e..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/allUpdateSegmentParams.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by 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 type { SegmentConditionsParam } from './segmentConditionsParam'; -import type { SegmentNameParam } from './segmentNameParam'; - -export type AllUpdateSegmentParams = SegmentConditionsParam & SegmentNameParam; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/clientMethodProps.ts b/clients/algoliasearch-client-javascript/packages/predict/model/clientMethodProps.ts deleted file mode 100644 index 3b6994087b..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/clientMethodProps.ts +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by 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 type { FetchAllUserProfilesParams } from './fetchAllUserProfilesParams'; -import type { Params } from './params'; -import type { SegmentType } from './segmentType'; -import type { UpdateModelParams } from './updateModelParams'; -import type { UpdateSegmentParams } from './updateSegmentParams'; - -/** - * Properties for the `del` method. - */ -export type DelProps = { - /** - * Path of the endpoint, anything after \"/1\" must be specified. - */ - path: string; - /** - * Query parameters to apply to the current query. - */ - parameters?: Record; -}; - -/** - * Properties for the `deleteModelInstance` method. - */ -export type DeleteModelInstanceProps = { - /** - * The ID of the model to retrieve. - */ - modelID: string; -}; - -/** - * Properties for the `deleteSegment` method. - */ -export type DeleteSegmentProps = { - /** - * The ID of the Segment to fetch. - */ - segmentID: string; -}; - -/** - * Properties for the `deleteUserProfile` method. - */ -export type DeleteUserProfileProps = { - /** - * User ID for authenticated users or cookie ID for non-authenticated repeated users (visitors). - */ - userID: string; -}; - -/** - * Properties for the `fetchAllSegments` method. - */ -export type FetchAllSegmentsProps = { - /** - * The type of segments to fetch. - */ - type?: SegmentType; -}; - -/** - * Properties for the `fetchSegment` method. - */ -export type FetchSegmentProps = { - /** - * The ID of the Segment to fetch. - */ - segmentID: string; -}; - -/** - * Properties for the `fetchUserProfile` method. - */ -export type FetchUserProfileProps = { - /** - * User ID for authenticated users or cookie ID for non-authenticated repeated users (visitors). - */ - userID: string; - params: Params; -}; - -/** - * Properties for the `get` method. - */ -export type GetProps = { - /** - * Path of the endpoint, anything after \"/1\" must be specified. - */ - path: string; - /** - * Query parameters to apply to the current query. - */ - parameters?: Record; -}; - -/** - * Properties for the `getModelInstanceConfig` method. - */ -export type GetModelInstanceConfigProps = { - /** - * The ID of the model to retrieve. - */ - modelID: string; -}; - -/** - * Properties for the `getModelMetrics` method. - */ -export type GetModelMetricsProps = { - /** - * The ID of the model to retrieve. - */ - modelID: string; -}; - -/** - * Properties for the `getSegmentUsers` method. - */ -export type GetSegmentUsersProps = { - /** - * The ID of the Segment to fetch. - */ - segmentID: string; - fetchAllUserProfilesParams: FetchAllUserProfilesParams; -}; - -/** - * Properties for the `post` method. - */ -export type PostProps = { - /** - * Path of the endpoint, anything after \"/1\" must be specified. - */ - path: string; - /** - * Query parameters to apply to the current query. - */ - parameters?: Record; - /** - * Parameters to send with the custom request. - */ - body?: Record; -}; - -/** - * Properties for the `put` method. - */ -export type PutProps = { - /** - * Path of the endpoint, anything after \"/1\" must be specified. - */ - path: string; - /** - * Query parameters to apply to the current query. - */ - parameters?: Record; - /** - * Parameters to send with the custom request. - */ - body?: Record; -}; - -/** - * Properties for the `updateModelInstance` method. - */ -export type UpdateModelInstanceProps = { - /** - * The ID of the model to retrieve. - */ - modelID: string; - updateModelParams: UpdateModelParams; -}; - -/** - * Properties for the `updateSegment` method. - */ -export type UpdateSegmentProps = { - /** - * The ID of the Segment to fetch. - */ - segmentID: string; - updateSegmentParams: UpdateSegmentParams; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/compatibleSources.ts b/clients/algoliasearch-client-javascript/packages/predict/model/compatibleSources.ts deleted file mode 100644 index a525ea2d23..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/compatibleSources.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -export type CompatibleSources = 'bigquery'; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/createSegmentParams.ts b/clients/algoliasearch-client-javascript/packages/predict/model/createSegmentParams.ts deleted file mode 100644 index fdccd1b833..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/createSegmentParams.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated by 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 type { SegmentParentConditions } from './segmentParentConditions'; - -export type CreateSegmentParams = { - /** - * The name or description of the segment. - */ - name: string; - - conditions: SegmentParentConditions; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/createSegmentResponse.ts b/clients/algoliasearch-client-javascript/packages/predict/model/createSegmentResponse.ts deleted file mode 100644 index 7749b23cc5..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/createSegmentResponse.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -export type CreateSegmentResponse = { - /** - * The ID of the segment. - */ - segmentID: string; - - /** - * The approximate number of users that matched the segment conditions when it was created, last updated, or when model inference last ran. - */ - size?: number; - - /** - * The date and time at which the segment was updated (RFC3339). - */ - updatedAt: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/deleteModelInstanceResponse.ts b/clients/algoliasearch-client-javascript/packages/predict/model/deleteModelInstanceResponse.ts deleted file mode 100644 index 2701c0039f..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/deleteModelInstanceResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -export type DeleteModelInstanceResponse = { - /** - * The ID of the model. - */ - modelID: string; - - /** - * The date until which you can safely consider the data as being deleted. - */ - deletedUntil: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/deleteSegmentResponse.ts b/clients/algoliasearch-client-javascript/packages/predict/model/deleteSegmentResponse.ts deleted file mode 100644 index db88605be1..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/deleteSegmentResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -export type DeleteSegmentResponse = { - /** - * The ID of the segment. - */ - segmentID: string; - - /** - * The date and time at which the segment will be re-ingested. - */ - deletedUntil: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/deleteUserProfileResponse.ts b/clients/algoliasearch-client-javascript/packages/predict/model/deleteUserProfileResponse.ts deleted file mode 100644 index 1c65872722..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/deleteUserProfileResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -export type DeleteUserProfileResponse = { - /** - * The ID of the user that was deleted. - */ - user: string; - - /** - * The time the same user ID will be imported again when the data is ingested. - */ - deletedUntil: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/errorBase.ts b/clients/algoliasearch-client-javascript/packages/predict/model/errorBase.ts deleted file mode 100644 index 960e509cb7..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/errorBase.ts +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -/** - * Error. - */ -export type ErrorBase = Record & { - message?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/fetchAllUserProfilesParams.ts b/clients/algoliasearch-client-javascript/packages/predict/model/fetchAllUserProfilesParams.ts deleted file mode 100644 index 10b3bf9598..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/fetchAllUserProfilesParams.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by 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 type { LimitParam } from './limitParam'; -import type { ModelsToRetrieveParam } from './modelsToRetrieveParam'; -import type { NextPageTokenParam } from './nextPageTokenParam'; -import type { PreviousPageTokenParam } from './previousPageTokenParam'; -import type { TypesToRetrieveParam } from './typesToRetrieveParam'; - -export type FetchAllUserProfilesParams = - | LimitParam - | ModelsToRetrieveParam - | NextPageTokenParam - | PreviousPageTokenParam - | TypesToRetrieveParam; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/fetchAllUserProfilesResponse.ts b/clients/algoliasearch-client-javascript/packages/predict/model/fetchAllUserProfilesResponse.ts deleted file mode 100644 index e1763cd93b..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/fetchAllUserProfilesResponse.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by 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 type { UserProfile } from './userProfile'; - -export type FetchAllUserProfilesResponse = { - users: UserProfile[]; - - /** - * 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. - */ - previousPageToken?: string; - - /** - * 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. - */ - nextPageToken?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/funnelStage.ts b/clients/algoliasearch-client-javascript/packages/predict/model/funnelStage.ts deleted file mode 100644 index 712b162c7d..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/funnelStage.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -export type FunnelStage = { - name: string; - - probability: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/getAvailableModelTypesResponseInner.ts b/clients/algoliasearch-client-javascript/packages/predict/model/getAvailableModelTypesResponseInner.ts deleted file mode 100644 index 4f26b9da35..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/getAvailableModelTypesResponseInner.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by 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 type { CompatibleSources } from './compatibleSources'; -import type { GetAvailableModelTypesResponseInnerDataRequirements } from './getAvailableModelTypesResponseInnerDataRequirements'; - -export type GetAvailableModelTypesResponseInner = { - /** - * Name of the model. - */ - name: string; - - /** - * Description of the model. - */ - type: string; - - compatibleSources: CompatibleSources[]; - - dataRequirements: GetAvailableModelTypesResponseInnerDataRequirements; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/getAvailableModelTypesResponseInnerDataRequirements.ts b/clients/algoliasearch-client-javascript/packages/predict/model/getAvailableModelTypesResponseInnerDataRequirements.ts deleted file mode 100644 index e05a493c43..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/getAvailableModelTypesResponseInnerDataRequirements.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -export type GetAvailableModelTypesResponseInnerDataRequirements = { - /** - * Minimum number of users required for this model. - */ - minUsers: number; - - /** - * Minimum number of days model needs to run. - */ - minDays: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/getModelInstanceConfigStatus.ts b/clients/algoliasearch-client-javascript/packages/predict/model/getModelInstanceConfigStatus.ts deleted file mode 100644 index d75bf5adc8..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/getModelInstanceConfigStatus.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -/** - * `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. - */ -export type GetModelInstanceConfigStatus = - | 'active' - | 'inactive' - | 'invalid' - | 'pending'; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/getModelMetricsResponse.ts b/clients/algoliasearch-client-javascript/packages/predict/model/getModelMetricsResponse.ts deleted file mode 100644 index 456beca53e..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/getModelMetricsResponse.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated by 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 type { ModelMetrics } from './modelMetrics'; - -export type GetModelMetricsResponse = { - /** - * The ID of the model. - */ - modelID: string; - - metrics: ModelMetrics[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/getSegmentUsersResponse.ts b/clients/algoliasearch-client-javascript/packages/predict/model/getSegmentUsersResponse.ts deleted file mode 100644 index cf865f1fab..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/getSegmentUsersResponse.ts +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated by 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 type { UserProfile } from './userProfile'; - -export type GetSegmentUsersResponse = { - /** - * The ID of the segment. - */ - segmentID: string; - - users: UserProfile[]; - - /** - * 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. - */ - previousPageToken?: string; - - /** - * 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. - */ - nextPageToken?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/index.ts b/clients/algoliasearch-client-javascript/packages/predict/model/index.ts deleted file mode 100644 index 13db0ec5f7..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/index.ts +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -export * from './activateModelInstanceResponse'; -export * from './activateModelParams'; -export * from './affinity'; -export * from './allParams'; -export * from './allUpdateSegmentParams'; -export * from './compatibleSources'; -export * from './createSegmentParams'; -export * from './createSegmentResponse'; -export * from './deleteModelInstanceResponse'; -export * from './deleteSegmentResponse'; -export * from './deleteUserProfileResponse'; -export * from './errorBase'; -export * from './fetchAllUserProfilesParams'; -export * from './fetchAllUserProfilesResponse'; -export * from './funnelStage'; -export * from './getAvailableModelTypesResponseInner'; -export * from './getAvailableModelTypesResponseInnerDataRequirements'; -export * from './getModelInstanceConfigStatus'; -export * from './getModelMetricsResponse'; -export * from './getSegmentUsersResponse'; -export * from './limitParam'; -export * from './modelAttributes'; -export * from './modelError'; -export * from './modelInstance'; -export * from './modelMetrics'; -export * from './modelStatus'; -export * from './modelsToRetrieve'; -export * from './modelsToRetrieveParam'; -export * from './nextPageTokenParam'; -export * from './params'; -export * from './predictionAffinityValue'; -export * from './predictions'; -export * from './predictionsAffinities'; -export * from './predictionsAffinitiesSuccess'; -export * from './predictionsFunnelStage'; -export * from './predictionsFunnelStageSuccess'; -export * from './predictionsOrderValue'; -export * from './predictionsOrderValueSuccess'; -export * from './previousPageTokenParam'; -export * from './properties'; -export * from './segment'; -export * from './segmentAffinityFilter'; -export * from './segmentAffinityFilterValue'; -export * from './segmentChildConditionOperands'; -export * from './segmentChildConditions'; -export * from './segmentConditionOperator'; -export * from './segmentConditionsParam'; -export * from './segmentFilterOperatorBoolean'; -export * from './segmentFilterOperatorNumerical'; -export * from './segmentFilterProbability'; -export * from './segmentFunnelStageFilter'; -export * from './segmentNameParam'; -export * from './segmentOperandAffinity'; -export * from './segmentOperandFunnelStage'; -export * from './segmentOperandOrderValue'; -export * from './segmentOperandProperty'; -export * from './segmentOrderValueFilter'; -export * from './segmentParentConditionOperands'; -export * from './segmentParentConditions'; -export * from './segmentPropertyFilter'; -export * from './segmentPropertyFilterValue'; -export * from './segmentStatus'; -export * from './segmentType'; -export * from './segments'; -export * from './typesToRetrieve'; -export * from './typesToRetrieveParam'; -export * from './updateModelInstanceResponse'; -export * from './updateModelParams'; -export * from './updateSegmentParams'; -export * from './updateSegmentResponse'; -export * from './userProfile'; -export * from './clientMethodProps'; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/limitParam.ts b/clients/algoliasearch-client-javascript/packages/predict/model/limitParam.ts deleted file mode 100644 index ccf04cffde..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/limitParam.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -export type LimitParam = { - limit?: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/modelAttributes.ts b/clients/algoliasearch-client-javascript/packages/predict/model/modelAttributes.ts deleted file mode 100644 index 9a23e5f6f3..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/modelAttributes.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -export type ModelAttributes = { - name: string; - - values?: string[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/modelError.ts b/clients/algoliasearch-client-javascript/packages/predict/model/modelError.ts deleted file mode 100644 index 2831705a71..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/modelError.ts +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -/** - * The error when the model is not available. - */ -export type ModelError = { - error: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/modelInstance.ts b/clients/algoliasearch-client-javascript/packages/predict/model/modelInstance.ts deleted file mode 100644 index 95661dd2ee..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/modelInstance.ts +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by 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 type { GetModelInstanceConfigStatus } from './getModelInstanceConfigStatus'; -import type { ModelAttributes } from './modelAttributes'; -import type { ModelsToRetrieve } from './modelsToRetrieve'; - -export type ModelInstance = { - /** - * ID of the model. - */ - modelID: string; - - /** - * Name of model instance. - */ - name: string; - - type: ModelsToRetrieve; - - sourceID: string; - - index: string; - - modelAttributes?: ModelAttributes[]; - - /** - * The date and time this model instance was last trained. - */ - lastTrained: string; - - /** - * The date and time this model instance generated its last inference. - */ - lastInference: string; - - errorMessage?: string; - - modelStatus: GetModelInstanceConfigStatus; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/modelMetrics.ts b/clients/algoliasearch-client-javascript/packages/predict/model/modelMetrics.ts deleted file mode 100644 index f8a06f8d54..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/modelMetrics.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -export type ModelMetrics = { - precision?: number; - - recall?: number; - - mrr?: number; - - coverage?: number; - - f1_score?: number; - - /** - * Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - */ - updatedAt?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/modelStatus.ts b/clients/algoliasearch-client-javascript/packages/predict/model/modelStatus.ts deleted file mode 100644 index 1534e5a77b..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/modelStatus.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -/** - * `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`. - */ -export type ModelStatus = 'active' | 'inactive'; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/modelsToRetrieve.ts b/clients/algoliasearch-client-javascript/packages/predict/model/modelsToRetrieve.ts deleted file mode 100644 index 4687991cd6..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/modelsToRetrieve.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -export type ModelsToRetrieve = 'affinities' | 'funnel_stage' | 'order_value'; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/modelsToRetrieveParam.ts b/clients/algoliasearch-client-javascript/packages/predict/model/modelsToRetrieveParam.ts deleted file mode 100644 index 73a9b12782..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/modelsToRetrieveParam.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by 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 type { ModelsToRetrieve } from './modelsToRetrieve'; - -export type ModelsToRetrieveParam = { - modelsToRetrieve?: ModelsToRetrieve[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/nextPageTokenParam.ts b/clients/algoliasearch-client-javascript/packages/predict/model/nextPageTokenParam.ts deleted file mode 100644 index 1ae64d5cf6..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/nextPageTokenParam.ts +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -export type NextPageTokenParam = { - /** - * 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. - */ - nextPageToken?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/params.ts b/clients/algoliasearch-client-javascript/packages/predict/model/params.ts deleted file mode 100644 index ea651ba902..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/params.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by 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 type { AllParams } from './allParams'; -import type { ModelsToRetrieveParam } from './modelsToRetrieveParam'; -import type { TypesToRetrieveParam } from './typesToRetrieveParam'; - -export type Params = AllParams | ModelsToRetrieveParam | TypesToRetrieveParam; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/predictionAffinityValue.ts b/clients/algoliasearch-client-javascript/packages/predict/model/predictionAffinityValue.ts deleted file mode 100644 index cf8a4c7c7a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/predictionAffinityValue.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -export type PredictionAffinityValue = boolean | number | string; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/predictions.ts b/clients/algoliasearch-client-javascript/packages/predict/model/predictions.ts deleted file mode 100644 index 61ae764740..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/predictions.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by 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 type { PredictionsAffinities } from './predictionsAffinities'; -import type { PredictionsFunnelStage } from './predictionsFunnelStage'; -import type { PredictionsOrderValue } from './predictionsOrderValue'; - -export type Predictions = { - funnel_stage?: PredictionsFunnelStage; - - order_value?: PredictionsOrderValue; - - affinities?: PredictionsAffinities; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/predictionsAffinities.ts b/clients/algoliasearch-client-javascript/packages/predict/model/predictionsAffinities.ts deleted file mode 100644 index ba18ba7ab9..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/predictionsAffinities.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by 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 type { ModelError } from './modelError'; -import type { PredictionsAffinitiesSuccess } from './predictionsAffinitiesSuccess'; - -export type PredictionsAffinities = ModelError | PredictionsAffinitiesSuccess; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/predictionsAffinitiesSuccess.ts b/clients/algoliasearch-client-javascript/packages/predict/model/predictionsAffinitiesSuccess.ts deleted file mode 100644 index 1de39482cf..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/predictionsAffinitiesSuccess.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated by 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 type { Affinity } from './affinity'; - -/** - * Prediction for the **affinities** model. - */ -export type PredictionsAffinitiesSuccess = { - value: Affinity[]; - - lastUpdatedAt: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/predictionsFunnelStage.ts b/clients/algoliasearch-client-javascript/packages/predict/model/predictionsFunnelStage.ts deleted file mode 100644 index c797ab0ce7..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/predictionsFunnelStage.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by 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 type { ModelError } from './modelError'; -import type { PredictionsFunnelStageSuccess } from './predictionsFunnelStageSuccess'; - -export type PredictionsFunnelStage = ModelError | PredictionsFunnelStageSuccess; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/predictionsFunnelStageSuccess.ts b/clients/algoliasearch-client-javascript/packages/predict/model/predictionsFunnelStageSuccess.ts deleted file mode 100644 index f9dd6f9f5a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/predictionsFunnelStageSuccess.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated by 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 type { FunnelStage } from './funnelStage'; - -/** - * Prediction for the **funnel_stage** model. - */ -export type PredictionsFunnelStageSuccess = { - value: FunnelStage[]; - - lastUpdatedAt: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/predictionsOrderValue.ts b/clients/algoliasearch-client-javascript/packages/predict/model/predictionsOrderValue.ts deleted file mode 100644 index 2966fcb125..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/predictionsOrderValue.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by 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 type { ModelError } from './modelError'; -import type { PredictionsOrderValueSuccess } from './predictionsOrderValueSuccess'; - -export type PredictionsOrderValue = ModelError | PredictionsOrderValueSuccess; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/predictionsOrderValueSuccess.ts b/clients/algoliasearch-client-javascript/packages/predict/model/predictionsOrderValueSuccess.ts deleted file mode 100644 index 5abc73623b..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/predictionsOrderValueSuccess.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -/** - * Prediction for the **order_value** model. - */ -export type PredictionsOrderValueSuccess = { - value: number; - - lastUpdatedAt: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/previousPageTokenParam.ts b/clients/algoliasearch-client-javascript/packages/predict/model/previousPageTokenParam.ts deleted file mode 100644 index 66df35ac18..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/previousPageTokenParam.ts +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -export type PreviousPageTokenParam = { - /** - * 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. - */ - previousPageToken?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/properties.ts b/clients/algoliasearch-client-javascript/packages/predict/model/properties.ts deleted file mode 100644 index 0517897bda..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/properties.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -/** - * Properties for the user profile. - */ -export type Properties = { - /** - * Raw user properties (key-value pairs). - */ - raw?: Record; - - /** - * Computed user properties (key-value pairs). - */ - computed?: Record; - - /** - * Custom user properties (key-value pairs). - */ - custom?: Record; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segment.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segment.ts deleted file mode 100644 index 79a0d4d059..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segment.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by 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 type { SegmentParentConditions } from './segmentParentConditions'; -import type { SegmentStatus } from './segmentStatus'; -import type { SegmentType } from './segmentType'; - -export type Segment = { - /** - * The ID of the segment. - */ - segmentID: string; - - /** - * The name of the segment. - */ - name: string; - - conditions: SegmentParentConditions; - - /** - * The approximate number of users that matched the segment conditions when it was created, last updated, or when model inference last ran. - */ - size: number; - - segmentStatus: SegmentStatus; - - type: SegmentType; - - /** - * The date and time at which the segment was last updated (RFC3339). - */ - lastUpdatedAt: string; - - errorMessage?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentAffinityFilter.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentAffinityFilter.ts deleted file mode 100644 index 84d0d6b7aa..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentAffinityFilter.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated by 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 type { SegmentAffinityFilterValue } from './segmentAffinityFilterValue'; -import type { SegmentFilterOperatorNumerical } from './segmentFilterOperatorNumerical'; -import type { SegmentFilterProbability } from './segmentFilterProbability'; - -/** - * Filter for affinity model predictions. - */ -export type SegmentAffinityFilter = { - operator: SegmentFilterOperatorNumerical; - - value: SegmentAffinityFilterValue; - - probability?: SegmentFilterProbability; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentAffinityFilterValue.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentAffinityFilterValue.ts deleted file mode 100644 index 2dbf3e8911..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentAffinityFilterValue.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -export type SegmentAffinityFilterValue = string[] | boolean | number | string; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentChildConditionOperands.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentChildConditionOperands.ts deleted file mode 100644 index bfaa930f95..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentChildConditionOperands.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated by 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 type { SegmentOperandAffinity } from './segmentOperandAffinity'; -import type { SegmentOperandFunnelStage } from './segmentOperandFunnelStage'; -import type { SegmentOperandOrderValue } from './segmentOperandOrderValue'; -import type { SegmentOperandProperty } from './segmentOperandProperty'; - -export type SegmentChildConditionOperands = - | SegmentOperandAffinity - | SegmentOperandFunnelStage - | SegmentOperandOrderValue - | SegmentOperandProperty; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentChildConditions.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentChildConditions.ts deleted file mode 100644 index e9a5a539bb..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentChildConditions.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by 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 type { SegmentChildConditionOperands } from './segmentChildConditionOperands'; -import type { SegmentConditionOperator } from './segmentConditionOperator'; - -/** - * Nested segment conditions that only contain operands. - */ -export type SegmentChildConditions = { - operator: SegmentConditionOperator; - - operands: SegmentChildConditionOperands[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentConditionOperator.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentConditionOperator.ts deleted file mode 100644 index ac19b2a687..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentConditionOperator.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -/** - * Operator used to combine the operands. - */ -export type SegmentConditionOperator = 'AND' | 'OR'; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentConditionsParam.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentConditionsParam.ts deleted file mode 100644 index 8e4f30c22c..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentConditionsParam.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by 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 type { SegmentParentConditions } from './segmentParentConditions'; - -export type SegmentConditionsParam = { - conditions?: SegmentParentConditions; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentFilterOperatorBoolean.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentFilterOperatorBoolean.ts deleted file mode 100644 index 66846aca86..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentFilterOperatorBoolean.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -/** - * The operator used on the boolean filter value. - */ -export type SegmentFilterOperatorBoolean = 'EQ' | 'NEQ'; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentFilterOperatorNumerical.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentFilterOperatorNumerical.ts deleted file mode 100644 index 3e766db269..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentFilterOperatorNumerical.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -/** - * The operator used on the numerical filter value. - */ -export type SegmentFilterOperatorNumerical = - | 'EQ' - | 'GT' - | 'GTE' - | 'LT' - | 'LTE' - | 'NEQ'; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentFilterProbability.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentFilterProbability.ts deleted file mode 100644 index 10ec756648..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentFilterProbability.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -/** - * Probability of the filter. - */ -export type SegmentFilterProbability = { - LT?: number; - - LTE?: number; - - GT?: number; - - GTE?: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentFunnelStageFilter.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentFunnelStageFilter.ts deleted file mode 100644 index a945e53d4a..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentFunnelStageFilter.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by 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 type { SegmentFilterOperatorBoolean } from './segmentFilterOperatorBoolean'; -import type { SegmentFilterProbability } from './segmentFilterProbability'; - -/** - * Filter for funnel stage model predictions. - */ -export type SegmentFunnelStageFilter = { - operator?: SegmentFilterOperatorBoolean; - - value: string; - - probability: SegmentFilterProbability; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentNameParam.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentNameParam.ts deleted file mode 100644 index 1e3be99a73..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentNameParam.ts +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -export type SegmentNameParam = { - /** - * The name or description of the segment. - */ - name?: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentOperandAffinity.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentOperandAffinity.ts deleted file mode 100644 index a2613bcf4c..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentOperandAffinity.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated by 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 type { SegmentAffinityFilter } from './segmentAffinityFilter'; - -/** - * Operand for affinity model predictions. - */ -export type SegmentOperandAffinity = { - name: string; - - filters: SegmentAffinityFilter[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentOperandFunnelStage.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentOperandFunnelStage.ts deleted file mode 100644 index 5d661c8e60..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentOperandFunnelStage.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated by 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 type { SegmentFunnelStageFilter } from './segmentFunnelStageFilter'; - -/** - * Operand for funnel stage model predictions. - */ -export type SegmentOperandFunnelStage = { - name: string; - - filters: SegmentFunnelStageFilter[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentOperandOrderValue.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentOperandOrderValue.ts deleted file mode 100644 index 616e0bf62c..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentOperandOrderValue.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated by 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 type { SegmentOrderValueFilter } from './segmentOrderValueFilter'; - -/** - * Operand for order value model predictions. - */ -export type SegmentOperandOrderValue = { - name: string; - - filters: SegmentOrderValueFilter[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentOperandProperty.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentOperandProperty.ts deleted file mode 100644 index 585359fa68..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentOperandProperty.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated by 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 type { SegmentPropertyFilter } from './segmentPropertyFilter'; - -/** - * Operand for user profile properties. - */ -export type SegmentOperandProperty = { - name: string; - - filters: SegmentPropertyFilter[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentOrderValueFilter.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentOrderValueFilter.ts deleted file mode 100644 index 59236a2838..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentOrderValueFilter.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated by 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 type { SegmentFilterOperatorNumerical } from './segmentFilterOperatorNumerical'; - -/** - * Filter for order value model predictions. - */ -export type SegmentOrderValueFilter = { - operator?: SegmentFilterOperatorNumerical; - - value: number; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentParentConditionOperands.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentParentConditionOperands.ts deleted file mode 100644 index e9875c53fa..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentParentConditionOperands.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by 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 type { SegmentChildConditions } from './segmentChildConditions'; -import type { SegmentOperandAffinity } from './segmentOperandAffinity'; -import type { SegmentOperandFunnelStage } from './segmentOperandFunnelStage'; -import type { SegmentOperandOrderValue } from './segmentOperandOrderValue'; -import type { SegmentOperandProperty } from './segmentOperandProperty'; - -export type SegmentParentConditionOperands = - | SegmentChildConditions - | SegmentOperandAffinity - | SegmentOperandFunnelStage - | SegmentOperandOrderValue - | SegmentOperandProperty; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentParentConditions.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentParentConditions.ts deleted file mode 100644 index d65c029074..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentParentConditions.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by 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 type { SegmentConditionOperator } from './segmentConditionOperator'; -import type { SegmentParentConditionOperands } from './segmentParentConditionOperands'; - -/** - * The conditions that define which user profiles are included in the segment. Can contain operands and a maximum of 1 level of nested conditions. - */ -export type SegmentParentConditions = { - operator: SegmentConditionOperator; - - operands: SegmentParentConditionOperands[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentPropertyFilter.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentPropertyFilter.ts deleted file mode 100644 index 30b6826b8b..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentPropertyFilter.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by 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 type { SegmentFilterOperatorNumerical } from './segmentFilterOperatorNumerical'; -import type { SegmentPropertyFilterValue } from './segmentPropertyFilterValue'; - -/** - * Filter for user profile properties. - */ -export type SegmentPropertyFilter = { - operator?: SegmentFilterOperatorNumerical; - - value: SegmentPropertyFilterValue; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentPropertyFilterValue.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentPropertyFilterValue.ts deleted file mode 100644 index 4cc57bf00b..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentPropertyFilterValue.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Code generated by 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 type { SegmentAffinityFilterValue } from './segmentAffinityFilterValue'; - -export type SegmentPropertyFilterValue = SegmentAffinityFilterValue; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentStatus.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentStatus.ts deleted file mode 100644 index c05b69a931..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentStatus.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -/** - * The status of the segment. - */ -export type SegmentStatus = 'active' | 'failed' | 'pending'; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segmentType.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segmentType.ts deleted file mode 100644 index 4f848ac8eb..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segmentType.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -/** - * The type of the segment. - */ -export type SegmentType = 'computed' | 'custom'; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/segments.ts b/clients/algoliasearch-client-javascript/packages/predict/model/segments.ts deleted file mode 100644 index 0e72f6951b..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/segments.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -/** - * Segments that the user belongs to. - */ -export type Segments = { - /** - * List of computed segments IDs. - */ - computed: string[]; - - /** - * List of custom segments IDs. - */ - custom: string[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/typesToRetrieve.ts b/clients/algoliasearch-client-javascript/packages/predict/model/typesToRetrieve.ts deleted file mode 100644 index 2e75d31b87..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/typesToRetrieve.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -export type TypesToRetrieve = 'properties' | 'segments'; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/typesToRetrieveParam.ts b/clients/algoliasearch-client-javascript/packages/predict/model/typesToRetrieveParam.ts deleted file mode 100644 index 0225cbfca0..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/typesToRetrieveParam.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Code generated by 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 type { TypesToRetrieve } from './typesToRetrieve'; - -export type TypesToRetrieveParam = { - typesToRetrieve?: TypesToRetrieve[]; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/updateModelInstanceResponse.ts b/clients/algoliasearch-client-javascript/packages/predict/model/updateModelInstanceResponse.ts deleted file mode 100644 index b39b622c76..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/updateModelInstanceResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -export type UpdateModelInstanceResponse = { - /** - * The ID of the model. - */ - modelID: string; - - /** - * Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - */ - updatedAt: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/updateModelParams.ts b/clients/algoliasearch-client-javascript/packages/predict/model/updateModelParams.ts deleted file mode 100644 index a51d9b4ab8..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/updateModelParams.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by 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 type { ModelStatus } from './modelStatus'; - -export type UpdateModelParams = { - /** - * The model’s instance name. - */ - name?: string; - - modelAttributes?: string[]; - - modelStatus?: ModelStatus; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/updateSegmentParams.ts b/clients/algoliasearch-client-javascript/packages/predict/model/updateSegmentParams.ts deleted file mode 100644 index 8f7f5e1c3b..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/updateSegmentParams.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Code generated by 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 type { AllUpdateSegmentParams } from './allUpdateSegmentParams'; -import type { SegmentConditionsParam } from './segmentConditionsParam'; -import type { SegmentNameParam } from './segmentNameParam'; - -export type UpdateSegmentParams = - | AllUpdateSegmentParams - | SegmentConditionsParam - | SegmentNameParam; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/updateSegmentResponse.ts b/clients/algoliasearch-client-javascript/packages/predict/model/updateSegmentResponse.ts deleted file mode 100644 index 28535b2329..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/updateSegmentResponse.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -export type UpdateSegmentResponse = { - /** - * The ID of the segment. - */ - segmentID: string; - - /** - * The approximate number of users that matched the segment conditions when it was created, last updated, or when model inference last ran. - */ - size?: number; - - /** - * The date and time at which the segment was updated (RFC3339). - */ - updatedAt: string; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/model/userProfile.ts b/clients/algoliasearch-client-javascript/packages/predict/model/userProfile.ts deleted file mode 100644 index a6edb3f1c0..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/model/userProfile.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by 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 type { Predictions } from './predictions'; -import type { Properties } from './properties'; -import type { Segments } from './segments'; - -export type UserProfile = { - user: string; - - predictions?: Predictions; - - properties?: Properties; - - segments?: Segments; -}; diff --git a/clients/algoliasearch-client-javascript/packages/predict/package.json b/clients/algoliasearch-client-javascript/packages/predict/package.json deleted file mode 100644 index 3bfc1e8a51..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "@algolia/predict", - "version": "1.0.0-alpha.76", - "description": "JavaScript client for predict", - "repository": "algolia/algoliasearch-client-javascript", - "license": "MIT", - "author": "Algolia", - "type": "module", - "exports": { - ".": { - "node": { - "import": "./dist/predict.esm.node.js", - "module": "./dist/predict.esm.node.js", - "require": "./dist/predict.cjs.js", - "default": "./dist/predict.cjs.js" - }, - "default": { - "umd": "./dist/predict.umd.js", - "module": "./dist/predict.esm.browser.js", - "import": "./dist/predict.esm.browser.js", - "default": "./dist/predict.umd.js" - } - }, - "./src/*": "./src/*.ts", - "./model": "./model/index.ts" - }, - "jsdelivr": "./dist/predict.umd.js", - "unpkg": "./dist/predict.umd.js", - "browser": "./dist/predict.umd.js", - "types": "./index.d.ts", - "files": [ - "dist", - "model", - "index.js", - "index.d.ts" - ], - "scripts": { - "build": "yarn clean && rollup --config", - "clean": "rm -rf ./dist || true" - }, - "dependencies": { - "@algolia/client-common": "5.0.0-alpha.76", - "@algolia/requester-browser-xhr": "5.0.0-alpha.76", - "@algolia/requester-node-http": "5.0.0-alpha.76" - }, - "devDependencies": { - "@types/node": "18.17.1", - "rollup": "3.27.0", - "typescript": "5.1.6" - }, - "engines": { - "node": ">= 14.0.0" - } -} diff --git a/clients/algoliasearch-client-javascript/packages/predict/rollup.config.js b/clients/algoliasearch-client-javascript/packages/predict/rollup.config.js deleted file mode 100644 index dbcfa81291..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/rollup.config.js +++ /dev/null @@ -1,5 +0,0 @@ -import { buildConfigs } from '../../base.rollup.config.js'; - -import pkg from './package.json' assert { type: 'json' }; - -export default buildConfigs(pkg); \ No newline at end of file diff --git a/clients/algoliasearch-client-javascript/packages/predict/src/predictClient.ts b/clients/algoliasearch-client-javascript/packages/predict/src/predictClient.ts deleted file mode 100644 index fa826572ef..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/src/predictClient.ts +++ /dev/null @@ -1,846 +0,0 @@ -// Code generated by 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 { - createAuth, - createTransporter, - getAlgoliaAgent, -} from '@algolia/client-common'; -import type { - CreateClientOptions, - Headers, - Host, - Request, - RequestOptions, - QueryParameters, -} from '@algolia/client-common'; - -import type { ActivateModelInstanceResponse } from '../model/activateModelInstanceResponse'; -import type { ActivateModelParams } from '../model/activateModelParams'; -import type { - DelProps, - DeleteModelInstanceProps, - DeleteSegmentProps, - DeleteUserProfileProps, - FetchAllSegmentsProps, - FetchSegmentProps, - FetchUserProfileProps, - GetProps, - GetModelInstanceConfigProps, - GetModelMetricsProps, - GetSegmentUsersProps, - PostProps, - PutProps, - UpdateModelInstanceProps, - UpdateSegmentProps, -} from '../model/clientMethodProps'; -import type { CreateSegmentParams } from '../model/createSegmentParams'; -import type { CreateSegmentResponse } from '../model/createSegmentResponse'; -import type { DeleteModelInstanceResponse } from '../model/deleteModelInstanceResponse'; -import type { DeleteSegmentResponse } from '../model/deleteSegmentResponse'; -import type { DeleteUserProfileResponse } from '../model/deleteUserProfileResponse'; -import type { FetchAllUserProfilesParams } from '../model/fetchAllUserProfilesParams'; -import type { FetchAllUserProfilesResponse } from '../model/fetchAllUserProfilesResponse'; -import type { GetAvailableModelTypesResponseInner } from '../model/getAvailableModelTypesResponseInner'; -import type { GetModelMetricsResponse } from '../model/getModelMetricsResponse'; -import type { GetSegmentUsersResponse } from '../model/getSegmentUsersResponse'; -import type { ModelInstance } from '../model/modelInstance'; -import type { Segment } from '../model/segment'; -import type { UpdateModelInstanceResponse } from '../model/updateModelInstanceResponse'; -import type { UpdateSegmentResponse } from '../model/updateSegmentResponse'; -import type { UserProfile } from '../model/userProfile'; - -export const apiClientVersion = '1.0.0-alpha.76'; - -export const REGIONS = ['eu', 'us'] as const; -export type Region = (typeof REGIONS)[number]; - -function getDefaultHosts(region: Region): Host[] { - const url = 'predict.{region}.algolia.com'.replace('{region}', region); - - return [{ url, accept: 'readWrite', protocol: 'https' }]; -} - -// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -export function createPredictClient({ - appId: appIdOption, - apiKey: apiKeyOption, - authMode, - algoliaAgents, - region: regionOption, - ...options -}: CreateClientOptions & { region: Region }) { - const auth = createAuth(appIdOption, apiKeyOption, authMode); - const transporter = createTransporter({ - hosts: getDefaultHosts(regionOption), - ...options, - algoliaAgent: getAlgoliaAgent({ - algoliaAgents, - client: 'Predict', - version: apiClientVersion, - }), - baseHeaders: { - 'content-type': 'text/plain', - ...auth.headers(), - ...options.baseHeaders, - }, - baseQueryParameters: { - ...auth.queryParameters(), - ...options.baseQueryParameters, - }, - }); - - return { - transporter, - - /** - * The `appId` currently in use. - */ - appId: appIdOption, - - /** - * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties. - */ - clearCache(): Promise { - return Promise.all([ - transporter.requestsCache.clear(), - transporter.responsesCache.clear(), - ]).then(() => undefined); - }, - - /** - * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system. - */ - get _ua(): string { - return transporter.algoliaAgent.value; - }, - - /** - * Adds a `segment` to the `x-algolia-agent` sent with every requests. - * - * @param segment - The algolia agent (user-agent) segment to add. - * @param version - The version of the agent. - */ - addAlgoliaAgent(segment: string, version?: string): void { - transporter.algoliaAgent.add({ segment, version }); - }, - - /** - * 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. - * - * @summary Activate a model instance. - * @param activateModelParams - The activateModelParams object. - * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. - */ - activateModelInstance( - activateModelParams: ActivateModelParams, - requestOptions?: RequestOptions - ): Promise { - if (!activateModelParams) { - throw new Error( - 'Parameter `activateModelParams` is required when calling `activateModelInstance`.' - ); - } - - if (!activateModelParams.type) { - throw new Error( - 'Parameter `activateModelParams.type` is required when calling `activateModelInstance`.' - ); - } - if (!activateModelParams.name) { - throw new Error( - 'Parameter `activateModelParams.name` is required when calling `activateModelInstance`.' - ); - } - if (!activateModelParams.sourceID) { - throw new Error( - 'Parameter `activateModelParams.sourceID` is required when calling `activateModelInstance`.' - ); - } - if (!activateModelParams.index) { - throw new Error( - 'Parameter `activateModelParams.index` is required when calling `activateModelInstance`.' - ); - } - - const requestPath = '/1/predict/models'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - queryParameters, - headers, - data: activateModelParams, - }; - - return transporter.request(request, requestOptions); - }, - - /** - * 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. - * - * @summary Create a segment. - * @param createSegmentParams - The createSegmentParams object. - * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. - */ - createSegment( - createSegmentParams: CreateSegmentParams, - requestOptions?: RequestOptions - ): Promise { - if (!createSegmentParams) { - throw new Error( - 'Parameter `createSegmentParams` is required when calling `createSegment`.' - ); - } - - if (!createSegmentParams.name) { - throw new Error( - 'Parameter `createSegmentParams.name` is required when calling `createSegment`.' - ); - } - if (!createSegmentParams.conditions) { - throw new Error( - 'Parameter `createSegmentParams.conditions` is required when calling `createSegment`.' - ); - } - - const requestPath = '/1/segments'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - queryParameters, - headers, - data: createSegmentParams, - }; - - return transporter.request(request, requestOptions); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param del - The del object. - * @param del.path - Path of the endpoint, anything after \"/1\" must be specified. - * @param del.parameters - Query parameters to apply to the current query. - * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. - */ - del( - { path, parameters }: DelProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `del`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters ? parameters : {}; - - const request: Request = { - method: 'DELETE', - path: requestPath, - queryParameters, - headers, - }; - - return transporter.request(request, requestOptions); - }, - - /** - * Delete the model’s configuration, pipelines and generated predictions. - * - * @summary Delete a model instance. - * @param deleteModelInstance - The deleteModelInstance object. - * @param deleteModelInstance.modelID - The ID of the model to retrieve. - * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. - */ - deleteModelInstance( - { modelID }: DeleteModelInstanceProps, - requestOptions?: RequestOptions - ): Promise { - if (!modelID) { - throw new Error( - 'Parameter `modelID` is required when calling `deleteModelInstance`.' - ); - } - - const requestPath = '/1/predict/models/{modelID}'.replace( - '{modelID}', - encodeURIComponent(modelID) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'DELETE', - path: requestPath, - queryParameters, - headers, - }; - - return transporter.request(request, requestOptions); - }, - - /** - * 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. - * - * @summary Delete a segment\'s configuration. - * @param deleteSegment - The deleteSegment object. - * @param deleteSegment.segmentID - The ID of the Segment to fetch. - * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. - */ - deleteSegment( - { segmentID }: DeleteSegmentProps, - requestOptions?: RequestOptions - ): Promise { - if (!segmentID) { - throw new Error( - 'Parameter `segmentID` is required when calling `deleteSegment`.' - ); - } - - const requestPath = '/1/segments/{segmentID}'.replace( - '{segmentID}', - encodeURIComponent(segmentID) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'DELETE', - path: requestPath, - queryParameters, - headers, - }; - - return transporter.request(request, requestOptions); - }, - - /** - * Delete all data and predictions associated with an authenticated user (userID) or an anonymous user (cookieID, sessionID). - * - * @summary Delete user profile. - * @param deleteUserProfile - The deleteUserProfile object. - * @param deleteUserProfile.userID - User ID for authenticated users or cookie ID for non-authenticated repeated users (visitors). - * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. - */ - deleteUserProfile( - { userID }: DeleteUserProfileProps, - requestOptions?: RequestOptions - ): Promise { - if (!userID) { - throw new Error( - 'Parameter `userID` is required when calling `deleteUserProfile`.' - ); - } - - const requestPath = '/1/users/{userID}'.replace( - '{userID}', - encodeURIComponent(userID) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'DELETE', - path: requestPath, - queryParameters, - headers, - }; - - return transporter.request(request, requestOptions); - }, - - /** - * Get the list of segments with their configuration. - * - * @summary Get all segments. - * @param fetchAllSegments - The fetchAllSegments object. - * @param fetchAllSegments.type - The type of segments to fetch. - * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. - */ - fetchAllSegments( - { type }: FetchAllSegmentsProps = {}, - requestOptions: RequestOptions | undefined = undefined - ): Promise { - const requestPath = '/1/segments'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - if (type !== undefined) { - queryParameters.type = type.toString(); - } - - const request: Request = { - method: 'GET', - path: requestPath, - queryParameters, - headers, - }; - - return transporter.request(request, requestOptions); - }, - - /** - * Get all users with predictions in the provided application. - * - * @summary Get all user profiles. - * @param fetchAllUserProfilesParams - The fetchAllUserProfilesParams object. - * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. - */ - fetchAllUserProfiles( - fetchAllUserProfilesParams: FetchAllUserProfilesParams, - requestOptions?: RequestOptions - ): Promise { - if (!fetchAllUserProfilesParams) { - throw new Error( - 'Parameter `fetchAllUserProfilesParams` is required when calling `fetchAllUserProfiles`.' - ); - } - - const requestPath = '/1/users'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - queryParameters, - headers, - data: fetchAllUserProfilesParams, - }; - - return transporter.request(request, requestOptions); - }, - - /** - * Get the segment configuration. - * - * @summary Get the segment configuration. - * @param fetchSegment - The fetchSegment object. - * @param fetchSegment.segmentID - The ID of the Segment to fetch. - * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. - */ - fetchSegment( - { segmentID }: FetchSegmentProps, - requestOptions?: RequestOptions - ): Promise { - if (!segmentID) { - throw new Error( - 'Parameter `segmentID` is required when calling `fetchSegment`.' - ); - } - - const requestPath = '/1/segments/{segmentID}'.replace( - '{segmentID}', - encodeURIComponent(segmentID) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - queryParameters, - headers, - }; - - return transporter.request(request, requestOptions); - }, - - /** - * Get predictions, properties (raw, computed or custom) and segments (computed or custom) for a user profile. - * - * @summary Get user profile. - * @param fetchUserProfile - The fetchUserProfile object. - * @param fetchUserProfile.userID - User ID for authenticated users or cookie ID for non-authenticated repeated users (visitors). - * @param fetchUserProfile.params - The params object. - * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. - */ - fetchUserProfile( - { userID, params }: FetchUserProfileProps, - requestOptions?: RequestOptions - ): Promise { - if (!userID) { - throw new Error( - 'Parameter `userID` is required when calling `fetchUserProfile`.' - ); - } - - if (!params) { - throw new Error( - 'Parameter `params` is required when calling `fetchUserProfile`.' - ); - } - - const requestPath = '/1/users/{userID}/fetch'.replace( - '{userID}', - encodeURIComponent(userID) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - queryParameters, - headers, - data: params, - }; - - return transporter.request(request, requestOptions); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param get - The get object. - * @param get.path - Path of the endpoint, anything after \"/1\" must be specified. - * @param get.parameters - Query parameters to apply to the current query. - * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. - */ - get( - { path, parameters }: GetProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `get`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters ? parameters : {}; - - const request: Request = { - method: 'GET', - path: requestPath, - queryParameters, - headers, - }; - - return transporter.request(request, requestOptions); - }, - - /** - * Get a list of all available model types. Each model type can be activated more than once, by selecting a different data source. - * - * @summary Get a list of available model types. - * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. - */ - getAvailableModelTypes( - requestOptions?: RequestOptions - ): Promise { - const requestPath = '/1/predict/modeltypes'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - queryParameters, - headers, - }; - - return transporter.request(request, requestOptions); - }, - - /** - * Get the configuration for a model that was activated. - * - * @summary Get a model’s instance configuration. - * @param getModelInstanceConfig - The getModelInstanceConfig object. - * @param getModelInstanceConfig.modelID - The ID of the model to retrieve. - * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. - */ - getModelInstanceConfig( - { modelID }: GetModelInstanceConfigProps, - requestOptions?: RequestOptions - ): Promise { - if (!modelID) { - throw new Error( - 'Parameter `modelID` is required when calling `getModelInstanceConfig`.' - ); - } - - const requestPath = '/1/predict/models/{modelID}'.replace( - '{modelID}', - encodeURIComponent(modelID) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - queryParameters, - headers, - }; - - return transporter.request(request, requestOptions); - }, - - /** - * Get a list of all model instances. - * - * @summary Get model instances. - * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. - */ - getModelInstances( - requestOptions?: RequestOptions - ): Promise { - const requestPath = '/1/predict/models'; - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - queryParameters, - headers, - }; - - return transporter.request(request, requestOptions); - }, - - /** - * Get the model instance’ training metrics. - * - * @summary Get a model’s instance metrics. - * @param getModelMetrics - The getModelMetrics object. - * @param getModelMetrics.modelID - The ID of the model to retrieve. - * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. - */ - getModelMetrics( - { modelID }: GetModelMetricsProps, - requestOptions?: RequestOptions - ): Promise { - if (!modelID) { - throw new Error( - 'Parameter `modelID` is required when calling `getModelMetrics`.' - ); - } - - const requestPath = '/1/predict/models/{modelID}/metrics'.replace( - '{modelID}', - encodeURIComponent(modelID) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'GET', - path: requestPath, - queryParameters, - headers, - }; - - return transporter.request(request, requestOptions); - }, - - /** - * Get the profiles of users that belong to a segment. - * - * @summary Get segment users. - * @param getSegmentUsers - The getSegmentUsers object. - * @param getSegmentUsers.segmentID - The ID of the Segment to fetch. - * @param getSegmentUsers.fetchAllUserProfilesParams - The fetchAllUserProfilesParams object. - * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. - */ - getSegmentUsers( - { segmentID, fetchAllUserProfilesParams }: GetSegmentUsersProps, - requestOptions?: RequestOptions - ): Promise { - if (!segmentID) { - throw new Error( - 'Parameter `segmentID` is required when calling `getSegmentUsers`.' - ); - } - - if (!fetchAllUserProfilesParams) { - throw new Error( - 'Parameter `fetchAllUserProfilesParams` is required when calling `getSegmentUsers`.' - ); - } - - const requestPath = '/1/segments/{segmentID}/users'.replace( - '{segmentID}', - encodeURIComponent(segmentID) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - queryParameters, - headers, - data: fetchAllUserProfilesParams, - }; - - return transporter.request(request, requestOptions); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param post - The post object. - * @param post.path - Path of the endpoint, anything after \"/1\" must be specified. - * @param post.parameters - Query parameters to apply to the current query. - * @param post.body - Parameters to send with the custom request. - * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. - */ - post( - { path, parameters, body }: PostProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `post`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters ? parameters : {}; - - const request: Request = { - method: 'POST', - path: requestPath, - queryParameters, - headers, - data: body ? body : {}, - }; - - return transporter.request(request, requestOptions); - }, - - /** - * This method allow you to send requests to the Algolia REST API. - * - * @summary Send requests to the Algolia REST API. - * @param put - The put object. - * @param put.path - Path of the endpoint, anything after \"/1\" must be specified. - * @param put.parameters - Query parameters to apply to the current query. - * @param put.body - Parameters to send with the custom request. - * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. - */ - put( - { path, parameters, body }: PutProps, - requestOptions?: RequestOptions - ): Promise> { - if (!path) { - throw new Error('Parameter `path` is required when calling `put`.'); - } - - const requestPath = '/1{path}'.replace('{path}', path); - const headers: Headers = {}; - const queryParameters: QueryParameters = parameters ? parameters : {}; - - const request: Request = { - method: 'PUT', - path: requestPath, - queryParameters, - headers, - data: body ? body : {}, - }; - - return transporter.request(request, requestOptions); - }, - - /** - * Update a model’s configuration. - * - * @summary Update a model instance. - * @param updateModelInstance - The updateModelInstance object. - * @param updateModelInstance.modelID - The ID of the model to retrieve. - * @param updateModelInstance.updateModelParams - The updateModelParams object. - * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. - */ - updateModelInstance( - { modelID, updateModelParams }: UpdateModelInstanceProps, - requestOptions?: RequestOptions - ): Promise { - if (!modelID) { - throw new Error( - 'Parameter `modelID` is required when calling `updateModelInstance`.' - ); - } - - if (!updateModelParams) { - throw new Error( - 'Parameter `updateModelParams` is required when calling `updateModelInstance`.' - ); - } - - const requestPath = '/1/predict/models/{modelID}'.replace( - '{modelID}', - encodeURIComponent(modelID) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - queryParameters, - headers, - data: updateModelParams, - }; - - return transporter.request(request, requestOptions); - }, - - /** - * Update a segment’s configuration. - * - * @summary Update segment. - * @param updateSegment - The updateSegment object. - * @param updateSegment.segmentID - The ID of the Segment to fetch. - * @param updateSegment.updateSegmentParams - The updateSegmentParams object. - * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. - */ - updateSegment( - { segmentID, updateSegmentParams }: UpdateSegmentProps, - requestOptions?: RequestOptions - ): Promise { - if (!segmentID) { - throw new Error( - 'Parameter `segmentID` is required when calling `updateSegment`.' - ); - } - - if (!updateSegmentParams) { - throw new Error( - 'Parameter `updateSegmentParams` is required when calling `updateSegment`.' - ); - } - - const requestPath = '/1/segments/{segmentID}'.replace( - '{segmentID}', - encodeURIComponent(segmentID) - ); - const headers: Headers = {}; - const queryParameters: QueryParameters = {}; - - const request: Request = { - method: 'POST', - path: requestPath, - queryParameters, - headers, - data: updateSegmentParams, - }; - - return transporter.request(request, requestOptions); - }, - }; -} - -/** - * The client type. - */ -export type PredictClient = ReturnType; diff --git a/clients/algoliasearch-client-javascript/packages/predict/tsconfig.json b/clients/algoliasearch-client-javascript/packages/predict/tsconfig.json deleted file mode 100644 index 444e8bb640..0000000000 --- a/clients/algoliasearch-client-javascript/packages/predict/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "dist" - }, - "include": ["src", "model", "builds"], - "exclude": ["dist", "node_modules"] -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/PredictClient.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/PredictClient.kt deleted file mode 100644 index 4dba460aaa..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/PredictClient.kt +++ /dev/null @@ -1,416 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.api - -import com.algolia.client.configuration.* -import com.algolia.client.exception.* -import com.algolia.client.extensions.internal.* -import com.algolia.client.model.predict.* -import com.algolia.client.transport.* -import com.algolia.client.transport.internal.* -import kotlinx.serialization.json.* - -public class PredictClient( - override val appId: String, - override val apiKey: String, - public val region: String, - override val options: ClientOptions = ClientOptions(), -) : ApiClient { - - init { - require(appId.isNotBlank()) { "`appId` is missing." } - require(apiKey.isNotBlank()) { "`apiKey` is missing." } - } - - override val requester: Requester = requesterOf(clientName = "Predict", appId = appId, apiKey = apiKey, options = options) { - val allowedRegions = listOf("eu", "us") - require(region in allowedRegions) { "`region` is required and must be one of the following: ${allowedRegions.joinToString()}" } - val url = "predict.$region.algolia.com" - listOf(Host(url)) - } - - /** - * 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. - * @param activateModelParams - * @param requestOptions additional request configuration. - */ - public suspend fun activateModelInstance(activateModelParams: ActivateModelParams, requestOptions: RequestOptions? = null): ActivateModelInstanceResponse { - val requestConfig = RequestConfig( - method = RequestMethod.POST, - path = listOf("1", "predict", "models"), - body = activateModelParams, - ) - return requester.execute( - requestConfig = requestConfig, - requestOptions = requestOptions, - ) - } - - /** - * 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. - * @param createSegmentParams - * @param requestOptions additional request configuration. - */ - public suspend fun createSegment(createSegmentParams: CreateSegmentParams, requestOptions: RequestOptions? = null): CreateSegmentResponse { - val requestConfig = RequestConfig( - method = RequestMethod.POST, - path = listOf("1", "segments"), - body = createSegmentParams, - ) - return requester.execute( - requestConfig = requestConfig, - requestOptions = requestOptions, - ) - } - - /** - * Send requests to the Algolia REST API. - * This method allow you to send requests to the Algolia REST API. - * @param path Path of the endpoint, anything after \"/1\" must be specified. - * @param parameters Query parameters to apply to the current query. - * @param requestOptions additional request configuration. - */ - public suspend fun del(path: String, parameters: Map? = null, requestOptions: RequestOptions? = null): JsonObject { - require(path.isNotBlank()) { "Parameter `path` is required when calling `del`." } - val requestConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/1{path}".replace("{path}", path), - query = buildMap { - parameters?.let { putAll(it) } - }, - ) - return requester.execute( - requestConfig = requestConfig, - requestOptions = requestOptions, - ) - } - - /** - * Delete a model instance. - * Delete the model’s configuration, pipelines and generated predictions. - * @param modelID The ID of the model to retrieve. - * @param requestOptions additional request configuration. - */ - public suspend fun deleteModelInstance(modelID: String, requestOptions: RequestOptions? = null): DeleteModelInstanceResponse { - require(modelID.isNotBlank()) { "Parameter `modelID` is required when calling `deleteModelInstance`." } - val requestConfig = RequestConfig( - method = RequestMethod.DELETE, - path = listOf("1", "predict", "models", "$modelID"), - ) - return requester.execute( - requestConfig = requestConfig, - requestOptions = requestOptions, - ) - } - - /** - * 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. - * @param segmentID The ID of the Segment to fetch. - * @param requestOptions additional request configuration. - */ - public suspend fun deleteSegment(segmentID: String, requestOptions: RequestOptions? = null): DeleteSegmentResponse { - require(segmentID.isNotBlank()) { "Parameter `segmentID` is required when calling `deleteSegment`." } - val requestConfig = RequestConfig( - method = RequestMethod.DELETE, - path = listOf("1", "segments", "$segmentID"), - ) - return requester.execute( - requestConfig = requestConfig, - requestOptions = requestOptions, - ) - } - - /** - * Delete user profile. - * Delete all data and predictions associated with an authenticated user (userID) or an anonymous user (cookieID, sessionID). - * @param userID User ID for authenticated users or cookie ID for non-authenticated repeated users (visitors). - * @param requestOptions additional request configuration. - */ - public suspend fun deleteUserProfile(userID: String, requestOptions: RequestOptions? = null): DeleteUserProfileResponse { - require(userID.isNotBlank()) { "Parameter `userID` is required when calling `deleteUserProfile`." } - val requestConfig = RequestConfig( - method = RequestMethod.DELETE, - path = listOf("1", "users", "$userID"), - ) - return requester.execute( - requestConfig = requestConfig, - requestOptions = requestOptions, - ) - } - - /** - * Get all segments. - * Get the list of segments with their configuration. - * @param type The type of segments to fetch. - * @param requestOptions additional request configuration. - */ - public suspend fun fetchAllSegments(type: SegmentType? = null, requestOptions: RequestOptions? = null): List { - val requestConfig = RequestConfig( - method = RequestMethod.GET, - path = listOf("1", "segments"), - query = buildMap { - type?.let { put("type", it) } - }, - ) - return requester.execute( - requestConfig = requestConfig, - requestOptions = requestOptions, - ) - } - - /** - * Get all user profiles. - * Get all users with predictions in the provided application. - * @param fetchAllUserProfilesParams - * @param requestOptions additional request configuration. - */ - public suspend fun fetchAllUserProfiles(fetchAllUserProfilesParams: FetchAllUserProfilesParams, requestOptions: RequestOptions? = null): FetchAllUserProfilesResponse { - val requestConfig = RequestConfig( - method = RequestMethod.POST, - path = listOf("1", "users"), - body = fetchAllUserProfilesParams, - ) - return requester.execute( - requestConfig = requestConfig, - requestOptions = requestOptions, - ) - } - - /** - * Get the segment configuration. - * Get the segment configuration. - * @param segmentID The ID of the Segment to fetch. - * @param requestOptions additional request configuration. - */ - public suspend fun fetchSegment(segmentID: String, requestOptions: RequestOptions? = null): Segment { - require(segmentID.isNotBlank()) { "Parameter `segmentID` is required when calling `fetchSegment`." } - val requestConfig = RequestConfig( - method = RequestMethod.GET, - path = listOf("1", "segments", "$segmentID"), - ) - return requester.execute( - requestConfig = requestConfig, - requestOptions = requestOptions, - ) - } - - /** - * Get user profile. - * Get predictions, properties (raw, computed or custom) and segments (computed or custom) for a user profile. - * @param userID User ID for authenticated users or cookie ID for non-authenticated repeated users (visitors). - * @param params - * @param requestOptions additional request configuration. - */ - public suspend fun fetchUserProfile(userID: String, params: Params, requestOptions: RequestOptions? = null): UserProfile { - require(userID.isNotBlank()) { "Parameter `userID` is required when calling `fetchUserProfile`." } - val requestConfig = RequestConfig( - method = RequestMethod.POST, - path = listOf("1", "users", "$userID", "fetch"), - body = params, - ) - return requester.execute( - requestConfig = requestConfig, - requestOptions = requestOptions, - ) - } - - /** - * Send requests to the Algolia REST API. - * This method allow you to send requests to the Algolia REST API. - * @param path Path of the endpoint, anything after \"/1\" must be specified. - * @param parameters Query parameters to apply to the current query. - * @param requestOptions additional request configuration. - */ - public suspend fun get(path: String, parameters: Map? = null, requestOptions: RequestOptions? = null): JsonObject { - require(path.isNotBlank()) { "Parameter `path` is required when calling `get`." } - val requestConfig = RequestConfig( - method = RequestMethod.GET, - path = "/1{path}".replace("{path}", path), - query = buildMap { - parameters?.let { putAll(it) } - }, - ) - return requester.execute( - requestConfig = requestConfig, - requestOptions = requestOptions, - ) - } - - /** - * 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. - * @param requestOptions additional request configuration. - */ - public suspend fun getAvailableModelTypes(requestOptions: RequestOptions? = null): List { - val requestConfig = RequestConfig( - method = RequestMethod.GET, - path = listOf("1", "predict", "modeltypes"), - ) - return requester.execute( - requestConfig = requestConfig, - requestOptions = requestOptions, - ) - } - - /** - * Get a model’s instance configuration. - * Get the configuration for a model that was activated. - * @param modelID The ID of the model to retrieve. - * @param requestOptions additional request configuration. - */ - public suspend fun getModelInstanceConfig(modelID: String, requestOptions: RequestOptions? = null): ModelInstance { - require(modelID.isNotBlank()) { "Parameter `modelID` is required when calling `getModelInstanceConfig`." } - val requestConfig = RequestConfig( - method = RequestMethod.GET, - path = listOf("1", "predict", "models", "$modelID"), - ) - return requester.execute( - requestConfig = requestConfig, - requestOptions = requestOptions, - ) - } - - /** - * Get model instances. - * Get a list of all model instances. - * @param requestOptions additional request configuration. - */ - public suspend fun getModelInstances(requestOptions: RequestOptions? = null): List { - val requestConfig = RequestConfig( - method = RequestMethod.GET, - path = listOf("1", "predict", "models"), - ) - return requester.execute( - requestConfig = requestConfig, - requestOptions = requestOptions, - ) - } - - /** - * Get a model’s instance metrics. - * Get the model instance’ training metrics. - * @param modelID The ID of the model to retrieve. - * @param requestOptions additional request configuration. - */ - public suspend fun getModelMetrics(modelID: String, requestOptions: RequestOptions? = null): GetModelMetricsResponse { - require(modelID.isNotBlank()) { "Parameter `modelID` is required when calling `getModelMetrics`." } - val requestConfig = RequestConfig( - method = RequestMethod.GET, - path = listOf("1", "predict", "models", "$modelID", "metrics"), - ) - return requester.execute( - requestConfig = requestConfig, - requestOptions = requestOptions, - ) - } - - /** - * Get segment users. - * Get the profiles of users that belong to a segment. - * @param segmentID The ID of the Segment to fetch. - * @param fetchAllUserProfilesParams - * @param requestOptions additional request configuration. - */ - public suspend fun getSegmentUsers(segmentID: String, fetchAllUserProfilesParams: FetchAllUserProfilesParams, requestOptions: RequestOptions? = null): GetSegmentUsersResponse { - require(segmentID.isNotBlank()) { "Parameter `segmentID` is required when calling `getSegmentUsers`." } - val requestConfig = RequestConfig( - method = RequestMethod.POST, - path = listOf("1", "segments", "$segmentID", "users"), - body = fetchAllUserProfilesParams, - ) - return requester.execute( - requestConfig = requestConfig, - requestOptions = requestOptions, - ) - } - - /** - * Send requests to the Algolia REST API. - * This method allow you to send requests to the Algolia REST API. - * @param path Path of the endpoint, anything after \"/1\" must be specified. - * @param parameters Query parameters to apply to the current query. - * @param body Parameters to send with the custom request. - * @param requestOptions additional request configuration. - */ - public suspend fun post(path: String, parameters: Map? = null, body: JsonObject? = null, requestOptions: RequestOptions? = null): JsonObject { - require(path.isNotBlank()) { "Parameter `path` is required when calling `post`." } - val requestConfig = RequestConfig( - method = RequestMethod.POST, - path = "/1{path}".replace("{path}", path), - query = buildMap { - parameters?.let { putAll(it) } - }, - body = body, - ) - return requester.execute( - requestConfig = requestConfig, - requestOptions = requestOptions, - ) - } - - /** - * Send requests to the Algolia REST API. - * This method allow you to send requests to the Algolia REST API. - * @param path Path of the endpoint, anything after \"/1\" must be specified. - * @param parameters Query parameters to apply to the current query. - * @param body Parameters to send with the custom request. - * @param requestOptions additional request configuration. - */ - public suspend fun put(path: String, parameters: Map? = null, body: JsonObject? = null, requestOptions: RequestOptions? = null): JsonObject { - require(path.isNotBlank()) { "Parameter `path` is required when calling `put`." } - val requestConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/1{path}".replace("{path}", path), - query = buildMap { - parameters?.let { putAll(it) } - }, - body = body, - ) - return requester.execute( - requestConfig = requestConfig, - requestOptions = requestOptions, - ) - } - - /** - * Update a model instance. - * Update a model’s configuration. - * @param modelID The ID of the model to retrieve. - * @param updateModelParams - * @param requestOptions additional request configuration. - */ - public suspend fun updateModelInstance(modelID: String, updateModelParams: UpdateModelParams, requestOptions: RequestOptions? = null): UpdateModelInstanceResponse { - require(modelID.isNotBlank()) { "Parameter `modelID` is required when calling `updateModelInstance`." } - val requestConfig = RequestConfig( - method = RequestMethod.POST, - path = listOf("1", "predict", "models", "$modelID"), - body = updateModelParams, - ) - return requester.execute( - requestConfig = requestConfig, - requestOptions = requestOptions, - ) - } - - /** - * Update segment. - * Update a segment’s configuration. - * @param segmentID The ID of the Segment to fetch. - * @param updateSegmentParams - * @param requestOptions additional request configuration. - */ - public suspend fun updateSegment(segmentID: String, updateSegmentParams: UpdateSegmentParams, requestOptions: RequestOptions? = null): UpdateSegmentResponse { - require(segmentID.isNotBlank()) { "Parameter `segmentID` is required when calling `updateSegment`." } - val requestConfig = RequestConfig( - method = RequestMethod.POST, - path = listOf("1", "segments", "$segmentID"), - body = updateSegmentParams, - ) - return requester.execute( - requestConfig = requestConfig, - requestOptions = requestOptions, - ) - } -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ActivateModelInstanceResponse.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ActivateModelInstanceResponse.kt deleted file mode 100644 index 0b2ff8df04..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ActivateModelInstanceResponse.kt +++ /dev/null @@ -1,21 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * ActivateModelInstanceResponse - * - * @param modelID The ID of the model. - * @param updatedAt Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - */ -@Serializable -public data class ActivateModelInstanceResponse( - - /** The ID of the model. */ - @SerialName(value = "modelID") val modelID: String, - - /** Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. */ - @SerialName(value = "updatedAt") val updatedAt: String, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ActivateModelParams.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ActivateModelParams.kt deleted file mode 100644 index 7ba8ad3f90..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ActivateModelParams.kt +++ /dev/null @@ -1,31 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * ActivateModelParams - * - * @param type - * @param name The model’s instance name. - * @param sourceID The data source ID, as returned by the (external) sources API. - * @param index The index name. - * @param modelAttributes - */ -@Serializable -public data class ActivateModelParams( - - @SerialName(value = "type") val type: ModelsToRetrieve, - - /** The model’s instance name. */ - @SerialName(value = "name") val name: String, - - /** The data source ID, as returned by the (external) sources API. */ - @SerialName(value = "sourceID") val sourceID: String, - - /** The index name. */ - @SerialName(value = "index") val index: String, - - @SerialName(value = "modelAttributes") val modelAttributes: List? = null, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Affinity.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Affinity.kt deleted file mode 100644 index 77b9d9c734..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Affinity.kt +++ /dev/null @@ -1,22 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * Affinity - * - * @param name - * @param `value` - * @param probability - */ -@Serializable -public data class Affinity( - - @SerialName(value = "name") val name: String, - - @SerialName(value = "value") val `value`: PredictionAffinityValue, - - @SerialName(value = "probability") val probability: Double, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/AllParams.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/AllParams.kt deleted file mode 100644 index 44052f3906..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/AllParams.kt +++ /dev/null @@ -1,19 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * AllParams - * - * @param modelsToRetrieve - * @param typesToRetrieve - */ -@Serializable -public data class AllParams( - - @SerialName(value = "modelsToRetrieve") val modelsToRetrieve: List? = null, - - @SerialName(value = "typesToRetrieve") val typesToRetrieve: List? = null, -) : Params diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/AllUpdateSegmentParams.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/AllUpdateSegmentParams.kt deleted file mode 100644 index be853f4120..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/AllUpdateSegmentParams.kt +++ /dev/null @@ -1,20 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * AllUpdateSegmentParams - * - * @param name The name or description of the segment. - * @param conditions - */ -@Serializable -public data class AllUpdateSegmentParams( - - /** The name or description of the segment. */ - @SerialName(value = "name") val name: String? = null, - - @SerialName(value = "conditions") val conditions: SegmentParentConditions? = null, -) : UpdateSegmentParams diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/CompatibleSources.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/CompatibleSources.kt deleted file mode 100644 index 02da4cc015..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/CompatibleSources.kt +++ /dev/null @@ -1,13 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* - -@Serializable -public enum class CompatibleSources(public val value: kotlin.String) { - - @SerialName(value = "bigquery") - Bigquery("bigquery"); - - override fun toString(): kotlin.String = value -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/CreateSegmentParams.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/CreateSegmentParams.kt deleted file mode 100644 index 593a57e150..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/CreateSegmentParams.kt +++ /dev/null @@ -1,20 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * CreateSegmentParams - * - * @param name The name or description of the segment. - * @param conditions - */ -@Serializable -public data class CreateSegmentParams( - - /** The name or description of the segment. */ - @SerialName(value = "name") val name: String, - - @SerialName(value = "conditions") val conditions: SegmentParentConditions, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/CreateSegmentResponse.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/CreateSegmentResponse.kt deleted file mode 100644 index 4e65221b08..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/CreateSegmentResponse.kt +++ /dev/null @@ -1,25 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * CreateSegmentResponse - * - * @param segmentID The ID of the segment. - * @param updatedAt The date and time at which the segment was updated (RFC3339). - * @param size The approximate number of users that matched the segment conditions when it was created, last updated, or when model inference last ran. - */ -@Serializable -public data class CreateSegmentResponse( - - /** The ID of the segment. */ - @SerialName(value = "segmentID") val segmentID: String, - - /** The date and time at which the segment was updated (RFC3339). */ - @SerialName(value = "updatedAt") val updatedAt: String, - - /** The approximate number of users that matched the segment conditions when it was created, last updated, or when model inference last ran. */ - @SerialName(value = "size") val size: Double? = null, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/DeleteModelInstanceResponse.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/DeleteModelInstanceResponse.kt deleted file mode 100644 index cbfd2f99ae..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/DeleteModelInstanceResponse.kt +++ /dev/null @@ -1,21 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * DeleteModelInstanceResponse - * - * @param modelID The ID of the model. - * @param deletedUntil The date until which you can safely consider the data as being deleted. - */ -@Serializable -public data class DeleteModelInstanceResponse( - - /** The ID of the model. */ - @SerialName(value = "modelID") val modelID: String, - - /** The date until which you can safely consider the data as being deleted. */ - @SerialName(value = "deletedUntil") val deletedUntil: String, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/DeleteSegmentResponse.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/DeleteSegmentResponse.kt deleted file mode 100644 index 607f510167..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/DeleteSegmentResponse.kt +++ /dev/null @@ -1,21 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * DeleteSegmentResponse - * - * @param segmentID The ID of the segment. - * @param deletedUntil The date and time at which the segment will be re-ingested. - */ -@Serializable -public data class DeleteSegmentResponse( - - /** The ID of the segment. */ - @SerialName(value = "segmentID") val segmentID: String, - - /** The date and time at which the segment will be re-ingested. */ - @SerialName(value = "deletedUntil") val deletedUntil: String, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/DeleteUserProfileResponse.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/DeleteUserProfileResponse.kt deleted file mode 100644 index 0f8ea80395..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/DeleteUserProfileResponse.kt +++ /dev/null @@ -1,21 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * DeleteUserProfileResponse - * - * @param user The ID of the user that was deleted. - * @param deletedUntil The time the same user ID will be imported again when the data is ingested. - */ -@Serializable -public data class DeleteUserProfileResponse( - - /** The ID of the user that was deleted. */ - @SerialName(value = "user") val user: String, - - /** The time the same user ID will be imported again when the data is ingested. */ - @SerialName(value = "deletedUntil") val deletedUntil: String, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Error.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Error.kt deleted file mode 100644 index ad667f8f81..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Error.kt +++ /dev/null @@ -1,16 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * The error when the model is not available. - * - * @param error - */ -@Serializable -public data class Error( - - @SerialName(value = "error") val error: String, -) : PredictionsAffinities, PredictionsOrderValue, PredictionsFunnelStage diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ErrorBase.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ErrorBase.kt deleted file mode 100644 index 1ed4d9d70f..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ErrorBase.kt +++ /dev/null @@ -1,46 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import com.algolia.client.extensions.internal.* -import kotlinx.serialization.* -import kotlinx.serialization.descriptors.* -import kotlinx.serialization.encoding.* -import kotlinx.serialization.json.* - -/** - * Error. - * - * @param message - */ -@Serializable(ErrorBaseSerializer::class) -public data class ErrorBase( - - val message: String? = null, - - val additionalProperties: Map? = null, -) - -internal object ErrorBaseSerializer : KSerializer { - - override val descriptor: SerialDescriptor = buildClassSerialDescriptor("ErrorBase") { - element("message") - } - - override fun deserialize(decoder: Decoder): ErrorBase { - val input = decoder.asJsonDecoder() - val tree = input.decodeJsonObject() - return ErrorBase( - message = tree["message"]?.let { input.json.decodeFromJsonElement(it) }, - additionalProperties = tree.filterKeys { it !in descriptor.elementNames }, - ) - } - - override fun serialize(encoder: Encoder, value: ErrorBase) { - val output = encoder.asJsonEncoder() - val json = buildJsonObject { - value.message?.let { put("message", output.json.encodeToJsonElement(it)) } - value.additionalProperties?.onEach { (key, element) -> put(key, element) } - } - (encoder as JsonEncoder).encodeJsonElement(json) - } -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/FetchAllUserProfilesParams.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/FetchAllUserProfilesParams.kt deleted file mode 100644 index 9b7747c429..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/FetchAllUserProfilesParams.kt +++ /dev/null @@ -1,147 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import com.algolia.client.exception.AlgoliaClientException -import com.algolia.client.extensions.internal.* -import kotlinx.serialization.* -import kotlinx.serialization.builtins.* -import kotlinx.serialization.descriptors.* -import kotlinx.serialization.encoding.* -import kotlinx.serialization.json.* - -/** - * FetchAllUserProfilesParams - */ -@Serializable(FetchAllUserProfilesParamsSerializer::class) -public sealed interface FetchAllUserProfilesParams { - - public companion object { - - /** - * LimitParam - * - * @param limit - */ - public fun LimitParam( - limit: Int? = null, - ): LimitParam = com.algolia.client.model.predict.LimitParam( - limit = limit, - ) - - /** - * ModelsToRetrieveParam - * - * @param modelsToRetrieve - */ - public fun ModelsToRetrieveParam( - modelsToRetrieve: List? = null, - ): ModelsToRetrieveParam = com.algolia.client.model.predict.ModelsToRetrieveParam( - modelsToRetrieve = modelsToRetrieve, - ) - - /** - * NextPageTokenParam - * - * @param 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. - */ - public fun NextPageTokenParam( - nextPageToken: String? = null, - ): NextPageTokenParam = com.algolia.client.model.predict.NextPageTokenParam( - nextPageToken = nextPageToken, - ) - - /** - * PreviousPageTokenParam - * - * @param 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. - */ - public fun PreviousPageTokenParam( - previousPageToken: String? = null, - ): PreviousPageTokenParam = com.algolia.client.model.predict.PreviousPageTokenParam( - previousPageToken = previousPageToken, - ) - - /** - * TypesToRetrieveParam - * - * @param typesToRetrieve - */ - public fun TypesToRetrieveParam( - typesToRetrieve: List? = null, - ): TypesToRetrieveParam = com.algolia.client.model.predict.TypesToRetrieveParam( - typesToRetrieve = typesToRetrieve, - ) - } -} - -internal class FetchAllUserProfilesParamsSerializer : KSerializer { - - override val descriptor: SerialDescriptor = buildClassSerialDescriptor("FetchAllUserProfilesParams") - - override fun serialize(encoder: Encoder, value: FetchAllUserProfilesParams) { - when (value) { - is LimitParam -> LimitParam.serializer().serialize(encoder, value) - is ModelsToRetrieveParam -> ModelsToRetrieveParam.serializer().serialize(encoder, value) - is NextPageTokenParam -> NextPageTokenParam.serializer().serialize(encoder, value) - is PreviousPageTokenParam -> PreviousPageTokenParam.serializer().serialize(encoder, value) - is TypesToRetrieveParam -> TypesToRetrieveParam.serializer().serialize(encoder, value) - } - } - - override fun deserialize(decoder: Decoder): FetchAllUserProfilesParams { - val codec = decoder.asJsonDecoder() - val tree = codec.decodeJsonElement() - - // deserialize LimitParam - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize LimitParam (error: ${e.message})") - } - } - - // deserialize ModelsToRetrieveParam - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize ModelsToRetrieveParam (error: ${e.message})") - } - } - - // deserialize NextPageTokenParam - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize NextPageTokenParam (error: ${e.message})") - } - } - - // deserialize PreviousPageTokenParam - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize PreviousPageTokenParam (error: ${e.message})") - } - } - - // deserialize TypesToRetrieveParam - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize TypesToRetrieveParam (error: ${e.message})") - } - } - - throw AlgoliaClientException("Failed to deserialize json element: $tree") - } -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/FetchAllUserProfilesResponse.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/FetchAllUserProfilesResponse.kt deleted file mode 100644 index 51abcce46c..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/FetchAllUserProfilesResponse.kt +++ /dev/null @@ -1,24 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * FetchAllUserProfilesResponse - * - * @param users - * @param 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. - * @param 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. - */ -@Serializable -public data class FetchAllUserProfilesResponse( - - @SerialName(value = "users") val users: List, - - /** 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. */ - @SerialName(value = "previousPageToken") val previousPageToken: String? = null, - - /** 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. */ - @SerialName(value = "nextPageToken") val nextPageToken: String? = null, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/FunnelStage.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/FunnelStage.kt deleted file mode 100644 index 097ae5766b..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/FunnelStage.kt +++ /dev/null @@ -1,19 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * FunnelStage - * - * @param name - * @param probability - */ -@Serializable -public data class FunnelStage( - - @SerialName(value = "name") val name: String, - - @SerialName(value = "probability") val probability: Double, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/GetAvailableModelTypesResponseInner.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/GetAvailableModelTypesResponseInner.kt deleted file mode 100644 index f4c6d148d7..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/GetAvailableModelTypesResponseInner.kt +++ /dev/null @@ -1,27 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * GetAvailableModelTypesResponseInner - * - * @param name Name of the model. - * @param type Description of the model. - * @param compatibleSources - * @param dataRequirements - */ -@Serializable -public data class GetAvailableModelTypesResponseInner( - - /** Name of the model. */ - @SerialName(value = "name") val name: String, - - /** Description of the model. */ - @SerialName(value = "type") val type: String, - - @SerialName(value = "compatibleSources") val compatibleSources: List, - - @SerialName(value = "dataRequirements") val dataRequirements: GetAvailableModelTypesResponseInnerDataRequirements, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/GetAvailableModelTypesResponseInnerDataRequirements.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/GetAvailableModelTypesResponseInnerDataRequirements.kt deleted file mode 100644 index a578d746d5..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/GetAvailableModelTypesResponseInnerDataRequirements.kt +++ /dev/null @@ -1,21 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * GetAvailableModelTypesResponseInnerDataRequirements - * - * @param minUsers Minimum number of users required for this model. - * @param minDays Minimum number of days model needs to run. - */ -@Serializable -public data class GetAvailableModelTypesResponseInnerDataRequirements( - - /** Minimum number of users required for this model. */ - @SerialName(value = "minUsers") val minUsers: Int, - - /** Minimum number of days model needs to run. */ - @SerialName(value = "minDays") val minDays: Int, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/GetModelInstanceConfigStatus.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/GetModelInstanceConfigStatus.kt deleted file mode 100644 index 50492ce531..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/GetModelInstanceConfigStatus.kt +++ /dev/null @@ -1,25 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* - -/** - * `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. - */ -@Serializable -public enum class GetModelInstanceConfigStatus(public val value: kotlin.String) { - - @SerialName(value = "pending") - Pending("pending"), - - @SerialName(value = "active") - Active("active"), - - @SerialName(value = "invalid") - Invalid("invalid"), - - @SerialName(value = "inactive") - Inactive("inactive"); - - override fun toString(): kotlin.String = value -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/GetModelMetricsResponse.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/GetModelMetricsResponse.kt deleted file mode 100644 index d3fac1faa0..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/GetModelMetricsResponse.kt +++ /dev/null @@ -1,20 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * GetModelMetricsResponse - * - * @param modelID The ID of the model. - * @param metrics - */ -@Serializable -public data class GetModelMetricsResponse( - - /** The ID of the model. */ - @SerialName(value = "modelID") val modelID: String, - - @SerialName(value = "metrics") val metrics: List, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/GetSegmentUsersResponse.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/GetSegmentUsersResponse.kt deleted file mode 100644 index 16ac8041ad..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/GetSegmentUsersResponse.kt +++ /dev/null @@ -1,28 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * GetSegmentUsersResponse - * - * @param segmentID The ID of the segment. - * @param users - * @param 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. - * @param 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. - */ -@Serializable -public data class GetSegmentUsersResponse( - - /** The ID of the segment. */ - @SerialName(value = "segmentID") val segmentID: String, - - @SerialName(value = "users") val users: List, - - /** 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. */ - @SerialName(value = "previousPageToken") val previousPageToken: String? = null, - - /** 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. */ - @SerialName(value = "nextPageToken") val nextPageToken: String? = null, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/LimitParam.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/LimitParam.kt deleted file mode 100644 index 65f0b21948..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/LimitParam.kt +++ /dev/null @@ -1,16 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * LimitParam - * - * @param limit - */ -@Serializable -public data class LimitParam( - - @SerialName(value = "limit") val limit: Int? = null, -) : FetchAllUserProfilesParams diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelAttributes.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelAttributes.kt deleted file mode 100644 index da5aac4f42..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelAttributes.kt +++ /dev/null @@ -1,19 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * ModelAttributes - * - * @param name - * @param values - */ -@Serializable -public data class ModelAttributes( - - @SerialName(value = "name") val name: String, - - @SerialName(value = "values") val values: List? = null, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelInstance.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelInstance.kt deleted file mode 100644 index ab49f4c6c6..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelInstance.kt +++ /dev/null @@ -1,47 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * ModelInstance - * - * @param modelID ID of the model. - * @param name Name of model instance. - * @param type - * @param sourceID - * @param index - * @param lastTrained The date and time this model instance was last trained. - * @param lastInference The date and time this model instance generated its last inference. - * @param modelStatus - * @param modelAttributes - * @param errorMessage - */ -@Serializable -public data class ModelInstance( - - /** ID of the model. */ - @SerialName(value = "modelID") val modelID: String, - - /** Name of model instance. */ - @SerialName(value = "name") val name: String, - - @SerialName(value = "type") val type: ModelsToRetrieve, - - @SerialName(value = "sourceID") val sourceID: String, - - @SerialName(value = "index") val index: String, - - /** The date and time this model instance was last trained. */ - @SerialName(value = "lastTrained") val lastTrained: String, - - /** The date and time this model instance generated its last inference. */ - @SerialName(value = "lastInference") val lastInference: String, - - @SerialName(value = "modelStatus") val modelStatus: GetModelInstanceConfigStatus, - - @SerialName(value = "modelAttributes") val modelAttributes: List? = null, - - @SerialName(value = "errorMessage") val errorMessage: String? = null, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelMetrics.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelMetrics.kt deleted file mode 100644 index cc80f82914..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelMetrics.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * ModelMetrics - * - * @param precision - * @param recall - * @param mrr - * @param coverage - * @param f1Score - * @param updatedAt Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - */ -@Serializable -public data class ModelMetrics( - - @SerialName(value = "precision") val precision: Double? = null, - - @SerialName(value = "recall") val recall: Double? = null, - - @SerialName(value = "mrr") val mrr: Double? = null, - - @SerialName(value = "coverage") val coverage: Double? = null, - - @SerialName(value = "f1_score") val f1Score: Double? = null, - - /** Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. */ - @SerialName(value = "updatedAt") val updatedAt: String? = null, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelStatus.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelStatus.kt deleted file mode 100644 index f316d22cfa..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelStatus.kt +++ /dev/null @@ -1,19 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* - -/** - * `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`. - */ -@Serializable -public enum class ModelStatus(public val value: kotlin.String) { - - @SerialName(value = "active") - Active("active"), - - @SerialName(value = "inactive") - Inactive("inactive"); - - override fun toString(): kotlin.String = value -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelsToRetrieve.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelsToRetrieve.kt deleted file mode 100644 index 318989a752..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelsToRetrieve.kt +++ /dev/null @@ -1,19 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* - -@Serializable -public enum class ModelsToRetrieve(public val value: kotlin.String) { - - @SerialName(value = "funnel_stage") - FunnelStage("funnel_stage"), - - @SerialName(value = "order_value") - OrderValue("order_value"), - - @SerialName(value = "affinities") - Affinities("affinities"); - - override fun toString(): kotlin.String = value -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelsToRetrieveParam.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelsToRetrieveParam.kt deleted file mode 100644 index 95bd6f5924..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/ModelsToRetrieveParam.kt +++ /dev/null @@ -1,16 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * ModelsToRetrieveParam - * - * @param modelsToRetrieve - */ -@Serializable -public data class ModelsToRetrieveParam( - - @SerialName(value = "modelsToRetrieve") val modelsToRetrieve: List? = null, -) : FetchAllUserProfilesParams, Params diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/NextPageTokenParam.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/NextPageTokenParam.kt deleted file mode 100644 index 78000b475f..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/NextPageTokenParam.kt +++ /dev/null @@ -1,17 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * NextPageTokenParam - * - * @param 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. - */ -@Serializable -public data class NextPageTokenParam( - - /** 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. */ - @SerialName(value = "nextPageToken") val nextPageToken: String? = null, -) : FetchAllUserProfilesParams diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Params.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Params.kt deleted file mode 100644 index 03e3644dcd..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Params.kt +++ /dev/null @@ -1,106 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import com.algolia.client.exception.AlgoliaClientException -import com.algolia.client.extensions.internal.* -import kotlinx.serialization.* -import kotlinx.serialization.builtins.* -import kotlinx.serialization.descriptors.* -import kotlinx.serialization.encoding.* -import kotlinx.serialization.json.* - -/** - * Params - */ -@Serializable(ParamsSerializer::class) -public sealed interface Params { - - public companion object { - - /** - * AllParams - * - * @param modelsToRetrieve - * @param typesToRetrieve - */ - public fun AllParams( - modelsToRetrieve: List? = null, - typesToRetrieve: List? = null, - ): AllParams = com.algolia.client.model.predict.AllParams( - modelsToRetrieve = modelsToRetrieve, - typesToRetrieve = typesToRetrieve, - ) - - /** - * ModelsToRetrieveParam - * - * @param modelsToRetrieve - */ - public fun ModelsToRetrieveParam( - modelsToRetrieve: List? = null, - ): ModelsToRetrieveParam = com.algolia.client.model.predict.ModelsToRetrieveParam( - modelsToRetrieve = modelsToRetrieve, - ) - - /** - * TypesToRetrieveParam - * - * @param typesToRetrieve - */ - public fun TypesToRetrieveParam( - typesToRetrieve: List? = null, - ): TypesToRetrieveParam = com.algolia.client.model.predict.TypesToRetrieveParam( - typesToRetrieve = typesToRetrieve, - ) - } -} - -internal class ParamsSerializer : KSerializer { - - override val descriptor: SerialDescriptor = buildClassSerialDescriptor("Params") - - override fun serialize(encoder: Encoder, value: Params) { - when (value) { - is AllParams -> AllParams.serializer().serialize(encoder, value) - is ModelsToRetrieveParam -> ModelsToRetrieveParam.serializer().serialize(encoder, value) - is TypesToRetrieveParam -> TypesToRetrieveParam.serializer().serialize(encoder, value) - } - } - - override fun deserialize(decoder: Decoder): Params { - val codec = decoder.asJsonDecoder() - val tree = codec.decodeJsonElement() - - // deserialize AllParams - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize AllParams (error: ${e.message})") - } - } - - // deserialize ModelsToRetrieveParam - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize ModelsToRetrieveParam (error: ${e.message})") - } - } - - // deserialize TypesToRetrieveParam - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize TypesToRetrieveParam (error: ${e.message})") - } - } - - throw AlgoliaClientException("Failed to deserialize json element: $tree") - } -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionAffinityValue.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionAffinityValue.kt deleted file mode 100644 index 395a59c220..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionAffinityValue.kt +++ /dev/null @@ -1,106 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import com.algolia.client.exception.AlgoliaClientException -import com.algolia.client.extensions.internal.* -import kotlinx.serialization.* -import kotlinx.serialization.builtins.* -import kotlinx.serialization.descriptors.* -import kotlinx.serialization.encoding.* -import kotlinx.serialization.json.* - -/** - * PredictionAffinityValue - */ -@Serializable(PredictionAffinityValueSerializer::class) -public sealed interface PredictionAffinityValue { - - public data class BooleanWrapper(val value: Boolean) : PredictionAffinityValue - - public data class DoubleWrapper(val value: Double) : PredictionAffinityValue - - public data class StringWrapper(val value: String) : PredictionAffinityValue - - public companion object { - - /** - * PredictionAffinityValue as Boolean - * - */ - public fun Boolean( - value: Boolean, - ): BooleanWrapper = BooleanWrapper( - value = value, - ) - - /** - * PredictionAffinityValue as Double - * - */ - public fun Number( - value: Double, - ): DoubleWrapper = DoubleWrapper( - value = value, - ) - - /** - * PredictionAffinityValue as String - * - */ - public fun String( - value: String, - ): StringWrapper = StringWrapper( - value = value, - ) - } -} - -internal class PredictionAffinityValueSerializer : KSerializer { - - override val descriptor: SerialDescriptor = buildClassSerialDescriptor("PredictionAffinityValue") - - override fun serialize(encoder: Encoder, value: PredictionAffinityValue) { - when (value) { - is PredictionAffinityValue.BooleanWrapper -> Boolean.serializer().serialize(encoder, value.value) - is PredictionAffinityValue.DoubleWrapper -> Double.serializer().serialize(encoder, value.value) - is PredictionAffinityValue.StringWrapper -> String.serializer().serialize(encoder, value.value) - } - } - - override fun deserialize(decoder: Decoder): PredictionAffinityValue { - val codec = decoder.asJsonDecoder() - val tree = codec.decodeJsonElement() - - // deserialize Boolean - if (tree is JsonPrimitive) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize Boolean (error: ${e.message})") - } - } - - // deserialize Double - if (tree is JsonPrimitive) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize Double (error: ${e.message})") - } - } - - // deserialize String - if (tree is JsonPrimitive) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize String (error: ${e.message})") - } - } - - throw AlgoliaClientException("Failed to deserialize json element: $tree") - } -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Predictions.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Predictions.kt deleted file mode 100644 index 7dd4bf392a..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Predictions.kt +++ /dev/null @@ -1,22 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * Predictions - * - * @param funnelStage - * @param orderValue - * @param affinities - */ -@Serializable -public data class Predictions( - - @SerialName(value = "funnel_stage") val funnelStage: PredictionsFunnelStage? = null, - - @SerialName(value = "order_value") val orderValue: PredictionsOrderValue? = null, - - @SerialName(value = "affinities") val affinities: PredictionsAffinities? = null, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsAffinities.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsAffinities.kt deleted file mode 100644 index 28e066f4eb..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsAffinities.kt +++ /dev/null @@ -1,84 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import com.algolia.client.exception.AlgoliaClientException -import com.algolia.client.extensions.internal.* -import kotlinx.serialization.* -import kotlinx.serialization.builtins.* -import kotlinx.serialization.descriptors.* -import kotlinx.serialization.encoding.* -import kotlinx.serialization.json.* - -/** - * PredictionsAffinities - */ -@Serializable(PredictionsAffinitiesSerializer::class) -public sealed interface PredictionsAffinities { - - public companion object { - - /** - * The error when the model is not available. - * - * @param error - */ - public fun Error( - error: String, - ): Error = com.algolia.client.model.predict.Error( - error = error, - ) - - /** - * Prediction for the **affinities** model. - * - * @param `value` - * @param lastUpdatedAt - */ - public fun PredictionsAffinitiesSuccess( - `value`: List, - lastUpdatedAt: String, - ): PredictionsAffinitiesSuccess = com.algolia.client.model.predict.PredictionsAffinitiesSuccess( - `value` = `value`, - lastUpdatedAt = lastUpdatedAt, - ) - } -} - -internal class PredictionsAffinitiesSerializer : KSerializer { - - override val descriptor: SerialDescriptor = buildClassSerialDescriptor("PredictionsAffinities") - - override fun serialize(encoder: Encoder, value: PredictionsAffinities) { - when (value) { - is Error -> Error.serializer().serialize(encoder, value) - is PredictionsAffinitiesSuccess -> PredictionsAffinitiesSuccess.serializer().serialize(encoder, value) - } - } - - override fun deserialize(decoder: Decoder): PredictionsAffinities { - val codec = decoder.asJsonDecoder() - val tree = codec.decodeJsonElement() - - // deserialize Error - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize Error (error: ${e.message})") - } - } - - // deserialize PredictionsAffinitiesSuccess - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize PredictionsAffinitiesSuccess (error: ${e.message})") - } - } - - throw AlgoliaClientException("Failed to deserialize json element: $tree") - } -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsAffinitiesSuccess.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsAffinitiesSuccess.kt deleted file mode 100644 index d4307cf833..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsAffinitiesSuccess.kt +++ /dev/null @@ -1,19 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * Prediction for the **affinities** model. - * - * @param `value` - * @param lastUpdatedAt - */ -@Serializable -public data class PredictionsAffinitiesSuccess( - - @SerialName(value = "value") val `value`: List, - - @SerialName(value = "lastUpdatedAt") val lastUpdatedAt: String, -) : PredictionsAffinities diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsFunnelStage.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsFunnelStage.kt deleted file mode 100644 index 51a39dd7a9..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsFunnelStage.kt +++ /dev/null @@ -1,84 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import com.algolia.client.exception.AlgoliaClientException -import com.algolia.client.extensions.internal.* -import kotlinx.serialization.* -import kotlinx.serialization.builtins.* -import kotlinx.serialization.descriptors.* -import kotlinx.serialization.encoding.* -import kotlinx.serialization.json.* - -/** - * PredictionsFunnelStage - */ -@Serializable(PredictionsFunnelStageSerializer::class) -public sealed interface PredictionsFunnelStage { - - public companion object { - - /** - * The error when the model is not available. - * - * @param error - */ - public fun Error( - error: String, - ): Error = com.algolia.client.model.predict.Error( - error = error, - ) - - /** - * Prediction for the **funnel_stage** model. - * - * @param `value` - * @param lastUpdatedAt - */ - public fun PredictionsFunnelStageSuccess( - `value`: List, - lastUpdatedAt: String, - ): PredictionsFunnelStageSuccess = com.algolia.client.model.predict.PredictionsFunnelStageSuccess( - `value` = `value`, - lastUpdatedAt = lastUpdatedAt, - ) - } -} - -internal class PredictionsFunnelStageSerializer : KSerializer { - - override val descriptor: SerialDescriptor = buildClassSerialDescriptor("PredictionsFunnelStage") - - override fun serialize(encoder: Encoder, value: PredictionsFunnelStage) { - when (value) { - is Error -> Error.serializer().serialize(encoder, value) - is PredictionsFunnelStageSuccess -> PredictionsFunnelStageSuccess.serializer().serialize(encoder, value) - } - } - - override fun deserialize(decoder: Decoder): PredictionsFunnelStage { - val codec = decoder.asJsonDecoder() - val tree = codec.decodeJsonElement() - - // deserialize Error - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize Error (error: ${e.message})") - } - } - - // deserialize PredictionsFunnelStageSuccess - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize PredictionsFunnelStageSuccess (error: ${e.message})") - } - } - - throw AlgoliaClientException("Failed to deserialize json element: $tree") - } -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsFunnelStageSuccess.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsFunnelStageSuccess.kt deleted file mode 100644 index f66d4b5183..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsFunnelStageSuccess.kt +++ /dev/null @@ -1,19 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * Prediction for the **funnel_stage** model. - * - * @param `value` - * @param lastUpdatedAt - */ -@Serializable -public data class PredictionsFunnelStageSuccess( - - @SerialName(value = "value") val `value`: List, - - @SerialName(value = "lastUpdatedAt") val lastUpdatedAt: String, -) : PredictionsFunnelStage diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsOrderValue.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsOrderValue.kt deleted file mode 100644 index 6b8a2ac987..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsOrderValue.kt +++ /dev/null @@ -1,84 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import com.algolia.client.exception.AlgoliaClientException -import com.algolia.client.extensions.internal.* -import kotlinx.serialization.* -import kotlinx.serialization.builtins.* -import kotlinx.serialization.descriptors.* -import kotlinx.serialization.encoding.* -import kotlinx.serialization.json.* - -/** - * PredictionsOrderValue - */ -@Serializable(PredictionsOrderValueSerializer::class) -public sealed interface PredictionsOrderValue { - - public companion object { - - /** - * The error when the model is not available. - * - * @param error - */ - public fun Error( - error: String, - ): Error = com.algolia.client.model.predict.Error( - error = error, - ) - - /** - * Prediction for the **order_value** model. - * - * @param `value` - * @param lastUpdatedAt - */ - public fun PredictionsOrderValueSuccess( - `value`: Double, - lastUpdatedAt: String, - ): PredictionsOrderValueSuccess = com.algolia.client.model.predict.PredictionsOrderValueSuccess( - `value` = `value`, - lastUpdatedAt = lastUpdatedAt, - ) - } -} - -internal class PredictionsOrderValueSerializer : KSerializer { - - override val descriptor: SerialDescriptor = buildClassSerialDescriptor("PredictionsOrderValue") - - override fun serialize(encoder: Encoder, value: PredictionsOrderValue) { - when (value) { - is Error -> Error.serializer().serialize(encoder, value) - is PredictionsOrderValueSuccess -> PredictionsOrderValueSuccess.serializer().serialize(encoder, value) - } - } - - override fun deserialize(decoder: Decoder): PredictionsOrderValue { - val codec = decoder.asJsonDecoder() - val tree = codec.decodeJsonElement() - - // deserialize Error - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize Error (error: ${e.message})") - } - } - - // deserialize PredictionsOrderValueSuccess - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize PredictionsOrderValueSuccess (error: ${e.message})") - } - } - - throw AlgoliaClientException("Failed to deserialize json element: $tree") - } -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsOrderValueSuccess.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsOrderValueSuccess.kt deleted file mode 100644 index fde097f67f..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PredictionsOrderValueSuccess.kt +++ /dev/null @@ -1,19 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * Prediction for the **order_value** model. - * - * @param `value` - * @param lastUpdatedAt - */ -@Serializable -public data class PredictionsOrderValueSuccess( - - @SerialName(value = "value") val `value`: Double, - - @SerialName(value = "lastUpdatedAt") val lastUpdatedAt: String, -) : PredictionsOrderValue diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PreviousPageTokenParam.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PreviousPageTokenParam.kt deleted file mode 100644 index 344e49ff7e..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/PreviousPageTokenParam.kt +++ /dev/null @@ -1,17 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * PreviousPageTokenParam - * - * @param 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. - */ -@Serializable -public data class PreviousPageTokenParam( - - /** 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. */ - @SerialName(value = "previousPageToken") val previousPageToken: String? = null, -) : FetchAllUserProfilesParams diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Properties.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Properties.kt deleted file mode 100644 index e2446604fa..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Properties.kt +++ /dev/null @@ -1,25 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * Properties for the user profile. - * - * @param raw Raw user properties (key-value pairs). - * @param computed Computed user properties (key-value pairs). - * @param custom Custom user properties (key-value pairs). - */ -@Serializable -public data class Properties( - - /** Raw user properties (key-value pairs). */ - @SerialName(value = "raw") val raw: JsonObject? = null, - - /** Computed user properties (key-value pairs). */ - @SerialName(value = "computed") val computed: JsonObject? = null, - - /** Custom user properties (key-value pairs). */ - @SerialName(value = "custom") val custom: JsonObject? = null, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Segment.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Segment.kt deleted file mode 100644 index 65ecb3d7f7..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Segment.kt +++ /dev/null @@ -1,41 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * Segment - * - * @param segmentID The ID of the segment. - * @param name The name of the segment. - * @param conditions - * @param size The approximate number of users that matched the segment conditions when it was created, last updated, or when model inference last ran. - * @param segmentStatus - * @param type - * @param lastUpdatedAt The date and time at which the segment was last updated (RFC3339). - * @param errorMessage - */ -@Serializable -public data class Segment( - - /** The ID of the segment. */ - @SerialName(value = "segmentID") val segmentID: String, - - /** The name of the segment. */ - @SerialName(value = "name") val name: String, - - @SerialName(value = "conditions") val conditions: SegmentParentConditions, - - /** The approximate number of users that matched the segment conditions when it was created, last updated, or when model inference last ran. */ - @SerialName(value = "size") val size: Double, - - @SerialName(value = "segmentStatus") val segmentStatus: SegmentStatus, - - @SerialName(value = "type") val type: SegmentType, - - /** The date and time at which the segment was last updated (RFC3339). */ - @SerialName(value = "lastUpdatedAt") val lastUpdatedAt: String, - - @SerialName(value = "errorMessage") val errorMessage: String? = null, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentAffinityFilter.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentAffinityFilter.kt deleted file mode 100644 index c0f8a62fff..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentAffinityFilter.kt +++ /dev/null @@ -1,22 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * Filter for affinity model predictions. - * - * @param `operator` - * @param `value` - * @param probability - */ -@Serializable -public data class SegmentAffinityFilter( - - @SerialName(value = "operator") val `operator`: SegmentFilterOperatorNumerical, - - @SerialName(value = "value") val `value`: SegmentAffinityFilterValue, - - @SerialName(value = "probability") val probability: SegmentFilterProbability? = null, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentAffinityFilterValue.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentAffinityFilterValue.kt deleted file mode 100644 index a9d8e57c4f..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentAffinityFilterValue.kt +++ /dev/null @@ -1,129 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import com.algolia.client.exception.AlgoliaClientException -import com.algolia.client.extensions.internal.* -import kotlinx.serialization.* -import kotlinx.serialization.builtins.* -import kotlinx.serialization.descriptors.* -import kotlinx.serialization.encoding.* -import kotlinx.serialization.json.* - -/** - * SegmentAffinityFilterValue - */ -@Serializable(SegmentAffinityFilterValueSerializer::class) -public sealed interface SegmentAffinityFilterValue { - - public data class BooleanWrapper(val value: Boolean) : SegmentAffinityFilterValue - - public data class DoubleWrapper(val value: Double) : SegmentAffinityFilterValue - - public data class ListOfStringWrapper(val value: List) : SegmentAffinityFilterValue - - public data class StringWrapper(val value: String) : SegmentAffinityFilterValue - - public companion object { - - /** - * SegmentAffinityFilterValue as Boolean - * - */ - public fun Boolean( - value: Boolean, - ): BooleanWrapper = BooleanWrapper( - value = value, - ) - - /** - * SegmentAffinityFilterValue as Double - * - */ - public fun Number( - value: Double, - ): DoubleWrapper = DoubleWrapper( - value = value, - ) - - /** - * SegmentAffinityFilterValue as List - * - */ - public fun ListOfString( - value: List, - ): ListOfStringWrapper = ListOfStringWrapper( - value = value, - ) - - /** - * SegmentAffinityFilterValue as String - * - */ - public fun String( - value: String, - ): StringWrapper = StringWrapper( - value = value, - ) - } -} - -internal class SegmentAffinityFilterValueSerializer : KSerializer { - - override val descriptor: SerialDescriptor = buildClassSerialDescriptor("SegmentAffinityFilterValue") - - override fun serialize(encoder: Encoder, value: SegmentAffinityFilterValue) { - when (value) { - is SegmentAffinityFilterValue.BooleanWrapper -> Boolean.serializer().serialize(encoder, value.value) - is SegmentAffinityFilterValue.DoubleWrapper -> Double.serializer().serialize(encoder, value.value) - is SegmentAffinityFilterValue.ListOfStringWrapper -> ListSerializer(String.serializer()).serialize(encoder, value.value) - is SegmentAffinityFilterValue.StringWrapper -> String.serializer().serialize(encoder, value.value) - } - } - - override fun deserialize(decoder: Decoder): SegmentAffinityFilterValue { - val codec = decoder.asJsonDecoder() - val tree = codec.decodeJsonElement() - - // deserialize Boolean - if (tree is JsonPrimitive) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize Boolean (error: ${e.message})") - } - } - - // deserialize Double - if (tree is JsonPrimitive) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize Double (error: ${e.message})") - } - } - - // deserialize List - if (tree is JsonArray) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize List (error: ${e.message})") - } - } - - // deserialize String - if (tree is JsonPrimitive) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize String (error: ${e.message})") - } - } - - throw AlgoliaClientException("Failed to deserialize json element: $tree") - } -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentChildConditionOperands.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentChildConditionOperands.kt deleted file mode 100644 index c30c224e18..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentChildConditionOperands.kt +++ /dev/null @@ -1,137 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import com.algolia.client.exception.AlgoliaClientException -import com.algolia.client.extensions.internal.* -import kotlinx.serialization.* -import kotlinx.serialization.builtins.* -import kotlinx.serialization.descriptors.* -import kotlinx.serialization.encoding.* -import kotlinx.serialization.json.* - -/** - * SegmentChildConditionOperands - */ -@Serializable(SegmentChildConditionOperandsSerializer::class) -public sealed interface SegmentChildConditionOperands { - - public companion object { - - /** - * Operand for affinity model predictions. - * - * @param name - * @param filters - */ - public fun SegmentOperandAffinity( - name: String, - filters: List, - ): SegmentOperandAffinity = com.algolia.client.model.predict.SegmentOperandAffinity( - name = name, - filters = filters, - ) - - /** - * Operand for funnel stage model predictions. - * - * @param name - * @param filters - */ - public fun SegmentOperandFunnelStage( - name: String, - filters: List, - ): SegmentOperandFunnelStage = com.algolia.client.model.predict.SegmentOperandFunnelStage( - name = name, - filters = filters, - ) - - /** - * Operand for order value model predictions. - * - * @param name - * @param filters - */ - public fun SegmentOperandOrderValue( - name: String, - filters: List, - ): SegmentOperandOrderValue = com.algolia.client.model.predict.SegmentOperandOrderValue( - name = name, - filters = filters, - ) - - /** - * Operand for user profile properties. - * - * @param name - * @param filters - */ - public fun SegmentOperandProperty( - name: String, - filters: List, - ): SegmentOperandProperty = com.algolia.client.model.predict.SegmentOperandProperty( - name = name, - filters = filters, - ) - } -} - -internal class SegmentChildConditionOperandsSerializer : KSerializer { - - override val descriptor: SerialDescriptor = buildClassSerialDescriptor("SegmentChildConditionOperands") - - override fun serialize(encoder: Encoder, value: SegmentChildConditionOperands) { - when (value) { - is SegmentOperandAffinity -> SegmentOperandAffinity.serializer().serialize(encoder, value) - is SegmentOperandFunnelStage -> SegmentOperandFunnelStage.serializer().serialize(encoder, value) - is SegmentOperandOrderValue -> SegmentOperandOrderValue.serializer().serialize(encoder, value) - is SegmentOperandProperty -> SegmentOperandProperty.serializer().serialize(encoder, value) - } - } - - override fun deserialize(decoder: Decoder): SegmentChildConditionOperands { - val codec = decoder.asJsonDecoder() - val tree = codec.decodeJsonElement() - - // deserialize SegmentOperandAffinity - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize SegmentOperandAffinity (error: ${e.message})") - } - } - - // deserialize SegmentOperandFunnelStage - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize SegmentOperandFunnelStage (error: ${e.message})") - } - } - - // deserialize SegmentOperandOrderValue - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize SegmentOperandOrderValue (error: ${e.message})") - } - } - - // deserialize SegmentOperandProperty - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize SegmentOperandProperty (error: ${e.message})") - } - } - - throw AlgoliaClientException("Failed to deserialize json element: $tree") - } -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentChildConditions.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentChildConditions.kt deleted file mode 100644 index fc347fd01f..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentChildConditions.kt +++ /dev/null @@ -1,19 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * Nested segment conditions that only contain operands. - * - * @param `operator` - * @param operands - */ -@Serializable -public data class SegmentChildConditions( - - @SerialName(value = "operator") val `operator`: SegmentConditionOperator, - - @SerialName(value = "operands") val operands: List, -) : SegmentParentConditionOperands diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentConditionOperator.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentConditionOperator.kt deleted file mode 100644 index e63bca2053..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentConditionOperator.kt +++ /dev/null @@ -1,19 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* - -/** - * Operator used to combine the operands. - */ -@Serializable -public enum class SegmentConditionOperator(public val value: kotlin.String) { - - @SerialName(value = "AND") - AND("AND"), - - @SerialName(value = "OR") - OR("OR"); - - override fun toString(): kotlin.String = value -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentConditionsParam.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentConditionsParam.kt deleted file mode 100644 index becfe9ef21..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentConditionsParam.kt +++ /dev/null @@ -1,16 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * SegmentConditionsParam - * - * @param conditions - */ -@Serializable -public data class SegmentConditionsParam( - - @SerialName(value = "conditions") val conditions: SegmentParentConditions? = null, -) : UpdateSegmentParams diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentFilterOperatorBoolean.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentFilterOperatorBoolean.kt deleted file mode 100644 index e84332a97e..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentFilterOperatorBoolean.kt +++ /dev/null @@ -1,19 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* - -/** - * The operator used on the boolean filter value. - */ -@Serializable -public enum class SegmentFilterOperatorBoolean(public val value: kotlin.String) { - - @SerialName(value = "EQ") - EQ("EQ"), - - @SerialName(value = "NEQ") - NEQ("NEQ"); - - override fun toString(): kotlin.String = value -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentFilterOperatorNumerical.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentFilterOperatorNumerical.kt deleted file mode 100644 index 006583c12a..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentFilterOperatorNumerical.kt +++ /dev/null @@ -1,31 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* - -/** - * The operator used on the numerical filter value. - */ -@Serializable -public enum class SegmentFilterOperatorNumerical(public val value: kotlin.String) { - - @SerialName(value = "EQ") - EQ("EQ"), - - @SerialName(value = "NEQ") - NEQ("NEQ"), - - @SerialName(value = "GT") - GT("GT"), - - @SerialName(value = "GTE") - GTE("GTE"), - - @SerialName(value = "LT") - LT("LT"), - - @SerialName(value = "LTE") - LTE("LTE"); - - override fun toString(): kotlin.String = value -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentFilterProbability.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentFilterProbability.kt deleted file mode 100644 index 8342220c2e..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentFilterProbability.kt +++ /dev/null @@ -1,25 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * Probability of the filter. - * - * @param lt - * @param lte - * @param gt - * @param gte - */ -@Serializable -public data class SegmentFilterProbability( - - @SerialName(value = "LT") val lt: Double? = null, - - @SerialName(value = "LTE") val lte: Double? = null, - - @SerialName(value = "GT") val gt: Double? = null, - - @SerialName(value = "GTE") val gte: Double? = null, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentFunnelStageFilter.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentFunnelStageFilter.kt deleted file mode 100644 index fa4215a010..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentFunnelStageFilter.kt +++ /dev/null @@ -1,22 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * Filter for funnel stage model predictions. - * - * @param `value` - * @param probability - * @param `operator` - */ -@Serializable -public data class SegmentFunnelStageFilter( - - @SerialName(value = "value") val `value`: String, - - @SerialName(value = "probability") val probability: SegmentFilterProbability, - - @SerialName(value = "operator") val `operator`: SegmentFilterOperatorBoolean? = null, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentNameParam.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentNameParam.kt deleted file mode 100644 index 974b00f4de..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentNameParam.kt +++ /dev/null @@ -1,17 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * SegmentNameParam - * - * @param name The name or description of the segment. - */ -@Serializable -public data class SegmentNameParam( - - /** The name or description of the segment. */ - @SerialName(value = "name") val name: String? = null, -) : UpdateSegmentParams diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentOperandAffinity.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentOperandAffinity.kt deleted file mode 100644 index 64cc2ed1f5..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentOperandAffinity.kt +++ /dev/null @@ -1,19 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * Operand for affinity model predictions. - * - * @param name - * @param filters - */ -@Serializable -public data class SegmentOperandAffinity( - - @SerialName(value = "name") val name: String, - - @SerialName(value = "filters") val filters: List, -) : SegmentParentConditionOperands, SegmentChildConditionOperands diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentOperandFunnelStage.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentOperandFunnelStage.kt deleted file mode 100644 index f6f63c3b26..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentOperandFunnelStage.kt +++ /dev/null @@ -1,19 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * Operand for funnel stage model predictions. - * - * @param name - * @param filters - */ -@Serializable -public data class SegmentOperandFunnelStage( - - @SerialName(value = "name") val name: String, - - @SerialName(value = "filters") val filters: List, -) : SegmentParentConditionOperands, SegmentChildConditionOperands diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentOperandOrderValue.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentOperandOrderValue.kt deleted file mode 100644 index e4a3f5628f..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentOperandOrderValue.kt +++ /dev/null @@ -1,19 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * Operand for order value model predictions. - * - * @param name - * @param filters - */ -@Serializable -public data class SegmentOperandOrderValue( - - @SerialName(value = "name") val name: String, - - @SerialName(value = "filters") val filters: List, -) : SegmentParentConditionOperands, SegmentChildConditionOperands diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentOperandProperty.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentOperandProperty.kt deleted file mode 100644 index 24623bc3a0..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentOperandProperty.kt +++ /dev/null @@ -1,19 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * Operand for user profile properties. - * - * @param name - * @param filters - */ -@Serializable -public data class SegmentOperandProperty( - - @SerialName(value = "name") val name: String, - - @SerialName(value = "filters") val filters: List, -) : SegmentParentConditionOperands, SegmentChildConditionOperands diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentOrderValueFilter.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentOrderValueFilter.kt deleted file mode 100644 index a62c0866a2..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentOrderValueFilter.kt +++ /dev/null @@ -1,19 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * Filter for order value model predictions. - * - * @param `value` - * @param `operator` - */ -@Serializable -public data class SegmentOrderValueFilter( - - @SerialName(value = "value") val `value`: Double, - - @SerialName(value = "operator") val `operator`: SegmentFilterOperatorNumerical? = null, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentParentConditionOperands.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentParentConditionOperands.kt deleted file mode 100644 index 4487a2c688..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentParentConditionOperands.kt +++ /dev/null @@ -1,162 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import com.algolia.client.exception.AlgoliaClientException -import com.algolia.client.extensions.internal.* -import kotlinx.serialization.* -import kotlinx.serialization.builtins.* -import kotlinx.serialization.descriptors.* -import kotlinx.serialization.encoding.* -import kotlinx.serialization.json.* - -/** - * SegmentParentConditionOperands - */ -@Serializable(SegmentParentConditionOperandsSerializer::class) -public sealed interface SegmentParentConditionOperands { - - public companion object { - - /** - * Nested segment conditions that only contain operands. - * - * @param `operator` - * @param operands - */ - public fun SegmentChildConditions( - `operator`: SegmentConditionOperator, - operands: List, - ): SegmentChildConditions = com.algolia.client.model.predict.SegmentChildConditions( - `operator` = `operator`, - operands = operands, - ) - - /** - * Operand for affinity model predictions. - * - * @param name - * @param filters - */ - public fun SegmentOperandAffinity( - name: String, - filters: List, - ): SegmentOperandAffinity = com.algolia.client.model.predict.SegmentOperandAffinity( - name = name, - filters = filters, - ) - - /** - * Operand for funnel stage model predictions. - * - * @param name - * @param filters - */ - public fun SegmentOperandFunnelStage( - name: String, - filters: List, - ): SegmentOperandFunnelStage = com.algolia.client.model.predict.SegmentOperandFunnelStage( - name = name, - filters = filters, - ) - - /** - * Operand for order value model predictions. - * - * @param name - * @param filters - */ - public fun SegmentOperandOrderValue( - name: String, - filters: List, - ): SegmentOperandOrderValue = com.algolia.client.model.predict.SegmentOperandOrderValue( - name = name, - filters = filters, - ) - - /** - * Operand for user profile properties. - * - * @param name - * @param filters - */ - public fun SegmentOperandProperty( - name: String, - filters: List, - ): SegmentOperandProperty = com.algolia.client.model.predict.SegmentOperandProperty( - name = name, - filters = filters, - ) - } -} - -internal class SegmentParentConditionOperandsSerializer : KSerializer { - - override val descriptor: SerialDescriptor = buildClassSerialDescriptor("SegmentParentConditionOperands") - - override fun serialize(encoder: Encoder, value: SegmentParentConditionOperands) { - when (value) { - is SegmentChildConditions -> SegmentChildConditions.serializer().serialize(encoder, value) - is SegmentOperandAffinity -> SegmentOperandAffinity.serializer().serialize(encoder, value) - is SegmentOperandFunnelStage -> SegmentOperandFunnelStage.serializer().serialize(encoder, value) - is SegmentOperandOrderValue -> SegmentOperandOrderValue.serializer().serialize(encoder, value) - is SegmentOperandProperty -> SegmentOperandProperty.serializer().serialize(encoder, value) - } - } - - override fun deserialize(decoder: Decoder): SegmentParentConditionOperands { - val codec = decoder.asJsonDecoder() - val tree = codec.decodeJsonElement() - - // deserialize SegmentChildConditions - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize SegmentChildConditions (error: ${e.message})") - } - } - - // deserialize SegmentOperandAffinity - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize SegmentOperandAffinity (error: ${e.message})") - } - } - - // deserialize SegmentOperandFunnelStage - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize SegmentOperandFunnelStage (error: ${e.message})") - } - } - - // deserialize SegmentOperandOrderValue - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize SegmentOperandOrderValue (error: ${e.message})") - } - } - - // deserialize SegmentOperandProperty - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize SegmentOperandProperty (error: ${e.message})") - } - } - - throw AlgoliaClientException("Failed to deserialize json element: $tree") - } -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentParentConditions.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentParentConditions.kt deleted file mode 100644 index 53996678c8..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentParentConditions.kt +++ /dev/null @@ -1,19 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * The conditions that define which user profiles are included in the segment. Can contain operands and a maximum of 1 level of nested conditions. - * - * @param `operator` - * @param operands - */ -@Serializable -public data class SegmentParentConditions( - - @SerialName(value = "operator") val `operator`: SegmentConditionOperator, - - @SerialName(value = "operands") val operands: List, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentPropertyFilter.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentPropertyFilter.kt deleted file mode 100644 index cbf8eb1e37..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentPropertyFilter.kt +++ /dev/null @@ -1,19 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * Filter for user profile properties. - * - * @param `value` - * @param `operator` - */ -@Serializable -public data class SegmentPropertyFilter( - - @SerialName(value = "value") val `value`: SegmentPropertyFilterValue, - - @SerialName(value = "operator") val `operator`: SegmentFilterOperatorNumerical? = null, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentPropertyFilterValue.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentPropertyFilterValue.kt deleted file mode 100644 index a97edfb26d..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentPropertyFilterValue.kt +++ /dev/null @@ -1,7 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -/** - * SegmentPropertyFilterValue - */ -public typealias SegmentPropertyFilterValue = SegmentAffinityFilterValue diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentStatus.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentStatus.kt deleted file mode 100644 index 78c2848ccd..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentStatus.kt +++ /dev/null @@ -1,22 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* - -/** - * The status of the segment. - */ -@Serializable -public enum class SegmentStatus(public val value: kotlin.String) { - - @SerialName(value = "active") - Active("active"), - - @SerialName(value = "pending") - Pending("pending"), - - @SerialName(value = "failed") - Failed("failed"); - - override fun toString(): kotlin.String = value -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentType.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentType.kt deleted file mode 100644 index f77529288c..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/SegmentType.kt +++ /dev/null @@ -1,19 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* - -/** - * The type of the segment. - */ -@Serializable -public enum class SegmentType(public val value: kotlin.String) { - - @SerialName(value = "computed") - Computed("computed"), - - @SerialName(value = "custom") - Custom("custom"); - - override fun toString(): kotlin.String = value -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Segments.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Segments.kt deleted file mode 100644 index 6aaefdfd50..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/Segments.kt +++ /dev/null @@ -1,21 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * Segments that the user belongs to. - * - * @param computed List of computed segments IDs. - * @param custom List of custom segments IDs. - */ -@Serializable -public data class Segments( - - /** List of computed segments IDs. */ - @SerialName(value = "computed") val computed: List, - - /** List of custom segments IDs. */ - @SerialName(value = "custom") val custom: List, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/TypesToRetrieve.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/TypesToRetrieve.kt deleted file mode 100644 index 61ab4d8a09..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/TypesToRetrieve.kt +++ /dev/null @@ -1,16 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* - -@Serializable -public enum class TypesToRetrieve(public val value: kotlin.String) { - - @SerialName(value = "properties") - Properties("properties"), - - @SerialName(value = "segments") - Segments("segments"); - - override fun toString(): kotlin.String = value -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/TypesToRetrieveParam.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/TypesToRetrieveParam.kt deleted file mode 100644 index 163ff652a2..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/TypesToRetrieveParam.kt +++ /dev/null @@ -1,16 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * TypesToRetrieveParam - * - * @param typesToRetrieve - */ -@Serializable -public data class TypesToRetrieveParam( - - @SerialName(value = "typesToRetrieve") val typesToRetrieve: List? = null, -) : FetchAllUserProfilesParams, Params diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/UpdateModelInstanceResponse.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/UpdateModelInstanceResponse.kt deleted file mode 100644 index e10a7c9fc6..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/UpdateModelInstanceResponse.kt +++ /dev/null @@ -1,21 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * UpdateModelInstanceResponse - * - * @param modelID The ID of the model. - * @param updatedAt Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - */ -@Serializable -public data class UpdateModelInstanceResponse( - - /** The ID of the model. */ - @SerialName(value = "modelID") val modelID: String, - - /** Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. */ - @SerialName(value = "updatedAt") val updatedAt: String, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/UpdateModelParams.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/UpdateModelParams.kt deleted file mode 100644 index 8f364a3948..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/UpdateModelParams.kt +++ /dev/null @@ -1,23 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * UpdateModelParams - * - * @param name The model’s instance name. - * @param modelAttributes - * @param modelStatus - */ -@Serializable -public data class UpdateModelParams( - - /** The model’s instance name. */ - @SerialName(value = "name") val name: String? = null, - - @SerialName(value = "modelAttributes") val modelAttributes: List? = null, - - @SerialName(value = "modelStatus") val modelStatus: ModelStatus? = null, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/UpdateSegmentParams.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/UpdateSegmentParams.kt deleted file mode 100644 index bfccacd3f3..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/UpdateSegmentParams.kt +++ /dev/null @@ -1,106 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import com.algolia.client.exception.AlgoliaClientException -import com.algolia.client.extensions.internal.* -import kotlinx.serialization.* -import kotlinx.serialization.builtins.* -import kotlinx.serialization.descriptors.* -import kotlinx.serialization.encoding.* -import kotlinx.serialization.json.* - -/** - * UpdateSegmentParams - */ -@Serializable(UpdateSegmentParamsSerializer::class) -public sealed interface UpdateSegmentParams { - - public companion object { - - /** - * AllUpdateSegmentParams - * - * @param name The name or description of the segment. - * @param conditions - */ - public fun AllUpdateSegmentParams( - name: String? = null, - conditions: SegmentParentConditions? = null, - ): AllUpdateSegmentParams = com.algolia.client.model.predict.AllUpdateSegmentParams( - name = name, - conditions = conditions, - ) - - /** - * SegmentConditionsParam - * - * @param conditions - */ - public fun SegmentConditionsParam( - conditions: SegmentParentConditions? = null, - ): SegmentConditionsParam = com.algolia.client.model.predict.SegmentConditionsParam( - conditions = conditions, - ) - - /** - * SegmentNameParam - * - * @param name The name or description of the segment. - */ - public fun SegmentNameParam( - name: String? = null, - ): SegmentNameParam = com.algolia.client.model.predict.SegmentNameParam( - name = name, - ) - } -} - -internal class UpdateSegmentParamsSerializer : KSerializer { - - override val descriptor: SerialDescriptor = buildClassSerialDescriptor("UpdateSegmentParams") - - override fun serialize(encoder: Encoder, value: UpdateSegmentParams) { - when (value) { - is AllUpdateSegmentParams -> AllUpdateSegmentParams.serializer().serialize(encoder, value) - is SegmentConditionsParam -> SegmentConditionsParam.serializer().serialize(encoder, value) - is SegmentNameParam -> SegmentNameParam.serializer().serialize(encoder, value) - } - } - - override fun deserialize(decoder: Decoder): UpdateSegmentParams { - val codec = decoder.asJsonDecoder() - val tree = codec.decodeJsonElement() - - // deserialize AllUpdateSegmentParams - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize AllUpdateSegmentParams (error: ${e.message})") - } - } - - // deserialize SegmentConditionsParam - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize SegmentConditionsParam (error: ${e.message})") - } - } - - // deserialize SegmentNameParam - if (tree is JsonObject) { - try { - return codec.json.decodeFromJsonElement(tree) - } catch (e: Exception) { - // deserialization failed, continue - println("Failed to deserialize SegmentNameParam (error: ${e.message})") - } - } - - throw AlgoliaClientException("Failed to deserialize json element: $tree") - } -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/UpdateSegmentResponse.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/UpdateSegmentResponse.kt deleted file mode 100644 index a8ce5960eb..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/UpdateSegmentResponse.kt +++ /dev/null @@ -1,25 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * UpdateSegmentResponse - * - * @param segmentID The ID of the segment. - * @param updatedAt The date and time at which the segment was updated (RFC3339). - * @param size The approximate number of users that matched the segment conditions when it was created, last updated, or when model inference last ran. - */ -@Serializable -public data class UpdateSegmentResponse( - - /** The ID of the segment. */ - @SerialName(value = "segmentID") val segmentID: String, - - /** The date and time at which the segment was updated (RFC3339). */ - @SerialName(value = "updatedAt") val updatedAt: String, - - /** The approximate number of users that matched the segment conditions when it was created, last updated, or when model inference last ran. */ - @SerialName(value = "size") val size: Double? = null, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/UserProfile.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/UserProfile.kt deleted file mode 100644 index 15721ff05e..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/predict/UserProfile.kt +++ /dev/null @@ -1,25 +0,0 @@ -/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ -package com.algolia.client.model.predict - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * UserProfile - * - * @param user - * @param predictions - * @param properties - * @param segments - */ -@Serializable -public data class UserProfile( - - @SerialName(value = "user") val user: String, - - @SerialName(value = "predictions") val predictions: Predictions? = null, - - @SerialName(value = "properties") val properties: Properties? = null, - - @SerialName(value = "segments") val segments: Segments? = null, -) diff --git a/config/openapitools.json b/config/openapitools.json index 89ac03ab0f..e278362f9f 100644 --- a/config/openapitools.json +++ b/config/openapitools.json @@ -29,9 +29,6 @@ "javascript-query-suggestions": { "output": "#{cwd}/clients/algoliasearch-client-javascript/packages/client-query-suggestions" }, - "javascript-predict": { - "output": "#{cwd}/clients/algoliasearch-client-javascript/packages/predict" - }, "javascript-ingestion": { "output": "#{cwd}/clients/algoliasearch-client-javascript/packages/ingestion" }, @@ -128,12 +125,6 @@ "packageName": "search" } }, - "go-predict": { - "output": "#{cwd}/clients/algoliasearch-client-go", - "additionalProperties": { - "packageName": "predict" - } - }, "go-monitoring": { "output": "#{cwd}/clients/algoliasearch-client-go", "additionalProperties": { @@ -161,9 +152,6 @@ "kotlin-query-suggestions": { "output": "#{cwd}/clients/algoliasearch-client-kotlin" }, - "kotlin-predict": { - "output": "#{cwd}/clients/algoliasearch-client-kotlin" - }, "kotlin-ingestion": { "output": "#{cwd}/clients/algoliasearch-client-kotlin" }, @@ -218,12 +206,6 @@ "packageVersion": "0.1.2" } }, - "dart-predict": { - "output": "#{cwd}/clients/algoliasearch-client-dart/packages/client_predict", - "additionalProperties": { - "packageVersion": "0.1.2" - } - }, "dart-ingestion": { "output": "#{cwd}/clients/algoliasearch-client-dart/packages/client_ingestion", "additionalProperties": { @@ -238,4 +220,4 @@ } } } -} \ No newline at end of file +} diff --git a/playground/go/main.go b/playground/go/main.go index 93a7e2ad88..b4d8e4ec83 100644 --- a/playground/go/main.go +++ b/playground/go/main.go @@ -25,7 +25,7 @@ func main() { os.Exit(1) } - //debug.Enable() + // debug.Enable() switch client { case "ingestion": @@ -38,8 +38,6 @@ func main() { returnCode = testInsights(appID, apiKey) case "personalization": returnCode = testPersonalization(appID, apiKey) - case "predict": - returnCode = testPredict(appID, apiKey) case "query-suggestions": returnCode = testQuerySuggestions(appID, apiKey) case "recommend": diff --git a/playground/go/predict.go b/playground/go/predict.go deleted file mode 100644 index 8005493d2b..0000000000 --- a/playground/go/predict.go +++ /dev/null @@ -1,27 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/algolia/algoliasearch-client-go/v4/algolia/predict" -) - -func testPredict(appID, apiKey string) int { - predictClient := predict.NewClient(appID, apiKey, predict.US) - - params := predict.AllParamsAsParams(predict.NewAllParams( - predict.WithAllParamsModelsToRetrieve(predict.AllowedModelsToRetrieveEnumValues), - predict.WithAllParamsTypesToRetrieve(predict.AllowedTypesToRetrieveEnumValues), - )) - userProfile, err := predictClient.FetchUserProfile( - predictClient.NewApiFetchUserProfileRequest("userId", ¶ms), - ) - if err != nil { - fmt.Printf("request error with FetchUserProfile: %v\n", err) - return 1 - } - - printResponse(userProfile) - - return 0 -} diff --git a/playground/javascript/node/package.json b/playground/javascript/node/package.json index 518d31ee95..a09e1cbc80 100644 --- a/playground/javascript/node/package.json +++ b/playground/javascript/node/package.json @@ -11,8 +11,7 @@ "start:query-suggestions": "ts-node query-suggestions.ts", "start:recommend": "ts-node recommend.ts", "start:search": "ts-node search.ts", - "start:sources": "ts-node sources.ts", - "start:predict": "ts-node predict.ts" + "start:sources": "ts-node sources.ts" }, "dependencies": { "@algolia/client-abtesting": "link:../../../clients/algoliasearch-client-javascript/packages/client-abtesting", @@ -23,7 +22,6 @@ "@algolia/client-query-suggestions": "link:../../../clients/algoliasearch-client-javascript/packages/client-query-suggestions", "@algolia/client-search": "link:../../../clients/algoliasearch-client-javascript/packages/client-search", "@algolia/ingestion": "link:../../../clients/algoliasearch-client-javascript/packages/ingestion", - "@algolia/predict": "link:../../../clients/algoliasearch-client-javascript/packages/predict", "@algolia/recommend": "link:../../../clients/algoliasearch-client-javascript/packages/recommend", "@algolia/requester-node-http": "link:../../../clients/algoliasearch-client-javascript/packages/requester-node-http", "algoliasearch": "link:../../../clients/algoliasearch-client-javascript/packages/algoliasearch" diff --git a/playground/javascript/node/predict.ts b/playground/javascript/node/predict.ts deleted file mode 100644 index 91b44c1b82..0000000000 --- a/playground/javascript/node/predict.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { predictClient } from '@algolia/predict'; -import { ApiError } from '@algolia/client-common'; -import dotenv from 'dotenv'; - -dotenv.config({ path: '../../.env' }); - -const appId = process.env.ALGOLIA_PREDICT_APP_ID || '**** APP_ID *****'; -const apiKey = - process.env.ALGOLIA_PREDICT_API_KEY || '**** PREDICT_API_KEY *****'; -const userId = process.env.ALGOLIA_PREDICT_USER_ID || 'user1'; - -// Init client with appId and apiKey -const client = predictClient(appId, apiKey, 'eu'); - -async function testPredict() { - try { - const userProfile = await client.fetchUserProfile({ - userID: userId, - params: { - modelsToRetrieve: ['funnel_stage', 'order_value', 'affinities'], - typesToRetrieve: ['properties', 'segments'], - }, - }); - - console.log(`[OK]`, userProfile); - } catch (e) { - if (e instanceof ApiError) { - return console.log(`[${e.status}] ${e.message}`, e.stackTrace); - } - - console.log('[ERROR]', e); - } -} - -testPredict(); diff --git a/playground/kotlin/src/main/kotlin/com/algolia/playground/Predict.kt b/playground/kotlin/src/main/kotlin/com/algolia/playground/Predict.kt deleted file mode 100644 index e87a4c1f6d..0000000000 --- a/playground/kotlin/src/main/kotlin/com/algolia/playground/Predict.kt +++ /dev/null @@ -1,54 +0,0 @@ -package com.algolia.playground - -import com.algolia.client.api.PredictClient -import com.algolia.client.configuration.ClientOptions -import com.algolia.client.model.predict.* -import io.github.cdimascio.dotenv.Dotenv -import io.ktor.client.plugins.logging.* -import kotlin.system.exitProcess - -suspend fun main() { - val dotenv = Dotenv.configure().directory("../").load() - - val client = PredictClient( - appId = dotenv["ALGOLIA_PREDICT_APP_ID"], - apiKey = dotenv["ALGOLIA_PREDICT_KEY"], - region = "us", - options = ClientOptions(logLevel = LogLevel.BODY), - ) - - val updateSegment = client.updateSegment( - segmentID = "segment1", - updateSegmentParams = SegmentConditionsParam( - conditions = SegmentParentConditions( - operator = SegmentConditionOperator.values().first { it.value == "AND" }, - operands = listOf( - SegmentOperandAffinity( - name = "predictions.order_value", - filters = listOf( - SegmentAffinityFilter( - operator = SegmentFilterOperatorNumerical.values().first { it.value == "GT" }, - value = SegmentAffinityFilterValue.Number(200.0), - ), - ), - ), - ), - ), - ), - ) - println(updateSegment) - - //val userProfile = client.fetchUserProfile( - // userID = userId, params = AllParams( - // modelsToRetrieve = listOf( - // ModelsToRetrieve.FunnelStage, - // ModelsToRetrieve.OrderValue, - // ModelsToRetrieve.Affinities, - // ), - // typesToRetrieve = listOf(TypesToRetrieve.Properties, TypesToRetrieve.Segments), - // ) - //) - //println(userProfile) - - exitProcess(0) -} diff --git a/renovate.json b/renovate.json index a35b49cc98..b7262a4c08 100644 --- a/renovate.json +++ b/renovate.json @@ -176,7 +176,6 @@ "**/client-search/**", "**/client_search/**", "**/ingestion/**", - "**/predict/**", "**/recommend/**", "clients/algoliasearch-client-php/composer.json", "tests/output/dart/**", diff --git a/scripts/release/text.ts b/scripts/release/text.ts index 4336f582ff..a70b75b810 100644 --- a/scripts/release/text.ts +++ b/scripts/release/text.ts @@ -20,7 +20,7 @@ export default { * @algolia/client-search@5.0.0 -> 5.0.1 * @algolia/client-abtesting@5.0.0 -> 5.0.1 * ... - * @algolia/predict@0.0.1 -> 0.0.2 + * @algolia/ingestion@0.0.1 -> 0.0.2 * ... * @algolia/requester-browser-xhr@0.0.5 -> 0.0.6. diff --git a/specs/bundled/ingestion.yml b/specs/bundled/ingestion.yml index 375d66edd8..dc509e54dc 100644 --- a/specs/bundled/ingestion.yml +++ b/specs/bundled/ingestion.yml @@ -99,7 +99,7 @@ components: type: array items: $ref: '#/components/schemas/DestinationType' - example: search,predict + example: search authenticationID: name: authenticationID in: query diff --git a/specs/bundled/predict.yml b/specs/bundled/predict.yml deleted file mode 100644 index 07149097cd..0000000000 --- a/specs/bundled/predict.yml +++ /dev/null @@ -1,1557 +0,0 @@ -openapi: 3.0.2 -info: - title: Predict API - description: API powering the Predict feature of Algolia. - version: 1.0.0 -components: - securitySchemes: - appId: - type: apiKey - in: header - name: X-Algolia-Application-Id - apiKey: - type: apiKey - in: header - name: X-Algolia-API-Key - parameters: - PathInPath: - name: path - in: path - description: Path of the endpoint, anything after "/1" must be specified. - required: true - schema: - type: string - example: /keys - Parameters: - name: parameters - in: query - description: Query parameters to apply to the current query. - schema: - type: object - additionalProperties: true - userID: - name: userID - in: path - required: true - schema: - type: string - description: >- - User ID for authenticated users or cookie ID for non-authenticated - repeated users (visitors). - modelID: - name: modelID - in: path - required: true - schema: - type: string - description: The ID of the model to retrieve. - segmentID: - name: segmentID - in: path - required: true - schema: - type: string - description: The ID of the Segment to fetch. - type: - name: type - in: query - schema: - $ref: '#/components/schemas/segmentType' - description: The type of segments to fetch. - schemas: - ErrorBase: - description: Error. - type: object - additionalProperties: true - properties: - message: - type: string - example: Invalid Application-Id or API-Key - modelsToRetrieve: - type: string - enum: - - funnel_stage - - order_value - - affinities - modelsToRetrieveParam: - type: object - required: - - modelsToRetrieveParam - properties: - modelsToRetrieve: - type: array - items: - $ref: '#/components/schemas/modelsToRetrieve' - typesToRetrieve: - type: string - enum: - - properties - - segments - typesToRetrieveParam: - type: object - required: - - typesToRetrieveParam - properties: - typesToRetrieve: - type: array - items: - $ref: '#/components/schemas/typesToRetrieve' - allParams: - allOf: - - $ref: '#/components/schemas/modelsToRetrieveParam' - - $ref: '#/components/schemas/typesToRetrieveParam' - params: - oneOf: - - $ref: '#/components/schemas/modelsToRetrieveParam' - - $ref: '#/components/schemas/typesToRetrieveParam' - - $ref: '#/components/schemas/allParams' - predictionsFunnelStageSuccess: - type: object - description: Prediction for the **funnel_stage** model. - properties: - value: - type: array - items: - title: funnel_stage - type: object - properties: - name: - type: string - probability: - type: number - format: double - minimum: 0 - maximum: 1 - required: - - name - - probability - lastUpdatedAt: - type: string - required: - - value - - lastUpdatedAt - error: - type: object - description: The error when the model is not available. - properties: - error: - type: string - required: - - error - predictionsFunnelStage: - oneOf: - - $ref: '#/components/schemas/predictionsFunnelStageSuccess' - - $ref: '#/components/schemas/error' - predictionsOrderValueSuccess: - type: object - description: Prediction for the **order_value** model. - properties: - value: - type: number - format: double - minimum: 0 - lastUpdatedAt: - type: string - required: - - value - - lastUpdatedAt - predictionsOrderValue: - oneOf: - - $ref: '#/components/schemas/predictionsOrderValueSuccess' - - $ref: '#/components/schemas/error' - predictionAffinityValue: - oneOf: - - type: string - - type: number - format: double - - type: boolean - predictionsAffinitiesSuccess: - type: object - description: Prediction for the **affinities** model. - properties: - value: - type: array - items: - title: affinity - type: object - properties: - name: - type: string - value: - $ref: '#/components/schemas/predictionAffinityValue' - probability: - type: number - format: double - minimum: 0 - maximum: 1 - required: - - name - - value - - probability - lastUpdatedAt: - type: string - required: - - value - - lastUpdatedAt - predictionsAffinities: - oneOf: - - $ref: '#/components/schemas/predictionsAffinitiesSuccess' - - $ref: '#/components/schemas/error' - userProfile: - type: object - required: - - user - properties: - user: - type: string - predictions: - type: object - title: predictions - properties: - funnel_stage: - $ref: '#/components/schemas/predictionsFunnelStage' - order_value: - $ref: '#/components/schemas/predictionsOrderValue' - affinities: - $ref: '#/components/schemas/predictionsAffinities' - properties: - type: object - title: properties - description: Properties for the user profile. - properties: - raw: - type: object - description: Raw user properties (key-value pairs). - computed: - type: object - description: Computed user properties (key-value pairs). - custom: - type: object - description: Custom user properties (key-value pairs). - segments: - type: object - title: segments - required: - - computed - - custom - description: Segments that the user belongs to. - properties: - computed: - type: array - description: List of computed segments IDs. - items: - type: string - custom: - type: array - description: List of custom segments IDs. - items: - type: string - nextPageToken: - type: string - description: >- - 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. - nextPageTokenParam: - type: object - properties: - nextPageToken: - $ref: '#/components/schemas/nextPageToken' - previousPageToken: - type: string - description: >- - 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. - previousPageTokenParam: - type: object - properties: - previousPageToken: - $ref: '#/components/schemas/previousPageToken' - limit: - type: integer - limitParam: - type: object - properties: - limit: - $ref: '#/components/schemas/limit' - fetchAllUserProfilesParams: - oneOf: - - $ref: '#/components/schemas/modelsToRetrieveParam' - - $ref: '#/components/schemas/typesToRetrieveParam' - - $ref: '#/components/schemas/nextPageTokenParam' - - $ref: '#/components/schemas/previousPageTokenParam' - - $ref: '#/components/schemas/limitParam' - compatibleSources: - type: string - enum: - - bigquery - modelAttributes: - type: object - additionalProperties: false - properties: - name: - type: string - values: - type: array - items: - type: string - required: - - name - getModelInstanceConfigStatus: - type: string - enum: - - pending - - active - - invalid - - inactive - description: > - `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. - modelInstance: - type: object - additionalProperties: false - properties: - modelID: - type: string - description: ID of the model. - name: - type: string - description: Name of model instance. - type: - $ref: '#/components/schemas/modelsToRetrieve' - description: Type of the model. - sourceID: - type: string - index: - type: string - modelAttributes: - type: array - items: - $ref: '#/components/schemas/modelAttributes' - lastTrained: - type: string - description: The date and time this model instance was last trained. - lastInference: - type: string - description: The date and time this model instance generated its last inference. - errorMessage: - type: string - modelStatus: - type: string - $ref: '#/components/schemas/getModelInstanceConfigStatus' - required: - - modelID - - name - - type - - sourceID - - index - - lastTrained - - lastInference - - modelStatus - name: - type: string - description: The model’s instance name. - modelsParams_modelAttributes: - type: string - description: >- - List of items attributes that will be used in the model. This param is - required if the model `type` needs it (e.g. `affinities`, - `funnel_stage`). - modelStatus: - type: string - enum: - - active - - inactive - description: > - `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`. - updateModelParams: - type: object - properties: - name: - $ref: '#/components/schemas/name' - modelAttributes: - type: array - items: - $ref: '#/components/schemas/modelsParams_modelAttributes' - modelStatus: - $ref: '#/components/schemas/modelStatus' - updatedAt: - type: string - example: '2023-07-04T12:49:15Z' - description: >- - Timestamp of the last update in [ISO - 8601](https://wikipedia.org/wiki/ISO_8601) format. - sourceID: - type: string - description: The data source ID, as returned by the (external) sources API. - index: - type: string - description: The index name. - activateModelParams: - type: object - properties: - type: - $ref: '#/components/schemas/modelsToRetrieve' - name: - $ref: '#/components/schemas/name' - sourceID: - $ref: '#/components/schemas/sourceID' - index: - $ref: '#/components/schemas/index' - modelAttributes: - type: array - items: - $ref: '#/components/schemas/modelsParams_modelAttributes' - required: - - type - - name - - sourceID - - index - modelMetrics: - type: object - additionalProperties: false - properties: - precision: - type: number - format: double - recall: - type: number - format: double - mrr: - type: number - format: double - coverage: - type: number - format: double - f1_score: - type: number - format: double - updatedAt: - $ref: '#/components/schemas/updatedAt' - segmentID: - type: string - description: The ID of the segment. - getSegmentUsersResponse: - title: getSegmentUsersResponse - type: object - required: - - segmentID - - users - properties: - segmentID: - $ref: '#/components/schemas/segmentID' - users: - type: array - items: - $ref: '#/components/schemas/userProfile' - previousPageToken: - $ref: '#/components/schemas/previousPageToken' - nextPageToken: - $ref: '#/components/schemas/nextPageToken' - segmentName: - type: string - description: The name of the segment. - segmentConditionOperator: - description: Operator used to combine the operands. - type: string - enum: - - AND - - OR - segmentFilterOperatorNumerical: - description: The operator used on the numerical filter value. - type: string - default: EQ - enum: - - EQ - - NEQ - - GT - - GTE - - LT - - LTE - segmentAffinityFilterValue: - oneOf: - - type: string - - type: number - format: float - - type: array - items: - type: string - - type: boolean - segmentFilterProbability: - description: Probability of the filter. - type: object - minProperties: 1 - maxProperties: 2 - properties: - LT: - type: number - LTE: - type: number - GT: - type: number - GTE: - type: number - segmentAffinityFilter: - description: Filter for affinity model predictions. - type: object - required: - - value - - operator - properties: - operator: - $ref: '#/components/schemas/segmentFilterOperatorNumerical' - value: - $ref: '#/components/schemas/segmentAffinityFilterValue' - probability: - $ref: '#/components/schemas/segmentFilterProbability' - segmentOperandAffinity: - description: Operand for affinity model predictions. - type: object - required: - - name - - filters - properties: - name: - type: string - pattern: ^predictions\.affinities\.\w+$ - example: predictions.affinities.color - filters: - type: array - minItems: 1 - items: - $ref: '#/components/schemas/segmentAffinityFilter' - segmentFilterOperatorBoolean: - description: The operator used on the boolean filter value. - type: string - default: EQ - enum: - - EQ - - NEQ - segmentFunnelStageFilter: - description: Filter for funnel stage model predictions. - type: object - required: - - value - - probability - properties: - operator: - $ref: '#/components/schemas/segmentFilterOperatorBoolean' - value: - type: string - probability: - $ref: '#/components/schemas/segmentFilterProbability' - segmentOperandFunnelStage: - description: Operand for funnel stage model predictions. - type: object - required: - - name - - filters - properties: - name: - type: string - pattern: ^predictions\.funnel_stage$ - example: predictions.funnel_stage - filters: - type: array - minItems: 1 - items: - $ref: '#/components/schemas/segmentFunnelStageFilter' - segmentOrderValueFilter: - description: Filter for order value model predictions. - type: object - required: - - value - properties: - operator: - $ref: '#/components/schemas/segmentFilterOperatorNumerical' - value: - type: number - segmentOperandOrderValue: - description: Operand for order value model predictions. - type: object - required: - - name - - filters - properties: - name: - type: string - pattern: ^predictions\.order_value$ - example: predictions.order_value - filters: - type: array - minItems: 1 - items: - $ref: '#/components/schemas/segmentOrderValueFilter' - segmentPropertyFilterValue: - allOf: - - $ref: '#/components/schemas/segmentAffinityFilterValue' - segmentPropertyFilter: - description: Filter for user profile properties. - type: object - required: - - value - properties: - operator: - $ref: '#/components/schemas/segmentFilterOperatorNumerical' - value: - $ref: '#/components/schemas/segmentPropertyFilterValue' - segmentOperandProperty: - description: Operand for user profile properties. - type: object - required: - - name - - filters - properties: - name: - type: string - pattern: ^properties\.(raw|computed|custom)\.\w+$ - example: properties.raw.age - filters: - type: array - minItems: 1 - items: - $ref: '#/components/schemas/segmentPropertyFilter' - segmentChildConditionOperands: - oneOf: - - $ref: '#/components/schemas/segmentOperandAffinity' - - $ref: '#/components/schemas/segmentOperandFunnelStage' - - $ref: '#/components/schemas/segmentOperandOrderValue' - - $ref: '#/components/schemas/segmentOperandProperty' - segmentChildConditions: - description: Nested segment conditions that only contain operands. - type: object - required: - - operator - - operands - properties: - operator: - $ref: '#/components/schemas/segmentConditionOperator' - operands: - type: array - items: - $ref: '#/components/schemas/segmentChildConditionOperands' - segmentParentConditionOperands: - oneOf: - - $ref: '#/components/schemas/segmentChildConditions' - - $ref: '#/components/schemas/segmentOperandAffinity' - - $ref: '#/components/schemas/segmentOperandFunnelStage' - - $ref: '#/components/schemas/segmentOperandOrderValue' - - $ref: '#/components/schemas/segmentOperandProperty' - segmentParentConditions: - description: > - The conditions that define which user profiles are included in the - segment. - - - Can contain operands and a maximum of 1 level of nested conditions. - type: object - required: - - operator - - operands - properties: - operator: - $ref: '#/components/schemas/segmentConditionOperator' - operands: - type: array - items: - $ref: '#/components/schemas/segmentParentConditionOperands' - segmentSize: - type: number - format: int64 - description: >- - The approximate number of users that matched the segment conditions when - it was created, last updated, or when model inference last ran. - segmentStatus: - type: string - description: The status of the segment. - enum: - - active - - pending - - failed - segmentType: - type: string - description: The type of the segment. - enum: - - computed - - custom - lastUpdatedAt: - type: string - description: The date and time at which the segment was last updated (RFC3339). - example: '2021-07-22T12:30:00Z' - segment: - type: object - required: - - segmentID - - name - - conditions - - size - - segmentStatus - - type - - lastUpdatedAt - properties: - segmentID: - $ref: '#/components/schemas/segmentID' - name: - $ref: '#/components/schemas/segmentName' - conditions: - $ref: '#/components/schemas/segmentParentConditions' - size: - $ref: '#/components/schemas/segmentSize' - segmentStatus: - $ref: '#/components/schemas/segmentStatus' - type: - $ref: '#/components/schemas/segmentType' - lastUpdatedAt: - $ref: '#/components/schemas/lastUpdatedAt' - errorMessage: - type: string - SegmentsParams_name: - type: string - description: The name or description of the segment. - segmentNameParam: - type: object - properties: - name: - $ref: '#/components/schemas/SegmentsParams_name' - segmentConditionsParam: - type: object - properties: - conditions: - $ref: '#/components/schemas/segmentParentConditions' - allUpdateSegmentParams: - allOf: - - $ref: '#/components/schemas/segmentNameParam' - - $ref: '#/components/schemas/segmentConditionsParam' - updateSegmentParams: - oneOf: - - $ref: '#/components/schemas/segmentNameParam' - - $ref: '#/components/schemas/segmentConditionsParam' - - $ref: '#/components/schemas/allUpdateSegmentParams' - Segment_updatedAt: - type: string - description: The date and time at which the segment was updated (RFC3339). - example: '2021-07-22T12:30:00Z' - updateSegmentResponse: - title: updateSegmentResponse - type: object - required: - - segmentID - - updatedAt - properties: - segmentID: - $ref: '#/components/schemas/segmentID' - size: - $ref: '#/components/schemas/segmentSize' - updatedAt: - $ref: '#/components/schemas/Segment_updatedAt' - deletedUntil: - type: string - description: The date and time at which the segment will be re-ingested. - example: '2021-07-22T12:30:00Z' - deleteSegmentResponse: - title: deleteSegmentResponse - type: object - required: - - segmentID - - deletedUntil - properties: - segmentID: - $ref: '#/components/schemas/segmentID' - deletedUntil: - $ref: '#/components/schemas/deletedUntil' - fetchAllSegmentsResponse: - title: fetchAllSegmentsResponse - type: array - items: - $ref: '#/components/schemas/segment' - createSegmentParams: - type: object - required: - - name - - conditions - properties: - name: - $ref: '#/components/schemas/SegmentsParams_name' - conditions: - $ref: '#/components/schemas/segmentParentConditions' - createSegmentResponse: - title: createSegmentResponse - type: object - required: - - segmentID - - updatedAt - properties: - segmentID: - $ref: '#/components/schemas/segmentID' - size: - $ref: '#/components/schemas/segmentSize' - updatedAt: - $ref: '#/components/schemas/Segment_updatedAt' - responses: - BadRequest: - description: Bad request or request arguments. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBase' - FeatureNotEnabled: - description: This feature is not enabled on your Algolia account. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBase' - MethodNotAllowed: - description: Method not allowed with this API key. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBase' - IndexNotFound: - description: Index not found. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBase' - UserNotFound: - description: User not found. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBase' - InvalidCredentials: - description: Invalid credentials. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBase' - InternalError: - description: Internal error. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBase' - UnprocessableEntity: - description: Unprocessable Entity. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBase' - Unauthorized: - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBase' - StatusUnprocessableEntity: - description: Unprocessable Entity. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBase' -servers: - - url: https://predict.{region}.algolia.com - variables: - region: - enum: - - eu - - us - default: eu - description: | - Region where your Predict data is stored and processed: - * `eu` - Europe - * `us` - United States. -security: - - appId: [] - apiKey: [] -tags: - - name: models - x-displayName: Models - description: Manage models. - - name: profiles - x-displayName: Profiles - description: Manage users' profiles. - - name: segments - x-displayName: Segments - description: Manage segments. -x-tagGroups: - - name: General - tags: - - profiles - - models - - segments -paths: - /1{path}: - get: - operationId: get - summary: Send requests to the Algolia REST API. - description: This method allow you to send requests to the Algolia REST API. - parameters: - - $ref: '#/components/parameters/PathInPath' - - $ref: '#/components/parameters/Parameters' - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - '400': - $ref: '#/components/responses/BadRequest' - '402': - $ref: '#/components/responses/FeatureNotEnabled' - '403': - $ref: '#/components/responses/MethodNotAllowed' - '404': - $ref: '#/components/responses/IndexNotFound' - tags: - - predict - post: - operationId: post - requestBody: - description: Parameters to send with the custom request. - content: - application/json: - schema: - type: object - summary: Send requests to the Algolia REST API. - description: This method allow you to send requests to the Algolia REST API. - parameters: - - $ref: '#/components/parameters/PathInPath' - - $ref: '#/components/parameters/Parameters' - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - '400': - $ref: '#/components/responses/BadRequest' - '402': - $ref: '#/components/responses/FeatureNotEnabled' - '403': - $ref: '#/components/responses/MethodNotAllowed' - '404': - $ref: '#/components/responses/IndexNotFound' - tags: - - predict - put: - operationId: put - requestBody: - description: Parameters to send with the custom request. - content: - application/json: - schema: - type: object - summary: Send requests to the Algolia REST API. - description: This method allow you to send requests to the Algolia REST API. - parameters: - - $ref: '#/components/parameters/PathInPath' - - $ref: '#/components/parameters/Parameters' - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - '400': - $ref: '#/components/responses/BadRequest' - '402': - $ref: '#/components/responses/FeatureNotEnabled' - '403': - $ref: '#/components/responses/MethodNotAllowed' - '404': - $ref: '#/components/responses/IndexNotFound' - tags: - - predict - delete: - operationId: del - summary: Send requests to the Algolia REST API. - description: This method allow you to send requests to the Algolia REST API. - parameters: - - $ref: '#/components/parameters/PathInPath' - - $ref: '#/components/parameters/Parameters' - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - '400': - $ref: '#/components/responses/BadRequest' - '402': - $ref: '#/components/responses/FeatureNotEnabled' - '403': - $ref: '#/components/responses/MethodNotAllowed' - '404': - $ref: '#/components/responses/IndexNotFound' - tags: - - predict - /1/users/{userID}/fetch: - post: - tags: - - predict - operationId: fetchUserProfile - description: >- - Get predictions, properties (raw, computed or custom) and segments - (computed or custom) for a user profile. - summary: Get user profile. - parameters: - - $ref: '#/components/parameters/userID' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/params' - responses: - '200': - description: OK - content: - application/json: - schema: - title: fetchUserProfileResponse - $ref: '#/components/schemas/userProfile' - '400': - description: ModelsToRetrieve or typesToRetrieve must be set. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBase' - '404': - $ref: '#/components/responses/UserNotFound' - '405': - $ref: '#/components/responses/MethodNotAllowed' - /1/users/{userID}: - delete: - tags: - - predict - operationId: deleteUserProfile - description: >- - Delete all data and predictions associated with an authenticated user - (userID) or an anonymous user (cookieID, sessionID). - summary: Delete user profile. - parameters: - - $ref: '#/components/parameters/userID' - responses: - '200': - description: OK - content: - application/json: - schema: - title: deleteUserProfileResponse - type: object - required: - - user - - deletedUntil - properties: - user: - type: string - description: The ID of the user that was deleted. - deletedUntil: - type: string - description: >- - The time the same user ID will be imported again when the - data is ingested. - '401': - $ref: '#/components/responses/InvalidCredentials' - '404': - $ref: '#/components/responses/UserNotFound' - '422': - description: Invalid user ID or application ID. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBase' - '500': - $ref: '#/components/responses/InternalError' - /1/users: - post: - tags: - - predict - operationId: fetchAllUserProfiles - description: Get all users with predictions in the provided application. - summary: Get all user profiles. - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/fetchAllUserProfilesParams' - responses: - '200': - description: OK - content: - application/json: - schema: - title: fetchAllUserProfilesResponse - type: object - required: - - users - properties: - users: - type: array - items: - $ref: '#/components/schemas/userProfile' - previousPageToken: - $ref: '#/components/schemas/previousPageToken' - nextPageToken: - $ref: '#/components/schemas/nextPageToken' - '400': - description: Could not parse the request body. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBase' - '401': - $ref: '#/components/responses/InvalidCredentials' - '422': - $ref: '#/components/responses/UnprocessableEntity' - '500': - $ref: '#/components/responses/InternalError' - /1/predict/modeltypes: - get: - tags: - - predict - operationId: getAvailableModelTypes - summary: Get a list of available model types. - description: >- - Get a list of all available model types. Each model type can be - activated more than once, by selecting a different data source. - responses: - '200': - description: OK - content: - application/json: - schema: - title: getAvailableModelTypesResponse - type: array - items: - type: object - additionalProperties: false - properties: - name: - type: string - description: Name of the model. - type: - type: string - description: Description of the model. - compatibleSources: - type: array - items: - type: string - $ref: '#/components/schemas/compatibleSources' - dataRequirements: - type: object - additionalProperties: false - properties: - minUsers: - type: integer - description: Minimum number of users required for this model. - minDays: - type: integer - description: Minimum number of days model needs to run. - required: - - minUsers - - minDays - required: - - name - - type - - compatibleSources - - dataRequirements - '401': - $ref: '#/components/responses/InvalidCredentials' - '422': - $ref: '#/components/responses/UnprocessableEntity' - '500': - $ref: '#/components/responses/InternalError' - /1/predict/models/{modelID}: - get: - tags: - - predict - operationId: getModelInstanceConfig - summary: Get a model’s instance configuration. - description: Get the configuration for a model that was activated. - parameters: - - $ref: '#/components/parameters/modelID' - responses: - '200': - description: OK - content: - application/json: - schema: - title: getModelInstanceConfigResponse - $ref: '#/components/schemas/modelInstance' - '401': - $ref: '#/components/responses/InvalidCredentials' - '404': - $ref: '#/components/responses/IndexNotFound' - '422': - $ref: '#/components/responses/UnprocessableEntity' - '500': - $ref: '#/components/responses/InternalError' - post: - tags: - - predict - operationId: updateModelInstance - summary: Update a model instance. - description: Update a model’s configuration. - parameters: - - $ref: '#/components/parameters/modelID' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/updateModelParams' - responses: - '200': - description: OK - content: - application/json: - schema: - title: updateModelInstanceResponse - type: object - additionalProperties: false - properties: - modelID: - type: string - description: The ID of the model. - updatedAt: - $ref: '#/components/schemas/updatedAt' - required: - - modelID - - updatedAt - '401': - $ref: '#/components/responses/InvalidCredentials' - '404': - $ref: '#/components/responses/IndexNotFound' - '422': - $ref: '#/components/responses/UnprocessableEntity' - '500': - $ref: '#/components/responses/InternalError' - delete: - tags: - - predict - operationId: deleteModelInstance - summary: Delete a model instance. - description: Delete the model’s configuration, pipelines and generated predictions. - parameters: - - $ref: '#/components/parameters/modelID' - responses: - '200': - description: OK - content: - application/json: - schema: - title: deleteModelInstanceResponse - type: object - additionalProperties: false - properties: - modelID: - type: string - description: The ID of the model. - deletedUntil: - type: string - description: >- - The date until which you can safely consider the data as - being deleted. - required: - - modelID - - deletedUntil - '401': - $ref: '#/components/responses/InvalidCredentials' - '404': - $ref: '#/components/responses/IndexNotFound' - '422': - $ref: '#/components/responses/UnprocessableEntity' - '500': - $ref: '#/components/responses/InternalError' - /1/predict/models: - get: - tags: - - predict - operationId: getModelInstances - summary: Get model instances. - description: Get a list of all model instances. - responses: - '200': - description: OK - content: - application/json: - schema: - title: getModelInstancesResponse - type: array - items: - $ref: '#/components/schemas/modelInstance' - '401': - $ref: '#/components/responses/InvalidCredentials' - '422': - $ref: '#/components/responses/UnprocessableEntity' - '500': - $ref: '#/components/responses/InternalError' - post: - tags: - - predict - operationId: activateModelInstance - summary: Activate a model instance. - description: > - 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. - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/activateModelParams' - responses: - '200': - description: OK - content: - application/json: - schema: - title: activateModelInstanceResponse - type: object - additionalProperties: false - properties: - modelID: - type: string - description: The ID of the model. - updatedAt: - $ref: '#/components/schemas/updatedAt' - required: - - modelID - - updatedAt - '401': - $ref: '#/components/responses/InvalidCredentials' - '422': - $ref: '#/components/responses/UnprocessableEntity' - '500': - $ref: '#/components/responses/InternalError' - /1/predict/models/{modelID}/metrics: - get: - tags: - - predict - operationId: getModelMetrics - summary: Get a model’s instance metrics. - description: Get the model instance’ training metrics. - parameters: - - $ref: '#/components/parameters/modelID' - responses: - '200': - description: OK - content: - application/json: - schema: - title: getModelMetricsResponse - type: object - additionalProperties: false - properties: - modelID: - type: string - description: The ID of the model. - metrics: - type: array - items: - $ref: '#/components/schemas/modelMetrics' - required: - - modelID - - metrics - '401': - $ref: '#/components/responses/InvalidCredentials' - '404': - $ref: '#/components/responses/IndexNotFound' - '422': - $ref: '#/components/responses/UnprocessableEntity' - '500': - $ref: '#/components/responses/InternalError' - /1/segments/{segmentID}/users: - post: - tags: - - predict - operationId: getSegmentUsers - summary: Get segment users. - description: Get the profiles of users that belong to a segment. - parameters: - - $ref: '#/components/parameters/segmentID' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/fetchAllUserProfilesParams' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/getSegmentUsersResponse' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '404': - $ref: '#/components/responses/IndexNotFound' - '422': - $ref: '#/components/responses/UnprocessableEntity' - '500': - $ref: '#/components/responses/InternalError' - /1/segments/{segmentID}: - get: - tags: - - predict - operationId: fetchSegment - description: Get the segment configuration. - summary: Get the segment configuration. - parameters: - - $ref: '#/components/parameters/segmentID' - responses: - '200': - description: OK - content: - application/json: - schema: - title: fetchSegmentResponse - $ref: '#/components/schemas/segment' - '404': - $ref: '#/components/responses/IndexNotFound' - '422': - $ref: '#/components/responses/StatusUnprocessableEntity' - '500': - $ref: '#/components/responses/InternalError' - post: - tags: - - predict - operationId: updateSegment - description: Update a segment’s configuration. - summary: Update segment. - parameters: - - $ref: '#/components/parameters/segmentID' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/updateSegmentParams' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/updateSegmentResponse' - '400': - $ref: '#/components/responses/IndexNotFound' - '401': - $ref: '#/components/responses/Unauthorized' - '404': - $ref: '#/components/responses/IndexNotFound' - '422': - $ref: '#/components/responses/StatusUnprocessableEntity' - '500': - $ref: '#/components/responses/InternalError' - delete: - tags: - - predict - operationId: deleteSegment - summary: Delete a segment's configuration. - description: > - 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: - - $ref: '#/components/parameters/segmentID' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/deleteSegmentResponse' - '401': - $ref: '#/components/responses/Unauthorized' - '404': - $ref: '#/components/responses/IndexNotFound' - '422': - $ref: '#/components/responses/StatusUnprocessableEntity' - '500': - $ref: '#/components/responses/InternalError' - /1/segments: - get: - tags: - - predict - operationId: fetchAllSegments - description: Get the list of segments with their configuration. - summary: Get all segments. - parameters: - - $ref: '#/components/parameters/type' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/fetchAllSegmentsResponse' - '404': - $ref: '#/components/responses/IndexNotFound' - '422': - $ref: '#/components/responses/StatusUnprocessableEntity' - '500': - $ref: '#/components/responses/InternalError' - post: - tags: - - predict - operationId: createSegment - summary: Create a segment. - description: >- - 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. - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/createSegmentParams' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/createSegmentResponse' - '400': - $ref: '#/components/responses/IndexNotFound' - '401': - $ref: '#/components/responses/Unauthorized' - '422': - $ref: '#/components/responses/StatusUnprocessableEntity' - '500': - $ref: '#/components/responses/InternalError' diff --git a/specs/ingestion/common/destinationParameters.yml b/specs/ingestion/common/destinationParameters.yml index 6d3dcc9f5d..09becffaef 100644 --- a/specs/ingestion/common/destinationParameters.yml +++ b/specs/ingestion/common/destinationParameters.yml @@ -9,7 +9,7 @@ type: type: array items: $ref: './schemas/destination.yml#/DestinationType' - example: search,predict + example: search authenticationID: name: authenticationID diff --git a/specs/ingestion/common/schemas/destination.yml b/specs/ingestion/common/schemas/destination.yml index f3a1270e3a..bab9293627 100644 --- a/specs/ingestion/common/schemas/destination.yml +++ b/specs/ingestion/common/schemas/destination.yml @@ -103,7 +103,7 @@ DestinationSearch: DestinationType: type: string description: Type of the Destination, defines in which Algolia product the data will be stored. - enum: ['search', 'insights', 'flow', 'predict'] + enum: ['search', 'insights', 'flow'] DestinationIndexPrefix: type: object diff --git a/specs/predict/common/parameters.yml b/specs/predict/common/parameters.yml deleted file mode 100644 index 2b1db36942..0000000000 --- a/specs/predict/common/parameters.yml +++ /dev/null @@ -1,30 +0,0 @@ -userID: - name: userID - in: path - required: true - schema: - type: string - description: User ID for authenticated users or cookie ID for non-authenticated repeated users (visitors). - -segmentID: - name: segmentID - in: path - required: true - schema: - type: string - description: The ID of the Segment to fetch. - -type: - name: type - in: query - schema: - $ref: '../responses/Segment.yml#/segmentType' - description: The type of segments to fetch. - -modelID: - name: modelID - in: path - required: true - schema: - type: string - description: The ID of the model to retrieve. diff --git a/specs/predict/common/schemas/Params.yml b/specs/predict/common/schemas/Params.yml deleted file mode 100644 index 75656352b0..0000000000 --- a/specs/predict/common/schemas/Params.yml +++ /dev/null @@ -1,75 +0,0 @@ -params: - oneOf: - - $ref: '#/modelsToRetrieveParam' - - $ref: '#/typesToRetrieveParam' - - $ref: '#/allParams' - -allParams: - allOf: - - $ref: '#/modelsToRetrieveParam' - - $ref: '#/typesToRetrieveParam' - -fetchAllUserProfilesParams: - oneOf: - - $ref: '#/modelsToRetrieveParam' - - $ref: '#/typesToRetrieveParam' - - $ref: '#/nextPageTokenParam' - - $ref: '#/previousPageTokenParam' - - $ref: '#/limitParam' - -modelsToRetrieveParam: - type: object - required: - - modelsToRetrieveParam - properties: - modelsToRetrieve: - type: array - items: - $ref: '#/modelsToRetrieve' - -typesToRetrieveParam: - type: object - required: - - typesToRetrieveParam - properties: - typesToRetrieve: - type: array - items: - $ref: '#/typesToRetrieve' - -nextPageTokenParam: - type: object - properties: - nextPageToken: - $ref: '#/nextPageToken' - -previousPageTokenParam: - type: object - properties: - previousPageToken: - $ref: '#/previousPageToken' - -limitParam: - type: object - properties: - limit: - $ref: '#/limit' - -modelsToRetrieve: - type: string - enum: [funnel_stage, order_value, affinities] - -typesToRetrieve: - type: string - enum: [properties, segments] - -nextPageToken: - type: string - description: '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.' - -previousPageToken: - type: string - description: '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.' - -limit: - type: integer diff --git a/specs/predict/common/schemas/SegmentsParams.yml b/specs/predict/common/schemas/SegmentsParams.yml deleted file mode 100644 index 0347ce81d9..0000000000 --- a/specs/predict/common/schemas/SegmentsParams.yml +++ /dev/null @@ -1,37 +0,0 @@ -createSegmentParams: - type: object - required: - - name - - conditions - properties: - name: - $ref: '#/name' - conditions: - $ref: '../../responses/Segment.yml#/segmentParentConditions' - -updateSegmentParams: - oneOf: - - $ref: '#/segmentNameParam' - - $ref: '#/segmentConditionsParam' - - $ref: '#/allUpdateSegmentParams' - -allUpdateSegmentParams: - allOf: - - $ref: '#/segmentNameParam' - - $ref: '#/segmentConditionsParam' - -segmentNameParam: - type: object - properties: - name: - $ref: '#/name' - -segmentConditionsParam: - type: object - properties: - conditions: - $ref: '../../responses/Segment.yml#/segmentParentConditions' - -name: - type: string - description: The name or description of the segment. diff --git a/specs/predict/common/schemas/modelsParams.yml b/specs/predict/common/schemas/modelsParams.yml deleted file mode 100644 index 996e3b71a7..0000000000 --- a/specs/predict/common/schemas/modelsParams.yml +++ /dev/null @@ -1,60 +0,0 @@ -activateModelParams: - type: object - properties: - type: - $ref: '../../common/schemas/Params.yml#/modelsToRetrieve' - name: - $ref: '#/name' - sourceID: - $ref: '#/sourceID' - index: - $ref: '#/index' - modelAttributes: - type: array - items: - $ref: '#/modelAttributes' - required: - - type - - name - - sourceID - - index - -updateModelParams: - type: object - properties: - name: - $ref: '#/name' - modelAttributes: - type: array - items: - $ref: '#/modelAttributes' - modelStatus: - $ref: '#/modelStatus' - -type: - type: string - enum: ['funnel_stage', 'order_value', 'affinities'] - description: The model's type. - -name: - type: string - description: The model’s instance name. - -sourceID: - type: string - description: The data source ID, as returned by the (external) sources API. - -index: - type: string - description: The index name. - -modelAttributes: - type: string - description: List of items attributes that will be used in the model. This param is required if the model `type` needs it (e.g. `affinities`, `funnel_stage`). - -modelStatus: - type: string - enum: [active, inactive] - description: | - `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`. diff --git a/specs/predict/paths/models/getAvailableModelTypes.yml b/specs/predict/paths/models/getAvailableModelTypes.yml deleted file mode 100644 index 5e968fdb98..0000000000 --- a/specs/predict/paths/models/getAvailableModelTypes.yml +++ /dev/null @@ -1,53 +0,0 @@ -get: - tags: - - models - operationId: getAvailableModelTypes - summary: Get a list of available model types. - description: Get a list of all available model types. Each model type can be activated more than once, by selecting a different data source. - responses: - '200': - description: OK - content: - application/json: - schema: - title: getAvailableModelTypesResponse - type: array - items: - type: object - additionalProperties: false - properties: - name: - type: string - description: Name of the model. - type: - type: string - description: Description of the model. - compatibleSources: - type: array - items: - type: string - $ref: '../../responses/ModelTypes.yml#/compatibleSources' - dataRequirements: - type: object - additionalProperties: false - properties: - minUsers: - type: integer - description: Minimum number of users required for this model. - minDays: - type: integer - description: Minimum number of days model needs to run. - required: - - minUsers - - minDays - required: - - name - - type - - compatibleSources - - dataRequirements - '401': - $ref: '../../responses/InvalidCredentials.yml' - '422': - $ref: '../../../common/responses/UnprocessableEntity.yml' - '500': - $ref: '../../../common/responses/InternalError.yml' diff --git a/specs/predict/paths/models/getModelMetrics.yml b/specs/predict/paths/models/getModelMetrics.yml deleted file mode 100644 index 52c335099b..0000000000 --- a/specs/predict/paths/models/getModelMetrics.yml +++ /dev/null @@ -1,36 +0,0 @@ -get: - tags: - - models - operationId: getModelMetrics - summary: Get a model’s instance metrics. - description: Get the model instance’ training metrics. - parameters: - - $ref: '../../common/parameters.yml#/modelID' - responses: - '200': - description: OK - content: - application/json: - schema: - title: getModelMetricsResponse - type: object - additionalProperties: false - properties: - modelID: - type: string - description: The ID of the model. - metrics: - type: array - items: - $ref: '../../responses/Models.yml#/modelMetrics' - required: - - modelID - - metrics - '401': - $ref: '../../responses/InvalidCredentials.yml' - '404': - $ref: '../../../common/responses/IndexNotFound.yml' - '422': - $ref: '../../../common/responses/UnprocessableEntity.yml' - '500': - $ref: '../../../common/responses/InternalError.yml' diff --git a/specs/predict/paths/models/modelInstances.yml b/specs/predict/paths/models/modelInstances.yml deleted file mode 100644 index 1cc4999609..0000000000 --- a/specs/predict/paths/models/modelInstances.yml +++ /dev/null @@ -1,101 +0,0 @@ -get: - tags: - - models - operationId: getModelInstanceConfig - summary: Get a model’s instance configuration. - description: Get the configuration for a model that was activated. - parameters: - - $ref: '../../common/parameters.yml#/modelID' - responses: - '200': - description: OK - content: - application/json: - schema: - title: getModelInstanceConfigResponse - $ref: '../../responses/Models.yml#/modelInstance' - '401': - $ref: '../../responses/InvalidCredentials.yml' - '404': - $ref: '../../../common/responses/IndexNotFound.yml' - '422': - $ref: '../../../common/responses/UnprocessableEntity.yml' - '500': - $ref: '../../../common/responses/InternalError.yml' - -post: - tags: - - models - operationId: updateModelInstance - summary: Update a model instance. - description: Update a model’s configuration. - parameters: - - $ref: '../../common/parameters.yml#/modelID' - requestBody: - required: true - content: - application/json: - schema: - $ref: '../../common/schemas/modelsParams.yml#/updateModelParams' - responses: - '200': - description: OK - content: - application/json: - schema: - title: updateModelInstanceResponse - type: object - additionalProperties: false - properties: - modelID: - type: string - description: The ID of the model. - updatedAt: - $ref: '../../../common/responses/common.yml#/updatedAt' - required: - - modelID - - updatedAt - '401': - $ref: '../../responses/InvalidCredentials.yml' - '404': - $ref: '../../../common/responses/IndexNotFound.yml' - '422': - $ref: '../../../common/responses/UnprocessableEntity.yml' - '500': - $ref: '../../../common/responses/InternalError.yml' - -delete: - tags: - - models - operationId: deleteModelInstance - summary: Delete a model instance. - description: Delete the model’s configuration, pipelines and generated predictions. - parameters: - - $ref: '../../common/parameters.yml#/modelID' - responses: - '200': - description: OK - content: - application/json: - schema: - title: deleteModelInstanceResponse - type: object - additionalProperties: false - properties: - modelID: - type: string - description: The ID of the model. - deletedUntil: - type: string - description: The date until which you can safely consider the data as being deleted. - required: - - modelID - - deletedUntil - '401': - $ref: '../../responses/InvalidCredentials.yml' - '404': - $ref: '../../../common/responses/IndexNotFound.yml' - '422': - $ref: '../../../common/responses/UnprocessableEntity.yml' - '500': - $ref: '../../../common/responses/InternalError.yml' diff --git a/specs/predict/paths/models/models.yml b/specs/predict/paths/models/models.yml deleted file mode 100644 index f12f3db496..0000000000 --- a/specs/predict/paths/models/models.yml +++ /dev/null @@ -1,63 +0,0 @@ -get: - tags: - - models - operationId: getModelInstances - summary: Get model instances. - description: Get a list of all model instances. - responses: - '200': - description: OK - content: - application/json: - schema: - title: getModelInstancesResponse - type: array - items: - $ref: '../../responses/Models.yml#/modelInstance' - '401': - $ref: '../../responses/InvalidCredentials.yml' - '422': - $ref: '../../../common/responses/UnprocessableEntity.yml' - '500': - $ref: '../../../common/responses/InternalError.yml' - -post: - tags: - - models - operationId: activateModelInstance - summary: Activate a model instance. - description: > - 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. - requestBody: - required: true - content: - application/json: - schema: - $ref: '../../common/schemas/modelsParams.yml#/activateModelParams' - responses: - '200': - description: OK - content: - application/json: - schema: - title: activateModelInstanceResponse - type: object - additionalProperties: false - properties: - modelID: - type: string - description: The ID of the model. - updatedAt: - $ref: '../../../common/responses/common.yml#/updatedAt' - required: - - modelID - - updatedAt - - '401': - $ref: '../../responses/InvalidCredentials.yml' - '422': - $ref: '../../../common/responses/UnprocessableEntity.yml' - '500': - $ref: '../../../common/responses/InternalError.yml' diff --git a/specs/predict/paths/segments/allSegments.yml b/specs/predict/paths/segments/allSegments.yml deleted file mode 100644 index 2f0b6ad3be..0000000000 --- a/specs/predict/paths/segments/allSegments.yml +++ /dev/null @@ -1,48 +0,0 @@ -get: - tags: - - segments - operationId: fetchAllSegments - description: Get the list of segments with their configuration. - summary: Get all segments. - parameters: - - $ref: '../../common/parameters.yml#/type' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '../../responses/Segment.yml#/fetchAllSegmentsResponse' - '404': - $ref: '../../../common/responses/IndexNotFound.yml' - '422': - $ref: '../../../common/responses/StatusUnprocessableEntity.yml' - '500': - $ref: '../../../common/responses/InternalError.yml' -post: - tags: - - segments - operationId: createSegment - summary: Create a segment. - description: 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. - requestBody: - required: true - content: - application/json: - schema: - $ref: '../../common/schemas/SegmentsParams.yml#/createSegmentParams' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '../../responses/Segment.yml#/createSegmentResponse' - '400': - $ref: '../../../common/responses/IndexNotFound.yml' - '401': - $ref: '../../../common/responses/Unauthorized.yml' - '422': - $ref: '../../../common/responses/StatusUnprocessableEntity.yml' - '500': - $ref: '../../../common/responses/InternalError.yml' diff --git a/specs/predict/paths/segments/segmentUsers.yml b/specs/predict/paths/segments/segmentUsers.yml deleted file mode 100644 index 2c789a6391..0000000000 --- a/specs/predict/paths/segments/segmentUsers.yml +++ /dev/null @@ -1,31 +0,0 @@ -post: - tags: - - segments - operationId: getSegmentUsers - summary: Get segment users. - description: Get the profiles of users that belong to a segment. - parameters: - - $ref: '../../common/parameters.yml#/segmentID' - requestBody: - required: true - content: - application/json: - schema: - $ref: '../../common/schemas/Params.yml#/fetchAllUserProfilesParams' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '../../responses/Segment.yml#/getSegmentUsersResponse' - '400': - $ref: '../../../common/responses/BadRequest.yml' - '401': - $ref: '../../../common/responses/Unauthorized.yml' - '404': - $ref: '../../../common/responses/IndexNotFound.yml' - '422': - $ref: '../../../common/responses/UnprocessableEntity.yml' - '500': - $ref: '../../../common/responses/InternalError.yml' diff --git a/specs/predict/paths/segments/singleSegment.yml b/specs/predict/paths/segments/singleSegment.yml deleted file mode 100644 index 6495f12b8b..0000000000 --- a/specs/predict/paths/segments/singleSegment.yml +++ /dev/null @@ -1,81 +0,0 @@ -get: - tags: - - segments - operationId: fetchSegment - description: Get the segment configuration. - summary: Get the segment configuration. - parameters: - - $ref: '../../common/parameters.yml#/segmentID' - responses: - '200': - description: OK - content: - application/json: - schema: - title: fetchSegmentResponse - $ref: '../../responses/Segment.yml#/segment' - '404': - $ref: '../../../common/responses/IndexNotFound.yml' - '422': - $ref: '../../../common/responses/StatusUnprocessableEntity.yml' - '500': - $ref: '../../../common/responses/InternalError.yml' - -post: - tags: - - segments - operationId: updateSegment - description: Update a segment’s configuration. - summary: Update segment. - parameters: - - $ref: '../../common/parameters.yml#/segmentID' - requestBody: - required: true - content: - application/json: - schema: - $ref: '../../common/schemas/SegmentsParams.yml#/updateSegmentParams' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '../../responses/Segment.yml#/updateSegmentResponse' - '400': - $ref: '../../../common/responses/IndexNotFound.yml' - '401': - $ref: '../../../common/responses/Unauthorized.yml' - '404': - $ref: '../../../common/responses/IndexNotFound.yml' - '422': - $ref: '../../../common/responses/StatusUnprocessableEntity.yml' - '500': - $ref: '../../../common/responses/InternalError.yml' - -delete: - tags: - - segments - operationId: deleteSegment - summary: Delete a segment's configuration. - description: | - 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: - - $ref: '../../common/parameters.yml#/segmentID' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '../../responses/Segment.yml#/deleteSegmentResponse' - '401': - $ref: '../../../common/responses/Unauthorized.yml' - '404': - $ref: '../../../common/responses/IndexNotFound.yml' - '422': - $ref: '../../../common/responses/StatusUnprocessableEntity.yml' - '500': - $ref: '../../../common/responses/InternalError.yml' diff --git a/specs/predict/paths/users/delete.yml b/specs/predict/paths/users/delete.yml deleted file mode 100644 index b535213677..0000000000 --- a/specs/predict/paths/users/delete.yml +++ /dev/null @@ -1,38 +0,0 @@ -delete: - tags: - - profiles - operationId: deleteUserProfile - description: Delete all data and predictions associated with an authenticated user (userID) or an anonymous user (cookieID, sessionID). - summary: Delete user profile. - parameters: - - $ref: '../../common/parameters.yml#/userID' - responses: - '200': - description: OK - content: - application/json: - schema: - title: deleteUserProfileResponse - type: object - required: - - user - - deletedUntil - properties: - user: - type: string - description: The ID of the user that was deleted. - deletedUntil: - type: string - description: The time the same user ID will be imported again when the data is ingested. - '401': - $ref: '../../responses/InvalidCredentials.yml' - '404': - $ref: '../../responses/UserNotFound.yml' - '422': - description: Invalid user ID or application ID. - content: - application/json: - schema: - $ref: '../../../common/schemas/ErrorBase.yml' - '500': - $ref: '../../../common/responses/InternalError.yml' diff --git a/specs/predict/paths/users/fetch.yml b/specs/predict/paths/users/fetch.yml deleted file mode 100644 index f1caf94e67..0000000000 --- a/specs/predict/paths/users/fetch.yml +++ /dev/null @@ -1,32 +0,0 @@ -post: - tags: - - profiles - operationId: fetchUserProfile - description: Get predictions, properties (raw, computed or custom) and segments (computed or custom) for a user profile. - summary: Get user profile. - parameters: - - $ref: '../../common/parameters.yml#/userID' - requestBody: - required: true - content: - application/json: - schema: - $ref: '../../common/schemas/Params.yml#/params' - responses: - '200': - description: OK - content: - application/json: - schema: - title: fetchUserProfileResponse - $ref: '../../responses/UserProfile.yml#/userProfile' - '404': - $ref: '../../responses/UserNotFound.yml' - '405': - $ref: '../../../common/responses/MethodNotAllowed.yml' - '400': - description: ModelsToRetrieve or typesToRetrieve must be set. - content: - application/json: - schema: - $ref: '../../../common/schemas/ErrorBase.yml' diff --git a/specs/predict/paths/users/fetchAll.yml b/specs/predict/paths/users/fetchAll.yml deleted file mode 100644 index d6e89f1eb0..0000000000 --- a/specs/predict/paths/users/fetchAll.yml +++ /dev/null @@ -1,43 +0,0 @@ -post: - tags: - - profiles - operationId: fetchAllUserProfiles - description: Get all users with predictions in the provided application. - summary: Get all user profiles. - requestBody: - required: true - content: - application/json: - schema: - $ref: '../../common/schemas/Params.yml#/fetchAllUserProfilesParams' - responses: - '200': - description: OK - content: - application/json: - schema: - title: fetchAllUserProfilesResponse - type: object - required: - - users - properties: - users: - type: array - items: - $ref: '../../responses/UserProfile.yml#/userProfile' - previousPageToken: - $ref: '../../common/schemas/Params.yml#/previousPageToken' - nextPageToken: - $ref: '../../common/schemas/Params.yml#/nextPageToken' - '400': - description: Could not parse the request body. - content: - application/json: - schema: - $ref: '../../../common/schemas/ErrorBase.yml' - '401': - $ref: '../../responses/InvalidCredentials.yml' - '422': - $ref: '../../../common/responses/UnprocessableEntity.yml' - '500': - $ref: '../../../common/responses/InternalError.yml' diff --git a/specs/predict/responses/InvalidCredentials.yml b/specs/predict/responses/InvalidCredentials.yml deleted file mode 100644 index 534a5577f0..0000000000 --- a/specs/predict/responses/InvalidCredentials.yml +++ /dev/null @@ -1,5 +0,0 @@ -description: Invalid credentials. -content: - application/json: - schema: - $ref: '../../common/schemas/ErrorBase.yml' diff --git a/specs/predict/responses/ModelTypes.yml b/specs/predict/responses/ModelTypes.yml deleted file mode 100644 index 0bb61cc66e..0000000000 --- a/specs/predict/responses/ModelTypes.yml +++ /dev/null @@ -1,3 +0,0 @@ -compatibleSources: - type: string - enum: [bigquery] diff --git a/specs/predict/responses/Models.yml b/specs/predict/responses/Models.yml deleted file mode 100644 index 50b48e6dcb..0000000000 --- a/specs/predict/responses/Models.yml +++ /dev/null @@ -1,85 +0,0 @@ -modelInstance: - type: object - additionalProperties: false - properties: - modelID: - type: string - description: ID of the model. - name: - type: string - description: Name of model instance. - type: - $ref: '../common/schemas/Params.yml#/modelsToRetrieve' - description: Type of the model. - sourceID: - type: string - index: - type: string - modelAttributes: - type: array - items: - $ref: '#/modelAttributes' - lastTrained: - type: string - description: The date and time this model instance was last trained. - lastInference: - type: string - description: The date and time this model instance generated its last inference. - errorMessage: - type: string - modelStatus: - type: string - $ref: '#/getModelInstanceConfigStatus' - required: - - modelID - - name - - type - - sourceID - - index - - lastTrained - - lastInference - - modelStatus - -getModelInstanceConfigStatus: - type: string - enum: [pending, active, invalid, inactive] - description: | - `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. - -modelMetrics: - type: object - additionalProperties: false - properties: - precision: - type: number - format: double - recall: - type: number - format: double - mrr: - type: number - format: double - coverage: - type: number - format: double - f1_score: - type: number - format: double - updatedAt: - $ref: '../../common/responses/common.yml#/updatedAt' - -modelAttributes: - type: object - additionalProperties: false - properties: - name: - type: string - values: - type: array - items: - type: string - required: - - name diff --git a/specs/predict/responses/Segment.yml b/specs/predict/responses/Segment.yml deleted file mode 100644 index c1f607a33f..0000000000 --- a/specs/predict/responses/Segment.yml +++ /dev/null @@ -1,358 +0,0 @@ -updateSegmentResponse: - title: updateSegmentResponse - type: object - required: - - segmentID - - updatedAt - properties: - segmentID: - $ref: '#/segmentID' - size: - $ref: '#/segmentSize' - updatedAt: - $ref: '#/updatedAt' - -deleteSegmentResponse: - title: deleteSegmentResponse - type: object - required: - - segmentID - - deletedUntil - properties: - segmentID: - $ref: '#/segmentID' - deletedUntil: - $ref: '#/deletedUntil' - -getSegmentUsersResponse: - title: getSegmentUsersResponse - type: object - required: - - segmentID - - users - properties: - segmentID: - $ref: '#/segmentID' - users: - type: array - items: - $ref: 'UserProfile.yml#/userProfile' - previousPageToken: - $ref: '../common/schemas/Params.yml#/previousPageToken' - nextPageToken: - $ref: '../common/schemas/Params.yml#/nextPageToken' - -fetchSegmentResponse: - title: fetchSegmentResponse - $ref: '#/segment' - -fetchAllSegmentsResponse: - title: fetchAllSegmentsResponse - type: array - items: - $ref: '#/segment' - -createSegmentResponse: - title: createSegmentResponse - type: object - required: - - segmentID - - updatedAt - properties: - segmentID: - $ref: '#/segmentID' - size: - $ref: '#/segmentSize' - updatedAt: - $ref: '#/updatedAt' - -segment: - type: object - required: - - segmentID - - name - - conditions - - size - - segmentStatus - - type - - lastUpdatedAt - properties: - segmentID: - $ref: '#/segmentID' - name: - $ref: '#/segmentName' - conditions: - $ref: '#/segmentParentConditions' - size: - $ref: '#/segmentSize' - segmentStatus: - $ref: '#/segmentStatus' - type: - $ref: '#/segmentType' - lastUpdatedAt: - $ref: '#/lastUpdatedAt' - errorMessage: - type: string - -segmentStatus: - type: string - description: The status of the segment. - enum: - - active - - pending - - failed - -segmentType: - type: string - description: The type of the segment. - enum: - - computed - - custom - -segmentID: - type: string - description: The ID of the segment. - -segmentName: - type: string - description: The name of the segment. - -segmentSize: - type: number - format: int64 - description: The approximate number of users that matched the segment conditions when it was created, last updated, or when model inference last ran. - -updatedAt: - type: string - description: The date and time at which the segment was updated (RFC3339). - example: 2021-07-22T12:30:00Z - -lastUpdatedAt: - type: string - description: The date and time at which the segment was last updated (RFC3339). - example: 2021-07-22T12:30:00Z - -deletedUntil: - type: string - description: The date and time at which the segment will be re-ingested. - example: 2021-07-22T12:30:00Z - -segmentParentConditions: - description: | - The conditions that define which user profiles are included in the segment. - - Can contain operands and a maximum of 1 level of nested conditions. - type: object - required: - - operator - - operands - properties: - operator: - $ref: '#/segmentConditionOperator' - operands: - type: array - items: - $ref: '#/segmentParentConditionOperands' - -segmentChildConditions: - description: Nested segment conditions that only contain operands. - type: object - required: - - operator - - operands - properties: - operator: - $ref: '#/segmentConditionOperator' - operands: - type: array - items: - $ref: '#/segmentChildConditionOperands' - -segmentConditionOperator: - description: Operator used to combine the operands. - type: string - enum: - - AND - - OR - -segmentParentConditionOperands: - oneOf: - - $ref: '#/segmentChildConditions' - - $ref: '#/segmentOperandAffinity' - - $ref: '#/segmentOperandFunnelStage' - - $ref: '#/segmentOperandOrderValue' - - $ref: '#/segmentOperandProperty' - -segmentChildConditionOperands: - oneOf: - - $ref: '#/segmentOperandAffinity' - - $ref: '#/segmentOperandFunnelStage' - - $ref: '#/segmentOperandOrderValue' - - $ref: '#/segmentOperandProperty' - -segmentOperandAffinity: - description: Operand for affinity model predictions. - type: object - required: - - name - - filters - properties: - name: - type: string - pattern: ^predictions\.affinities\.\w+$ - example: predictions.affinities.color - filters: - type: array - minItems: 1 - items: - $ref: '#/segmentAffinityFilter' - -segmentOperandFunnelStage: - description: Operand for funnel stage model predictions. - type: object - required: - - name - - filters - properties: - name: - type: string - pattern: ^predictions\.funnel_stage$ - example: predictions.funnel_stage - filters: - type: array - minItems: 1 - items: - $ref: '#/segmentFunnelStageFilter' - -segmentOperandOrderValue: - description: Operand for order value model predictions. - type: object - required: - - name - - filters - properties: - name: - type: string - pattern: ^predictions\.order_value$ - example: predictions.order_value - filters: - type: array - minItems: 1 - items: - $ref: '#/segmentOrderValueFilter' - -segmentOperandProperty: - description: Operand for user profile properties. - type: object - required: - - name - - filters - properties: - name: - type: string - pattern: ^properties\.(raw|computed|custom)\.\w+$ - example: properties.raw.age - filters: - type: array - minItems: 1 - items: - $ref: '#/segmentPropertyFilter' - -segmentAffinityFilter: - description: Filter for affinity model predictions. - type: object - required: - - value - - operator - properties: - operator: - $ref: '#/segmentFilterOperatorNumerical' - value: - $ref: '#/segmentAffinityFilterValue' - probability: - $ref: '#/segmentFilterProbability' - -segmentAffinityFilterValue: - oneOf: - - type: string - - type: number - format: float - - type: array - items: - type: string - - type: boolean - -segmentFunnelStageFilter: - description: Filter for funnel stage model predictions. - type: object - required: - - value - - probability - properties: - operator: - $ref: '#/segmentFilterOperatorBoolean' - value: - type: string - probability: - $ref: '#/segmentFilterProbability' - -segmentOrderValueFilter: - description: Filter for order value model predictions. - type: object - required: - - value - properties: - operator: - $ref: '#/segmentFilterOperatorNumerical' - value: - type: number - -segmentPropertyFilter: - description: Filter for user profile properties. - type: object - required: - - value - properties: - operator: - $ref: '#/segmentFilterOperatorNumerical' - value: - $ref: '#/segmentPropertyFilterValue' - -segmentPropertyFilterValue: - allOf: - - $ref: '#/segmentAffinityFilterValue' - -segmentFilterOperatorBoolean: - description: The operator used on the boolean filter value. - type: string - default: 'EQ' - enum: - - 'EQ' - - 'NEQ' - -segmentFilterOperatorNumerical: - description: The operator used on the numerical filter value. - type: string - default: 'EQ' - enum: - - 'EQ' - - 'NEQ' - - 'GT' - - 'GTE' - - 'LT' - - 'LTE' - -segmentFilterProbability: - description: Probability of the filter. - type: object - minProperties: 1 - maxProperties: 2 - properties: - LT: - type: number - LTE: - type: number - GT: - type: number - GTE: - type: number diff --git a/specs/predict/responses/UserNotFound.yml b/specs/predict/responses/UserNotFound.yml deleted file mode 100644 index cfc7327e29..0000000000 --- a/specs/predict/responses/UserNotFound.yml +++ /dev/null @@ -1,5 +0,0 @@ -description: User not found. -content: - application/json: - schema: - $ref: '../../common/schemas/ErrorBase.yml' diff --git a/specs/predict/responses/UserProfile.yml b/specs/predict/responses/UserProfile.yml deleted file mode 100644 index d1a44aa1d7..0000000000 --- a/specs/predict/responses/UserProfile.yml +++ /dev/null @@ -1,149 +0,0 @@ -userProfile: - type: object - required: - - user - properties: - user: - type: string - predictions: - type: object - title: predictions - properties: - funnel_stage: - $ref: '#/predictionsFunnelStage' - order_value: - $ref: '#/predictionsOrderValue' - affinities: - $ref: '#/predictionsAffinities' - properties: - type: object - title: properties - description: Properties for the user profile. - properties: - raw: - type: object - description: Raw user properties (key-value pairs). - computed: - type: object - description: Computed user properties (key-value pairs). - custom: - type: object - description: Custom user properties (key-value pairs). - segments: - type: object - title: segments - required: - - computed - - custom - description: Segments that the user belongs to. - properties: - computed: - type: array - description: List of computed segments IDs. - items: - type: string - custom: - type: array - description: List of custom segments IDs. - items: - type: string - -error: - type: object - description: The error when the model is not available. - properties: - error: - type: string - required: - - error - -predictionsFunnelStage: - oneOf: - - $ref: '#/predictionsFunnelStageSuccess' - - $ref: '#/error' - -predictionsFunnelStageSuccess: - type: object - description: Prediction for the **funnel_stage** model. - properties: - value: - type: array - items: - title: funnel_stage - type: object - properties: - name: - type: string - probability: - type: number - format: double - minimum: 0 - maximum: 1 - required: - - name - - probability - lastUpdatedAt: - type: string - required: - - value - - lastUpdatedAt - -predictionsOrderValue: - oneOf: - - $ref: '#/predictionsOrderValueSuccess' - - $ref: '#/error' - -predictionsOrderValueSuccess: - type: object - description: Prediction for the **order_value** model. - properties: - value: - type: number - format: double - minimum: 0 - lastUpdatedAt: - type: string - required: - - value - - lastUpdatedAt - -predictionsAffinities: - oneOf: - - $ref: '#/predictionsAffinitiesSuccess' - - $ref: '#/error' - -predictionsAffinitiesSuccess: - type: object - description: Prediction for the **affinities** model. - properties: - value: - type: array - items: - title: affinity - type: object - properties: - name: - type: string - value: - $ref: '#/predictionAffinityValue' - probability: - type: number - format: double - minimum: 0 - maximum: 1 - required: - - name - - value - - probability - lastUpdatedAt: - type: string - required: - - value - - lastUpdatedAt - -predictionAffinityValue: - oneOf: - - type: string - - type: number - format: double - - type: boolean diff --git a/specs/predict/spec.yml b/specs/predict/spec.yml deleted file mode 100644 index c6b0863323..0000000000 --- a/specs/predict/spec.yml +++ /dev/null @@ -1,87 +0,0 @@ -openapi: 3.0.2 -info: - title: Predict API - description: API powering the Predict feature of Algolia. - version: 1.0.0 -components: - securitySchemes: - appId: - $ref: '../common/securitySchemes.yml#/appId' - apiKey: - $ref: '../common/securitySchemes.yml#/apiKey' -servers: - - url: https://predict.{region}.algolia.com - variables: - region: - enum: - - eu - - us - default: eu - description: > - Region where your Predict data is stored and processed: - * `eu` - Europe - * `us` - United States. -security: - - appId: [] - apiKey: [] -tags: - - name: models - x-displayName: Models - description: Manage models. - - name: profiles - x-displayName: Profiles - description: Manage users' profiles. - - name: segments - x-displayName: Segments - description: Manage segments. -x-tagGroups: - - name: General - tags: - - profiles - - models - - segments -paths: - # ###################### - # ### Custom request ### - # ###################### - /1{path}: - $ref: '../common/paths/customRequest.yml' - - # ###################### - # ### Users request ### - # ###################### - /1/users/{userID}/fetch: - $ref: 'paths/users/fetch.yml' - - /1/users/{userID}: - $ref: 'paths/users/delete.yml' - - /1/users: - $ref: 'paths/users/fetchAll.yml' - - # ###################### - # ### Model request ### - # ###################### - /1/predict/modeltypes: - $ref: 'paths/models/getAvailableModelTypes.yml' - - /1/predict/models/{modelID}: - $ref: 'paths/models/modelInstances.yml' - - /1/predict/models: - $ref: 'paths/models/models.yml' - - /1/predict/models/{modelID}/metrics: - $ref: 'paths/models/getModelMetrics.yml' - - # ######################## - # ### Segments request ### - # ######################## - /1/segments/{segmentID}/users: - $ref: 'paths/segments/segmentUsers.yml' - - /1/segments/{segmentID}: - $ref: 'paths/segments/singleSegment.yml' - - /1/segments: - $ref: 'paths/segments/allSegments.yml' diff --git a/templates/kotlin/tests/client/suite.mustache b/templates/kotlin/tests/client/suite.mustache index 83e331363b..93c2f94103 100644 --- a/templates/kotlin/tests/client/suite.mustache +++ b/templates/kotlin/tests/client/suite.mustache @@ -4,7 +4,6 @@ import com.algolia.client.api.{{client}} import com.algolia.client.model.{{import}}.* import com.algolia.client.configuration.* import com.algolia.client.transport.* -import com.algolia.extension.* import com.algolia.utils.* import io.ktor.http.* import kotlinx.coroutines.test.* @@ -62,4 +61,4 @@ class {{clientPrefix}}Test { } {{/tests}} {{/blocksClient}} -} +} \ No newline at end of file diff --git a/templates/kotlin/tests/requests/requests.mustache b/templates/kotlin/tests/requests/requests.mustache index 911061ac05..b05abf372a 100644 --- a/templates/kotlin/tests/requests/requests.mustache +++ b/templates/kotlin/tests/requests/requests.mustache @@ -4,7 +4,6 @@ import com.algolia.client.api.{{client}} import com.algolia.client.model.{{import}}.* import com.algolia.client.configuration.* import com.algolia.client.transport.* -import com.algolia.extension.* import com.algolia.utils.* import io.ktor.http.* import kotlinx.coroutines.test.* @@ -81,4 +80,4 @@ class {{clientPrefix}}Test { } {{/tests}} {{/blocksRequests}} -} +} \ No newline at end of file diff --git a/tests/CTS/client/predict/parameters.json b/tests/CTS/client/predict/parameters.json deleted file mode 100644 index 847326f326..0000000000 --- a/tests/CTS/client/predict/parameters.json +++ /dev/null @@ -1,51 +0,0 @@ -[ - { - "testName": "throws when region is not given", - "autoCreateClient": false, - "steps": [ - { - "type": "createClient", - "parameters": { - "appId": "my-app-id", - "apiKey": "my-api-key", - "region": "" - }, - "expected": { - "error": "`region` is required and must be one of the following: eu, us" - } - } - ] - }, - { - "testName": "throws when incorrect region is given", - "autoCreateClient": false, - "steps": [ - { - "type": "createClient", - "parameters": { - "appId": "my-app-id", - "apiKey": "my-api-key", - "region": "not_a_region" - }, - "expected": { - "error": "`region` is required and must be one of the following: eu, us" - } - } - ] - }, - { - "testName": "does not throw when region is given", - "autoCreateClient": false, - "steps": [ - { - "type": "createClient", - "parameters": { - "appId": "my-app-id", - "apiKey": "my-api-key", - "region": "eu" - }, - "expected": {} - } - ] - } -] diff --git a/tests/CTS/methods/requests/predict/activateModelInstance.json b/tests/CTS/methods/requests/predict/activateModelInstance.json deleted file mode 100644 index bfb30a3a65..0000000000 --- a/tests/CTS/methods/requests/predict/activateModelInstance.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - { - "testName": "activate a model instance", - "parameters": { - "type": "funnel_stage", - "name": "Shopping stage for EU users", - "sourceID": "0200030-129930", - "index": "Products Production", - "modelAttributes": [] - }, - "request": { - "path": "/1/predict/models", - "method": "POST", - "body": { - "type": "funnel_stage", - "name": "Shopping stage for EU users", - "sourceID": "0200030-129930", - "index": "Products Production", - "modelAttributes": [] - } - } - } -] diff --git a/tests/CTS/methods/requests/predict/createSegment.json b/tests/CTS/methods/requests/predict/createSegment.json deleted file mode 100644 index cf43d8aabe..0000000000 --- a/tests/CTS/methods/requests/predict/createSegment.json +++ /dev/null @@ -1,95 +0,0 @@ -[ - { - "testName": "create segment with required params", - "parameters": { - "name": "segment1", - "conditions": { - "operator": "AND", - "operands": [ - { - "name": "predictions.order_value", - "filters": [ - { - "operator": "GT", - "value": 200 - } - ] - } - ] - } - }, - "request": { - "path": "/1/segments", - "method": "POST", - "body": { - "name": "segment1", - "conditions": { - "operator": "AND", - "operands": [ - { - "name": "predictions.order_value", - "filters": [ - { - "operator": "GT", - "value": 200 - } - ] - } - ] - } - } - }, - "extras": { - "skipForGo": true - } - }, - { - "testName": "create segment with filter probability", - "parameters": { - "name": "segment1", - "conditions": { - "operator": "AND", - "operands": [ - { - "name": "predictions.affinities.color", - "filters": [ - { - "operator": "EQ", - "value": "red", - "probability": { - "GTE": 0.5, - "LTE": 1 - } - } - ] - } - ] - } - }, - "request": { - "path": "/1/segments", - "method": "POST", - "body": { - "name": "segment1", - "conditions": { - "operator": "AND", - "operands": [ - { - "name": "predictions.affinities.color", - "filters": [ - { - "operator": "EQ", - "value": "red", - "probability": { - "GTE": 0.5, - "LTE": 1 - } - } - ] - } - ] - } - } - } - } -] diff --git a/tests/CTS/methods/requests/predict/deleteModelInstance.json b/tests/CTS/methods/requests/predict/deleteModelInstance.json deleted file mode 100644 index 77e1320889..0000000000 --- a/tests/CTS/methods/requests/predict/deleteModelInstance.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - "testName": "delete a model instance", - "parameters": { - "modelID": "model1" - }, - "request": { - "path": "/1/predict/models/model1", - "method": "DELETE" - } - } -] diff --git a/tests/CTS/methods/requests/predict/deleteSegment.json b/tests/CTS/methods/requests/predict/deleteSegment.json deleted file mode 100644 index 872ba8435f..0000000000 --- a/tests/CTS/methods/requests/predict/deleteSegment.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - "testName": "delete a segments configuration", - "parameters": { - "segmentID": "segment1" - }, - "request": { - "path": "/1/segments/segment1", - "method": "DELETE" - } - } -] diff --git a/tests/CTS/methods/requests/predict/deleteUserProfile.json b/tests/CTS/methods/requests/predict/deleteUserProfile.json deleted file mode 100644 index 2536e42fac..0000000000 --- a/tests/CTS/methods/requests/predict/deleteUserProfile.json +++ /dev/null @@ -1,13 +0,0 @@ -[ - { - "testName": "deleteUserProfile", - "parameters": { - "userID": "user1" - }, - "request": { - "path": "/1/users/user1", - "method": "DELETE", - "userID": "user1" - } - } -] diff --git a/tests/CTS/methods/requests/predict/fetchAllSegments.json b/tests/CTS/methods/requests/predict/fetchAllSegments.json deleted file mode 100644 index 5ba4b9ac87..0000000000 --- a/tests/CTS/methods/requests/predict/fetchAllSegments.json +++ /dev/null @@ -1,36 +0,0 @@ -[ - { - "testName": "fetchAllSegments with no segmentType", - "parameters": {}, - "request": { - "path": "/1/segments", - "method": "GET" - } - }, - { - "testName": "fetchAllSegments with segmentType custom", - "parameters": { - "type": "custom" - }, - "request": { - "path": "/1/segments", - "method": "GET", - "queryParameters": { - "type": "custom" - } - } - }, - { - "testName": "fetchAllSegments with segmentType computed", - "parameters": { - "type": "computed" - }, - "request": { - "path": "/1/segments", - "method": "GET", - "queryParameters": { - "type": "computed" - } - } - } -] diff --git a/tests/CTS/methods/requests/predict/fetchAllUserProfiles.json b/tests/CTS/methods/requests/predict/fetchAllUserProfiles.json deleted file mode 100644 index 3702445f0e..0000000000 --- a/tests/CTS/methods/requests/predict/fetchAllUserProfiles.json +++ /dev/null @@ -1,81 +0,0 @@ -[ - { - "testName": "fetchAllUserProfiles with minimal parameters for modelsToRetrieve", - "parameters": { - "modelsToRetrieve": [ - "funnel_stage", - "order_value", - "affinities" - ] - }, - "request": { - "path": "/1/users", - "method": "POST", - "body": { - "modelsToRetrieve": [ - "funnel_stage", - "order_value", - "affinities" - ] - } - } - }, - { - "testName": "fetchAllUserProfiles with minimal parameters for typesToRetrieve", - "parameters": { - "typesToRetrieve": [ - "properties", - "segments" - ] - }, - "request": { - "path": "/1/users", - "method": "POST", - "body": { - "typesToRetrieve": [ - "properties", - "segments" - ] - } - } - }, - { - "testName": "fetchAllUserProfiles with a limit", - "parameters": { - "limit": 10 - }, - "request": { - "path": "/1/users", - "method": "POST", - "body": { - "limit": 10 - } - } - }, - { - "testName": "fetchAllUserProfiles with a nextPageToken", - "parameters": { - "nextPageToken": "nextPageTokenExample123" - }, - "request": { - "path": "/1/users", - "method": "POST", - "body": { - "nextPageToken": "nextPageTokenExample123" - } - } - }, - { - "testName": "fetchAllUserProfiles with a previousPageToken", - "parameters": { - "previousPageToken": "previousPageTokenExample123" - }, - "request": { - "path": "/1/users", - "method": "POST", - "body": { - "previousPageToken": "previousPageTokenExample123" - } - } - } -] diff --git a/tests/CTS/methods/requests/predict/fetchSegment.json b/tests/CTS/methods/requests/predict/fetchSegment.json deleted file mode 100644 index 9416a9bfd1..0000000000 --- a/tests/CTS/methods/requests/predict/fetchSegment.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - "testName": "fetchSegment with user ID", - "parameters": { - "segmentID": "segment1" - }, - "request": { - "path": "/1/segments/segment1", - "method": "GET" - } - } -] diff --git a/tests/CTS/methods/requests/predict/fetchUserProfile.json b/tests/CTS/methods/requests/predict/fetchUserProfile.json deleted file mode 100644 index 02f4da1430..0000000000 --- a/tests/CTS/methods/requests/predict/fetchUserProfile.json +++ /dev/null @@ -1,80 +0,0 @@ -[ - { - "testName": "fetchUserProfile with minimal parameters for modelsToRetrieve", - "parameters": { - "userID": "user1", - "params": { - "modelsToRetrieve": [ - "funnel_stage", - "order_value", - "affinities" - ] - } - }, - "request": { - "path": "/1/users/user1/fetch", - "method": "POST", - "body": { - "modelsToRetrieve": [ - "funnel_stage", - "order_value", - "affinities" - ] - } - } - }, - { - "testName": "fetchUserProfile with minimal parameters for typesToRetrieve", - "parameters": { - "userID": "user1", - "params": { - "typesToRetrieve": [ - "properties", - "segments" - ] - } - }, - "request": { - "path": "/1/users/user1/fetch", - "method": "POST", - "body": { - "typesToRetrieve": [ - "properties", - "segments" - ] - } - } - }, - { - "testName": "fetchUserProfile with all parameters", - "parameters": { - "userID": "user1", - "params": { - "modelsToRetrieve": [ - "funnel_stage", - "order_value", - "affinities" - ], - "typesToRetrieve": [ - "properties", - "segments" - ] - } - }, - "request": { - "path": "/1/users/user1/fetch", - "method": "POST", - "body": { - "modelsToRetrieve": [ - "funnel_stage", - "order_value", - "affinities" - ], - "typesToRetrieve": [ - "properties", - "segments" - ] - } - } - } -] diff --git a/tests/CTS/methods/requests/predict/getAvailableModelTypes.json b/tests/CTS/methods/requests/predict/getAvailableModelTypes.json deleted file mode 100644 index b6cf8f422c..0000000000 --- a/tests/CTS/methods/requests/predict/getAvailableModelTypes.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "testName": "get available model types", - "parameters": {}, - "request": { - "path": "/1/predict/modeltypes", - "method": "GET" - } - } -] \ No newline at end of file diff --git a/tests/CTS/methods/requests/predict/getModelInstanceConfig.json b/tests/CTS/methods/requests/predict/getModelInstanceConfig.json deleted file mode 100644 index b63ce8b1a8..0000000000 --- a/tests/CTS/methods/requests/predict/getModelInstanceConfig.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - "testName": "get configurations for a model instance", - "parameters": { - "modelID": "model1" - }, - "request": { - "path": "/1/predict/models/model1", - "method": "GET" - } - } -] \ No newline at end of file diff --git a/tests/CTS/methods/requests/predict/getModelInstances.json b/tests/CTS/methods/requests/predict/getModelInstances.json deleted file mode 100644 index 76478a5daf..0000000000 --- a/tests/CTS/methods/requests/predict/getModelInstances.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "testName": "get a list of model instances", - "parameters": {}, - "request": { - "path": "/1/predict/models", - "method": "GET" - } - } -] \ No newline at end of file diff --git a/tests/CTS/methods/requests/predict/getModelMetrics.json b/tests/CTS/methods/requests/predict/getModelMetrics.json deleted file mode 100644 index 39effe038b..0000000000 --- a/tests/CTS/methods/requests/predict/getModelMetrics.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - "testName": "get metrics for a model instance", - "parameters": { - "modelID": "model1" - }, - "request": { - "path": "/1/predict/models/model1/metrics", - "method": "GET" - } - } -] \ No newline at end of file diff --git a/tests/CTS/methods/requests/predict/getSegmentUsers.json b/tests/CTS/methods/requests/predict/getSegmentUsers.json deleted file mode 100644 index d0ff464646..0000000000 --- a/tests/CTS/methods/requests/predict/getSegmentUsers.json +++ /dev/null @@ -1,90 +0,0 @@ -[ - { - "testName": "getSegmentUsers with minimal parameters for modelsToRetrieve", - "parameters": { - "segmentID": "segmentID1", - "fetchAllUserProfilesParams": { - "modelsToRetrieve": [ - "funnel_stage" - ] - } - }, - "request": { - "path": "/1/segments/segmentID1/users", - "method": "POST", - "body": { - "modelsToRetrieve": [ - "funnel_stage" - ] - } - } - }, - { - "testName": "getSegmentUsers with minimal parameters for typesToRetrieve", - "parameters": { - "segmentID": "segmentID1", - "fetchAllUserProfilesParams": { - "typesToRetrieve": [ - "properties" - ] - } - }, - "request": { - "path": "/1/segments/segmentID1/users", - "method": "POST", - "body": { - "typesToRetrieve": [ - "properties" - ] - } - } - }, - { - "testName": "getSegmentUsers with a limit", - "parameters": { - "segmentID": "segmentID1", - "fetchAllUserProfilesParams": { - "limit": 10 - } - }, - "request": { - "path": "/1/segments/segmentID1/users", - "method": "POST", - "body": { - "limit": 10 - } - } - }, - { - "testName": "getSegmentUsers with a nextPageToken", - "parameters": { - "segmentID": "segmentID1", - "fetchAllUserProfilesParams": { - "nextPageToken": "nextPageTokenExample123" - } - }, - "request": { - "path": "/1/segments/segmentID1/users", - "method": "POST", - "body": { - "nextPageToken": "nextPageTokenExample123" - } - } - }, - { - "testName": "getSegmentUsers with a previousPageToken", - "parameters": { - "segmentID": "segmentID1", - "fetchAllUserProfilesParams": { - "previousPageToken": "previousPageTokenExample123" - } - }, - "request": { - "path": "/1/segments/segmentID1/users", - "method": "POST", - "body": { - "previousPageToken": "previousPageTokenExample123" - } - } - } -] diff --git a/tests/CTS/methods/requests/predict/updateModelInstance.json b/tests/CTS/methods/requests/predict/updateModelInstance.json deleted file mode 100644 index 0737a10abe..0000000000 --- a/tests/CTS/methods/requests/predict/updateModelInstance.json +++ /dev/null @@ -1,32 +0,0 @@ -[ - { - "testName": "update a model instance", - "parameters": { - "modelID": "model1", - "updateModelParams": { - "name": "Shopping stage for EU users", - "modelAttributes": [ - "brand", - "color", - "category_level0", - "category_level1" - ], - "modelStatus": "inactive" - } - }, - "request": { - "path": "/1/predict/models/model1", - "method": "POST", - "body": { - "name": "Shopping stage for EU users", - "modelAttributes": [ - "brand", - "color", - "category_level0", - "category_level1" - ], - "modelStatus": "inactive" - } - } - } -] diff --git a/tests/CTS/methods/requests/predict/updateSegment.json b/tests/CTS/methods/requests/predict/updateSegment.json deleted file mode 100644 index c51be95780..0000000000 --- a/tests/CTS/methods/requests/predict/updateSegment.json +++ /dev/null @@ -1,160 +0,0 @@ -[ - { - "testName": "updateSegment with name", - "parameters": { - "segmentID": "segment1", - "updateSegmentParams": { - "name": "example segment name" - } - }, - "request": { - "path": "/1/segments/segment1", - "method": "POST", - "body": { - "name": "example segment name" - } - } - }, - { - "testName": "updateSegment with conditions", - "parameters": { - "segmentID": "segment1", - "updateSegmentParams": { - "conditions": { - "operator": "AND", - "operands": [ - { - "name": "predictions.order_value", - "filters": [ - { - "operator": "GT", - "value": 200 - } - ] - } - ] - } - } - }, - "request": { - "path": "/1/segments/segment1", - "method": "POST", - "body": { - "conditions": { - "operator": "AND", - "operands": [ - { - "name": "predictions.order_value", - "filters": [ - { - "operator": "GT", - "value": 200 - } - ] - } - ] - } - } - }, - "extras": { - "skipForGo": true - } - }, - { - "testName": "updateSegment with name and conditions", - "parameters": { - "segmentID": "segment1", - "updateSegmentParams": { - "name": "example segment name", - "conditions": { - "operator": "AND", - "operands": [ - { - "name": "predictions.order_value", - "filters": [ - { - "operator": "GT", - "value": 200 - } - ] - } - ] - } - } - }, - "request": { - "path": "/1/segments/segment1", - "method": "POST", - "body": { - "name": "example segment name", - "conditions": { - "operator": "AND", - "operands": [ - { - "name": "predictions.order_value", - "filters": [ - { - "operator": "GT", - "value": 200 - } - ] - } - ] - } - } - }, - "extras": { - "skipForGo": true - } - }, - { - "testName": "updateSegment with filter probability", - "parameters": { - "segmentID": "segment1", - "updateSegmentParams": { - "conditions": { - "operator": "AND", - "operands": [ - { - "name": "predictions.affinities.color", - "filters": [ - { - "operator": "EQ", - "value": "red", - "probability": { - "GTE": 0.5, - "LTE": 1 - } - } - ] - } - ] - } - } - }, - "request": { - "path": "/1/segments/segment1", - "method": "POST", - "body": { - "conditions": { - "operator": "AND", - "operands": [ - { - "name": "predictions.affinities.color", - "filters": [ - { - "operator": "EQ", - "value": "red", - "probability": { - "GTE": 0.5, - "LTE": 1 - } - } - ] - } - ] - } - } - } - } -] diff --git a/tests/output/dart/pubspec_overrides.yaml b/tests/output/dart/pubspec_overrides.yaml index 785e0ab509..cefdf515d2 100644 --- a/tests/output/dart/pubspec_overrides.yaml +++ b/tests/output/dart/pubspec_overrides.yaml @@ -17,8 +17,6 @@ dependency_overrides: path: ../../../clients/algoliasearch-client-dart/packages/client_monitoring algolia_client_personalization: path: ../../../clients/algoliasearch-client-dart/packages/client_personalization - algolia_client_predict: - path: ../../../clients/algoliasearch-client-dart/packages/client_predict algolia_client_query_suggestions: path: ../../../clients/algoliasearch-client-dart/packages/client_query_suggestions algolia_client_recommend: diff --git a/tests/output/go/tests/methods/requests/predict_test.go b/tests/output/go/tests/methods/requests/predict_test.go deleted file mode 100644 index a506829585..0000000000 --- a/tests/output/go/tests/methods/requests/predict_test.go +++ /dev/null @@ -1,1351 +0,0 @@ -package tests - -import ( - "encoding/json" - "net/url" - "testing" - - "github.com/kinbiko/jsonassert" - "github.com/stretchr/testify/require" - - "github.com/algolia/algoliasearch-client-go/v4/algolia/predict" -) - -func createPredictClient() (*predict.APIClient, *echoRequester) { - echo := &echoRequester{} - cfg := predict.Configuration{ - AppID: "appID", - ApiKey: "apiKey", - Region: predict.EU, - Requester: echo, - } - client := predict.NewClientWithConfig(cfg) - - // so that the linter doesn't complain - _ = jsonassert.New(nil) - - return client, echo -} - -func TestPredict_ActivateModelInstance(t *testing.T) { - client, echo := createPredictClient() - - tests := []struct { - name string - testFunc func(t *testing.T) - }{ - { - name: "activate a model instance", - testFunc: func(t *testing.T) { - parametersStr := `{"type":"funnel_stage","name":"Shopping stage for EU users","sourceID":"0200030-129930","index":"Products Production","modelAttributes":[]}` - req := predict.ApiActivateModelInstanceRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.ActivateModelInstance(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/predict/models") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"type":"funnel_stage","name":"Shopping stage for EU users","sourceID":"0200030-129930","index":"Products Production","modelAttributes":[]}`) - }, - }, - } - for _, test := range tests { - test := test - t.Run(test.name, func(t *testing.T) { - test.testFunc(t) - }) - } -} - -func TestPredict_CreateSegment(t *testing.T) { - client, echo := createPredictClient() - - tests := []struct { - name string - testFunc func(t *testing.T) - }{ - { - name: "create segment with required params", - testFunc: func(t *testing.T) { - t.Skip("skipping test for go client") - parametersStr := `{"name":"segment1","conditions":{"operator":"AND","operands":[{"name":"predictions.order_value","filters":[{"operator":"GT","value":200}]}]}}` - req := predict.ApiCreateSegmentRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.CreateSegment(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/segments") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"name":"segment1","conditions":{"operator":"AND","operands":[{"name":"predictions.order_value","filters":[{"operator":"GT","value":200}]}]}}`) - }, - }, - { - name: "create segment with filter probability", - testFunc: func(t *testing.T) { - parametersStr := `{"name":"segment1","conditions":{"operator":"AND","operands":[{"name":"predictions.affinities.color","filters":[{"operator":"EQ","value":"red","probability":{"GTE":0.5,"LTE":1}}]}]}}` - req := predict.ApiCreateSegmentRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.CreateSegment(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/segments") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"name":"segment1","conditions":{"operator":"AND","operands":[{"name":"predictions.affinities.color","filters":[{"operator":"EQ","value":"red","probability":{"GTE":0.5,"LTE":1}}]}]}}`) - }, - }, - } - for _, test := range tests { - test := test - t.Run(test.name, func(t *testing.T) { - test.testFunc(t) - }) - } -} - -func TestPredict_Del(t *testing.T) { - client, echo := createPredictClient() - - tests := []struct { - name string - testFunc func(t *testing.T) - }{ - { - name: "allow del method for a custom path with minimal parameters", - testFunc: func(t *testing.T) { - parametersStr := `{"path":"/test/minimal"}` - req := predict.ApiDelRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.Del(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/test/minimal") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "DELETE", echo.method) - - require.Nil(t, echo.body) - }, - }, - { - name: "allow del method for a custom path with all parameters", - testFunc: func(t *testing.T) { - parametersStr := `{"path":"/test/all","parameters":{"query":"parameters"}}` - req := predict.ApiDelRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.Del(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/test/all") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "DELETE", echo.method) - - require.Nil(t, echo.body) - queryParams := map[string]string{} - require.NoError(t, json.Unmarshal([]byte(`{"query":"parameters"}`), &queryParams)) - for k, v := range queryParams { - require.Equal(t, v, echo.query.Get(k)) - } - }, - }, - } - for _, test := range tests { - test := test - t.Run(test.name, func(t *testing.T) { - test.testFunc(t) - }) - } -} - -func TestPredict_DeleteModelInstance(t *testing.T) { - client, echo := createPredictClient() - - tests := []struct { - name string - testFunc func(t *testing.T) - }{ - { - name: "delete a model instance", - testFunc: func(t *testing.T) { - parametersStr := `{"modelID":"model1"}` - req := predict.ApiDeleteModelInstanceRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.DeleteModelInstance(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/predict/models/model1") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "DELETE", echo.method) - - require.Nil(t, echo.body) - }, - }, - } - for _, test := range tests { - test := test - t.Run(test.name, func(t *testing.T) { - test.testFunc(t) - }) - } -} - -func TestPredict_DeleteSegment(t *testing.T) { - client, echo := createPredictClient() - - tests := []struct { - name string - testFunc func(t *testing.T) - }{ - { - name: "delete a segments configuration", - testFunc: func(t *testing.T) { - parametersStr := `{"segmentID":"segment1"}` - req := predict.ApiDeleteSegmentRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.DeleteSegment(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/segments/segment1") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "DELETE", echo.method) - - require.Nil(t, echo.body) - }, - }, - } - for _, test := range tests { - test := test - t.Run(test.name, func(t *testing.T) { - test.testFunc(t) - }) - } -} - -func TestPredict_DeleteUserProfile(t *testing.T) { - client, echo := createPredictClient() - - tests := []struct { - name string - testFunc func(t *testing.T) - }{ - { - name: "deleteUserProfile", - testFunc: func(t *testing.T) { - parametersStr := `{"userID":"user1"}` - req := predict.ApiDeleteUserProfileRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.DeleteUserProfile(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/users/user1") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "DELETE", echo.method) - - require.Nil(t, echo.body) - }, - }, - } - for _, test := range tests { - test := test - t.Run(test.name, func(t *testing.T) { - test.testFunc(t) - }) - } -} - -func TestPredict_FetchAllSegments(t *testing.T) { - client, echo := createPredictClient() - - tests := []struct { - name string - testFunc func(t *testing.T) - }{ - { - name: "fetchAllSegments with no segmentType", - testFunc: func(t *testing.T) { - parametersStr := `{}` - req := predict.ApiFetchAllSegmentsRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.FetchAllSegments(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/segments") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "GET", echo.method) - - require.Nil(t, echo.body) - }, - }, - { - name: "fetchAllSegments with segmentType custom", - testFunc: func(t *testing.T) { - parametersStr := `{"type":"custom"}` - req := predict.ApiFetchAllSegmentsRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.FetchAllSegments(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/segments") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "GET", echo.method) - - require.Nil(t, echo.body) - queryParams := map[string]string{} - require.NoError(t, json.Unmarshal([]byte(`{"type":"custom"}`), &queryParams)) - for k, v := range queryParams { - require.Equal(t, v, echo.query.Get(k)) - } - }, - }, - { - name: "fetchAllSegments with segmentType computed", - testFunc: func(t *testing.T) { - parametersStr := `{"type":"computed"}` - req := predict.ApiFetchAllSegmentsRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.FetchAllSegments(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/segments") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "GET", echo.method) - - require.Nil(t, echo.body) - queryParams := map[string]string{} - require.NoError(t, json.Unmarshal([]byte(`{"type":"computed"}`), &queryParams)) - for k, v := range queryParams { - require.Equal(t, v, echo.query.Get(k)) - } - }, - }, - } - for _, test := range tests { - test := test - t.Run(test.name, func(t *testing.T) { - test.testFunc(t) - }) - } -} - -func TestPredict_FetchAllUserProfiles(t *testing.T) { - client, echo := createPredictClient() - - tests := []struct { - name string - testFunc func(t *testing.T) - }{ - { - name: "fetchAllUserProfiles with minimal parameters for modelsToRetrieve", - testFunc: func(t *testing.T) { - parametersStr := `{"modelsToRetrieve":["funnel_stage","order_value","affinities"]}` - req := predict.ApiFetchAllUserProfilesRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.FetchAllUserProfiles(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/users") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"modelsToRetrieve":["funnel_stage","order_value","affinities"]}`) - }, - }, - { - name: "fetchAllUserProfiles with minimal parameters for typesToRetrieve", - testFunc: func(t *testing.T) { - parametersStr := `{"typesToRetrieve":["properties","segments"]}` - req := predict.ApiFetchAllUserProfilesRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.FetchAllUserProfiles(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/users") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"typesToRetrieve":["properties","segments"]}`) - }, - }, - { - name: "fetchAllUserProfiles with a limit", - testFunc: func(t *testing.T) { - parametersStr := `{"limit":10}` - req := predict.ApiFetchAllUserProfilesRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.FetchAllUserProfiles(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/users") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"limit":10}`) - }, - }, - { - name: "fetchAllUserProfiles with a nextPageToken", - testFunc: func(t *testing.T) { - parametersStr := `{"nextPageToken":"nextPageTokenExample123"}` - req := predict.ApiFetchAllUserProfilesRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.FetchAllUserProfiles(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/users") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"nextPageToken":"nextPageTokenExample123"}`) - }, - }, - { - name: "fetchAllUserProfiles with a previousPageToken", - testFunc: func(t *testing.T) { - parametersStr := `{"previousPageToken":"previousPageTokenExample123"}` - req := predict.ApiFetchAllUserProfilesRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.FetchAllUserProfiles(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/users") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"previousPageToken":"previousPageTokenExample123"}`) - }, - }, - } - for _, test := range tests { - test := test - t.Run(test.name, func(t *testing.T) { - test.testFunc(t) - }) - } -} - -func TestPredict_FetchSegment(t *testing.T) { - client, echo := createPredictClient() - - tests := []struct { - name string - testFunc func(t *testing.T) - }{ - { - name: "fetchSegment with user ID", - testFunc: func(t *testing.T) { - parametersStr := `{"segmentID":"segment1"}` - req := predict.ApiFetchSegmentRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.FetchSegment(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/segments/segment1") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "GET", echo.method) - - require.Nil(t, echo.body) - }, - }, - } - for _, test := range tests { - test := test - t.Run(test.name, func(t *testing.T) { - test.testFunc(t) - }) - } -} - -func TestPredict_FetchUserProfile(t *testing.T) { - client, echo := createPredictClient() - - tests := []struct { - name string - testFunc func(t *testing.T) - }{ - { - name: "fetchUserProfile with minimal parameters for modelsToRetrieve", - testFunc: func(t *testing.T) { - parametersStr := `{"userID":"user1","params":{"modelsToRetrieve":["funnel_stage","order_value","affinities"]}}` - req := predict.ApiFetchUserProfileRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.FetchUserProfile(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/users/user1/fetch") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"modelsToRetrieve":["funnel_stage","order_value","affinities"]}`) - }, - }, - { - name: "fetchUserProfile with minimal parameters for typesToRetrieve", - testFunc: func(t *testing.T) { - parametersStr := `{"userID":"user1","params":{"typesToRetrieve":["properties","segments"]}}` - req := predict.ApiFetchUserProfileRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.FetchUserProfile(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/users/user1/fetch") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"typesToRetrieve":["properties","segments"]}`) - }, - }, - { - name: "fetchUserProfile with all parameters", - testFunc: func(t *testing.T) { - parametersStr := `{"userID":"user1","params":{"modelsToRetrieve":["funnel_stage","order_value","affinities"],"typesToRetrieve":["properties","segments"]}}` - req := predict.ApiFetchUserProfileRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.FetchUserProfile(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/users/user1/fetch") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"modelsToRetrieve":["funnel_stage","order_value","affinities"],"typesToRetrieve":["properties","segments"]}`) - }, - }, - } - for _, test := range tests { - test := test - t.Run(test.name, func(t *testing.T) { - test.testFunc(t) - }) - } -} - -func TestPredict_Get(t *testing.T) { - client, echo := createPredictClient() - - tests := []struct { - name string - testFunc func(t *testing.T) - }{ - { - name: "allow get method for a custom path with minimal parameters", - testFunc: func(t *testing.T) { - parametersStr := `{"path":"/test/minimal"}` - req := predict.ApiGetRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.Get(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/test/minimal") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "GET", echo.method) - - require.Nil(t, echo.body) - }, - }, - { - name: "allow get method for a custom path with all parameters", - testFunc: func(t *testing.T) { - parametersStr := `{"path":"/test/all","parameters":{"query":"parameters"}}` - req := predict.ApiGetRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.Get(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/test/all") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "GET", echo.method) - - require.Nil(t, echo.body) - queryParams := map[string]string{} - require.NoError(t, json.Unmarshal([]byte(`{"query":"parameters"}`), &queryParams)) - for k, v := range queryParams { - require.Equal(t, v, echo.query.Get(k)) - } - }, - }, - } - for _, test := range tests { - test := test - t.Run(test.name, func(t *testing.T) { - test.testFunc(t) - }) - } -} - -func TestPredict_GetAvailableModelTypes(t *testing.T) { - client, echo := createPredictClient() - - tests := []struct { - name string - testFunc func(t *testing.T) - }{ - { - name: "get available model types", - testFunc: func(t *testing.T) { - _, err := client.GetAvailableModelTypes() - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/predict/modeltypes") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "GET", echo.method) - - require.Nil(t, echo.body) - }, - }, - } - for _, test := range tests { - test := test - t.Run(test.name, func(t *testing.T) { - test.testFunc(t) - }) - } -} - -func TestPredict_GetModelInstanceConfig(t *testing.T) { - client, echo := createPredictClient() - - tests := []struct { - name string - testFunc func(t *testing.T) - }{ - { - name: "get configurations for a model instance", - testFunc: func(t *testing.T) { - parametersStr := `{"modelID":"model1"}` - req := predict.ApiGetModelInstanceConfigRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.GetModelInstanceConfig(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/predict/models/model1") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "GET", echo.method) - - require.Nil(t, echo.body) - }, - }, - } - for _, test := range tests { - test := test - t.Run(test.name, func(t *testing.T) { - test.testFunc(t) - }) - } -} - -func TestPredict_GetModelInstances(t *testing.T) { - client, echo := createPredictClient() - - tests := []struct { - name string - testFunc func(t *testing.T) - }{ - { - name: "get a list of model instances", - testFunc: func(t *testing.T) { - _, err := client.GetModelInstances() - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/predict/models") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "GET", echo.method) - - require.Nil(t, echo.body) - }, - }, - } - for _, test := range tests { - test := test - t.Run(test.name, func(t *testing.T) { - test.testFunc(t) - }) - } -} - -func TestPredict_GetModelMetrics(t *testing.T) { - client, echo := createPredictClient() - - tests := []struct { - name string - testFunc func(t *testing.T) - }{ - { - name: "get metrics for a model instance", - testFunc: func(t *testing.T) { - parametersStr := `{"modelID":"model1"}` - req := predict.ApiGetModelMetricsRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.GetModelMetrics(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/predict/models/model1/metrics") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "GET", echo.method) - - require.Nil(t, echo.body) - }, - }, - } - for _, test := range tests { - test := test - t.Run(test.name, func(t *testing.T) { - test.testFunc(t) - }) - } -} - -func TestPredict_GetSegmentUsers(t *testing.T) { - client, echo := createPredictClient() - - tests := []struct { - name string - testFunc func(t *testing.T) - }{ - { - name: "getSegmentUsers with minimal parameters for modelsToRetrieve", - testFunc: func(t *testing.T) { - parametersStr := `{"segmentID":"segmentID1","fetchAllUserProfilesParams":{"modelsToRetrieve":["funnel_stage"]}}` - req := predict.ApiGetSegmentUsersRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.GetSegmentUsers(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/segments/segmentID1/users") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"modelsToRetrieve":["funnel_stage"]}`) - }, - }, - { - name: "getSegmentUsers with minimal parameters for typesToRetrieve", - testFunc: func(t *testing.T) { - parametersStr := `{"segmentID":"segmentID1","fetchAllUserProfilesParams":{"typesToRetrieve":["properties"]}}` - req := predict.ApiGetSegmentUsersRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.GetSegmentUsers(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/segments/segmentID1/users") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"typesToRetrieve":["properties"]}`) - }, - }, - { - name: "getSegmentUsers with a limit", - testFunc: func(t *testing.T) { - parametersStr := `{"segmentID":"segmentID1","fetchAllUserProfilesParams":{"limit":10}}` - req := predict.ApiGetSegmentUsersRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.GetSegmentUsers(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/segments/segmentID1/users") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"limit":10}`) - }, - }, - { - name: "getSegmentUsers with a nextPageToken", - testFunc: func(t *testing.T) { - parametersStr := `{"segmentID":"segmentID1","fetchAllUserProfilesParams":{"nextPageToken":"nextPageTokenExample123"}}` - req := predict.ApiGetSegmentUsersRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.GetSegmentUsers(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/segments/segmentID1/users") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"nextPageToken":"nextPageTokenExample123"}`) - }, - }, - { - name: "getSegmentUsers with a previousPageToken", - testFunc: func(t *testing.T) { - parametersStr := `{"segmentID":"segmentID1","fetchAllUserProfilesParams":{"previousPageToken":"previousPageTokenExample123"}}` - req := predict.ApiGetSegmentUsersRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.GetSegmentUsers(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/segments/segmentID1/users") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"previousPageToken":"previousPageTokenExample123"}`) - }, - }, - } - for _, test := range tests { - test := test - t.Run(test.name, func(t *testing.T) { - test.testFunc(t) - }) - } -} - -func TestPredict_Post(t *testing.T) { - client, echo := createPredictClient() - - tests := []struct { - name string - testFunc func(t *testing.T) - }{ - { - name: "allow post method for a custom path with minimal parameters", - testFunc: func(t *testing.T) { - parametersStr := `{"path":"/test/minimal"}` - req := predict.ApiPostRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.Post(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/test/minimal") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{}`) - }, - }, - { - name: "allow post method for a custom path with all parameters", - testFunc: func(t *testing.T) { - parametersStr := `{"path":"/test/all","parameters":{"query":"parameters"},"body":{"body":"parameters"}}` - req := predict.ApiPostRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.Post(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/test/all") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"body":"parameters"}`) - queryParams := map[string]string{} - require.NoError(t, json.Unmarshal([]byte(`{"query":"parameters"}`), &queryParams)) - for k, v := range queryParams { - require.Equal(t, v, echo.query.Get(k)) - } - }, - }, - { - name: "requestOptions can override default query parameters", - testFunc: func(t *testing.T) { - parametersStr := `{"path":"/test/requestOptions","parameters":{"query":"parameters"},"body":{"facet":"filters"}}` - req := predict.ApiPostRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - var opts []predict.Option - requestOptionParameters := map[string]any{} - require.NoError(t, json.Unmarshal([]byte(`{"query":"myQueryParameter"}`), &requestOptionParameters)) - for k, v := range requestOptionParameters { - opts = append(opts, predict.QueryParamOption(k, v)) - } - _, err := client.Post(req, opts...) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/test/requestOptions") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"facet":"filters"}`) - queryParams := map[string]string{} - require.NoError(t, json.Unmarshal([]byte(`{"query":"myQueryParameter"}`), &queryParams)) - for k, v := range queryParams { - require.Equal(t, v, echo.query.Get(k)) - } - }, - }, - { - name: "requestOptions merges query parameters with default ones", - testFunc: func(t *testing.T) { - parametersStr := `{"path":"/test/requestOptions","parameters":{"query":"parameters"},"body":{"facet":"filters"}}` - req := predict.ApiPostRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - var opts []predict.Option - requestOptionParameters := map[string]any{} - require.NoError(t, json.Unmarshal([]byte(`{"query2":"myQueryParameter"}`), &requestOptionParameters)) - for k, v := range requestOptionParameters { - opts = append(opts, predict.QueryParamOption(k, v)) - } - _, err := client.Post(req, opts...) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/test/requestOptions") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"facet":"filters"}`) - queryParams := map[string]string{} - require.NoError(t, json.Unmarshal([]byte(`{"query":"parameters","query2":"myQueryParameter"}`), &queryParams)) - for k, v := range queryParams { - require.Equal(t, v, echo.query.Get(k)) - } - }, - }, - { - name: "requestOptions can override default headers", - testFunc: func(t *testing.T) { - parametersStr := `{"path":"/test/requestOptions","parameters":{"query":"parameters"},"body":{"facet":"filters"}}` - req := predict.ApiPostRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - var opts []predict.Option - requestOptionHeaders := map[string]any{} - require.NoError(t, json.Unmarshal([]byte(`{"x-algolia-api-key":"myApiKey"}`), &requestOptionHeaders)) - for k, v := range requestOptionHeaders { - opts = append(opts, predict.HeaderParamOption(k, v)) - } - _, err := client.Post(req, opts...) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/test/requestOptions") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"facet":"filters"}`) - headers := map[string]string{} - require.NoError(t, json.Unmarshal([]byte(`{"x-algolia-api-key":"myApiKey"}`), &headers)) - for k, v := range headers { - require.Equal(t, v, echo.header.Get(k)) - } - queryParams := map[string]string{} - require.NoError(t, json.Unmarshal([]byte(`{"query":"parameters"}`), &queryParams)) - for k, v := range queryParams { - require.Equal(t, v, echo.query.Get(k)) - } - }, - }, - { - name: "requestOptions merges headers with default ones", - testFunc: func(t *testing.T) { - parametersStr := `{"path":"/test/requestOptions","parameters":{"query":"parameters"},"body":{"facet":"filters"}}` - req := predict.ApiPostRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - var opts []predict.Option - requestOptionHeaders := map[string]any{} - require.NoError(t, json.Unmarshal([]byte(`{"x-algolia-api-key":"myApiKey"}`), &requestOptionHeaders)) - for k, v := range requestOptionHeaders { - opts = append(opts, predict.HeaderParamOption(k, v)) - } - _, err := client.Post(req, opts...) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/test/requestOptions") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"facet":"filters"}`) - headers := map[string]string{} - require.NoError(t, json.Unmarshal([]byte(`{"x-algolia-api-key":"myApiKey"}`), &headers)) - for k, v := range headers { - require.Equal(t, v, echo.header.Get(k)) - } - queryParams := map[string]string{} - require.NoError(t, json.Unmarshal([]byte(`{"query":"parameters"}`), &queryParams)) - for k, v := range queryParams { - require.Equal(t, v, echo.query.Get(k)) - } - }, - }, - { - name: "requestOptions queryParameters accepts booleans", - testFunc: func(t *testing.T) { - parametersStr := `{"path":"/test/requestOptions","parameters":{"query":"parameters"},"body":{"facet":"filters"}}` - req := predict.ApiPostRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - var opts []predict.Option - requestOptionParameters := map[string]any{} - require.NoError(t, json.Unmarshal([]byte(`{"isItWorking":true}`), &requestOptionParameters)) - for k, v := range requestOptionParameters { - opts = append(opts, predict.QueryParamOption(k, v)) - } - _, err := client.Post(req, opts...) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/test/requestOptions") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"facet":"filters"}`) - queryParams := map[string]string{} - require.NoError(t, json.Unmarshal([]byte(`{"query":"parameters","isItWorking":"true"}`), &queryParams)) - for k, v := range queryParams { - require.Equal(t, v, echo.query.Get(k)) - } - }, - }, - { - name: "requestOptions queryParameters accepts integers", - testFunc: func(t *testing.T) { - parametersStr := `{"path":"/test/requestOptions","parameters":{"query":"parameters"},"body":{"facet":"filters"}}` - req := predict.ApiPostRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - var opts []predict.Option - requestOptionParameters := map[string]any{} - require.NoError(t, json.Unmarshal([]byte(`{"myParam":2}`), &requestOptionParameters)) - for k, v := range requestOptionParameters { - opts = append(opts, predict.QueryParamOption(k, v)) - } - _, err := client.Post(req, opts...) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/test/requestOptions") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"facet":"filters"}`) - queryParams := map[string]string{} - require.NoError(t, json.Unmarshal([]byte(`{"query":"parameters","myParam":"2"}`), &queryParams)) - for k, v := range queryParams { - require.Equal(t, v, echo.query.Get(k)) - } - }, - }, - { - name: "requestOptions queryParameters accepts list of string", - testFunc: func(t *testing.T) { - parametersStr := `{"path":"/test/requestOptions","parameters":{"query":"parameters"},"body":{"facet":"filters"}}` - req := predict.ApiPostRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - var opts []predict.Option - requestOptionParameters := map[string]any{} - require.NoError(t, json.Unmarshal([]byte(`{"myParam":["c","d"]}`), &requestOptionParameters)) - for k, v := range requestOptionParameters { - opts = append(opts, predict.QueryParamOption(k, v)) - } - _, err := client.Post(req, opts...) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/test/requestOptions") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"facet":"filters"}`) - queryParams := map[string]string{} - require.NoError(t, json.Unmarshal([]byte(`{"query":"parameters","myParam":"c,d"}`), &queryParams)) - for k, v := range queryParams { - require.Equal(t, v, echo.query.Get(k)) - } - }, - }, - { - name: "requestOptions queryParameters accepts list of booleans", - testFunc: func(t *testing.T) { - parametersStr := `{"path":"/test/requestOptions","parameters":{"query":"parameters"},"body":{"facet":"filters"}}` - req := predict.ApiPostRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - var opts []predict.Option - requestOptionParameters := map[string]any{} - require.NoError(t, json.Unmarshal([]byte(`{"myParam":[true,true,false]}`), &requestOptionParameters)) - for k, v := range requestOptionParameters { - opts = append(opts, predict.QueryParamOption(k, v)) - } - _, err := client.Post(req, opts...) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/test/requestOptions") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"facet":"filters"}`) - queryParams := map[string]string{} - require.NoError(t, json.Unmarshal([]byte(`{"query":"parameters","myParam":"true,true,false"}`), &queryParams)) - for k, v := range queryParams { - require.Equal(t, v, echo.query.Get(k)) - } - }, - }, - { - name: "requestOptions queryParameters accepts list of integers", - testFunc: func(t *testing.T) { - parametersStr := `{"path":"/test/requestOptions","parameters":{"query":"parameters"},"body":{"facet":"filters"}}` - req := predict.ApiPostRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - var opts []predict.Option - requestOptionParameters := map[string]any{} - require.NoError(t, json.Unmarshal([]byte(`{"myParam":[1,2]}`), &requestOptionParameters)) - for k, v := range requestOptionParameters { - opts = append(opts, predict.QueryParamOption(k, v)) - } - _, err := client.Post(req, opts...) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/test/requestOptions") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"facet":"filters"}`) - queryParams := map[string]string{} - require.NoError(t, json.Unmarshal([]byte(`{"query":"parameters","myParam":"1,2"}`), &queryParams)) - for k, v := range queryParams { - require.Equal(t, v, echo.query.Get(k)) - } - }, - }, - } - for _, test := range tests { - test := test - t.Run(test.name, func(t *testing.T) { - test.testFunc(t) - }) - } -} - -func TestPredict_Put(t *testing.T) { - client, echo := createPredictClient() - - tests := []struct { - name string - testFunc func(t *testing.T) - }{ - { - name: "allow put method for a custom path with minimal parameters", - testFunc: func(t *testing.T) { - parametersStr := `{"path":"/test/minimal"}` - req := predict.ApiPutRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.Put(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/test/minimal") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "PUT", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{}`) - }, - }, - { - name: "allow put method for a custom path with all parameters", - testFunc: func(t *testing.T) { - parametersStr := `{"path":"/test/all","parameters":{"query":"parameters"},"body":{"body":"parameters"}}` - req := predict.ApiPutRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.Put(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/test/all") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "PUT", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"body":"parameters"}`) - queryParams := map[string]string{} - require.NoError(t, json.Unmarshal([]byte(`{"query":"parameters"}`), &queryParams)) - for k, v := range queryParams { - require.Equal(t, v, echo.query.Get(k)) - } - }, - }, - } - for _, test := range tests { - test := test - t.Run(test.name, func(t *testing.T) { - test.testFunc(t) - }) - } -} - -func TestPredict_UpdateModelInstance(t *testing.T) { - client, echo := createPredictClient() - - tests := []struct { - name string - testFunc func(t *testing.T) - }{ - { - name: "update a model instance", - testFunc: func(t *testing.T) { - parametersStr := `{"modelID":"model1","updateModelParams":{"name":"Shopping stage for EU users","modelAttributes":["brand","color","category_level0","category_level1"],"modelStatus":"inactive"}}` - req := predict.ApiUpdateModelInstanceRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.UpdateModelInstance(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/predict/models/model1") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"name":"Shopping stage for EU users","modelAttributes":["brand","color","category_level0","category_level1"],"modelStatus":"inactive"}`) - }, - }, - } - for _, test := range tests { - test := test - t.Run(test.name, func(t *testing.T) { - test.testFunc(t) - }) - } -} - -func TestPredict_UpdateSegment(t *testing.T) { - client, echo := createPredictClient() - - tests := []struct { - name string - testFunc func(t *testing.T) - }{ - { - name: "updateSegment with name", - testFunc: func(t *testing.T) { - parametersStr := `{"segmentID":"segment1","updateSegmentParams":{"name":"example segment name"}}` - req := predict.ApiUpdateSegmentRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.UpdateSegment(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/segments/segment1") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"name":"example segment name"}`) - }, - }, - { - name: "updateSegment with conditions", - testFunc: func(t *testing.T) { - t.Skip("skipping test for go client") - parametersStr := `{"segmentID":"segment1","updateSegmentParams":{"conditions":{"operator":"AND","operands":[{"name":"predictions.order_value","filters":[{"operator":"GT","value":200}]}]}}}` - req := predict.ApiUpdateSegmentRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.UpdateSegment(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/segments/segment1") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"conditions":{"operator":"AND","operands":[{"name":"predictions.order_value","filters":[{"operator":"GT","value":200}]}]}}`) - }, - }, - { - name: "updateSegment with name and conditions", - testFunc: func(t *testing.T) { - t.Skip("skipping test for go client") - parametersStr := `{"segmentID":"segment1","updateSegmentParams":{"name":"example segment name","conditions":{"operator":"AND","operands":[{"name":"predictions.order_value","filters":[{"operator":"GT","value":200}]}]}}}` - req := predict.ApiUpdateSegmentRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.UpdateSegment(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/segments/segment1") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"name":"example segment name","conditions":{"operator":"AND","operands":[{"name":"predictions.order_value","filters":[{"operator":"GT","value":200}]}]}}`) - }, - }, - { - name: "updateSegment with filter probability", - testFunc: func(t *testing.T) { - parametersStr := `{"segmentID":"segment1","updateSegmentParams":{"conditions":{"operator":"AND","operands":[{"name":"predictions.affinities.color","filters":[{"operator":"EQ","value":"red","probability":{"GTE":0.5,"LTE":1}}]}]}}}` - req := predict.ApiUpdateSegmentRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.UpdateSegment(req) - require.NoError(t, err) - - expectedPath, err := url.QueryUnescape("/1/segments/segment1") - require.NoError(t, err) - require.Equal(t, expectedPath, echo.path) - require.Equal(t, "POST", echo.method) - - ja := jsonassert.New(t) - ja.Assertf(*echo.body, `{"conditions":{"operator":"AND","operands":[{"name":"predictions.affinities.color","filters":[{"operator":"EQ","value":"red","probability":{"GTE":0.5,"LTE":1}}]}]}}`) - }, - }, - } - for _, test := range tests { - test := test - t.Run(test.name, func(t *testing.T) { - test.testFunc(t) - }) - } -} diff --git a/tests/output/java/src/test/java/com/algolia/client/Predict.test.java b/tests/output/java/src/test/java/com/algolia/client/Predict.test.java deleted file mode 100644 index 5bb0174c43..0000000000 --- a/tests/output/java/src/test/java/com/algolia/client/Predict.test.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.algolia.client; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import com.algolia.EchoInterceptor; -import com.algolia.EchoResponse; -import com.algolia.api.PredictClient; -import com.algolia.model.predict.*; -import com.algolia.utils.ClientOptions; -import com.algolia.utils.HttpRequester; -import java.util.*; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestInstance; - -@TestInstance(TestInstance.Lifecycle.PER_CLASS) -class PredictClientClientTests { - - private HttpRequester requester; - private EchoInterceptor echo; - - @BeforeAll - void init() { - requester = new HttpRequester(); - echo = new EchoInterceptor(); - requester.addInterceptor(echo.getEchoInterceptor()); - } - - PredictClient createClient() { - return new PredictClient("appId", "apiKey", "eu", new ClientOptions().setRequester(requester)); - } - - @Test - @DisplayName("calls api with correct user agent") - void commonApiTest0() { - PredictClient $client = createClient(); - - String path0 = "/test"; - - $client.post(path0); - EchoResponse result = echo.getLastResponse(); - - { - String regexp = - "^Algolia for Java \\(\\d+\\.\\d+\\.\\d+(-.*)?\\)(; [a-zA-Z. ]+" + - " (\\(\\d+((\\.\\d+)?\\.\\d+)?(-.*)?\\))?)*(; Predict" + - " (\\(\\d+\\.\\d+\\.\\d+(-.*)?\\)))(; [a-zA-Z. ]+" + - " (\\(\\d+((\\.\\d+)?\\.\\d+)?(-.*)?\\))?)*$"; - assertTrue( - result.headers.get("user-agent").matches(regexp), - "Expected " + result.headers.get("user-agent") + " to match the following regex: " + regexp - ); - } - } - - @Test - @DisplayName("calls api with default read timeouts") - void commonApiTest1() { - PredictClient $client = createClient(); - - String path0 = "/test"; - - $client.get(path0); - EchoResponse result = echo.getLastResponse(); - - assertEquals(2000, result.connectTimeout); - assertEquals(5000, result.responseTimeout); - } - - @Test - @DisplayName("calls api with default write timeouts") - void commonApiTest2() { - PredictClient $client = createClient(); - - String path0 = "/test"; - - $client.post(path0); - EchoResponse result = echo.getLastResponse(); - - assertEquals(2000, result.connectTimeout); - assertEquals(30000, result.responseTimeout); - } - - @Test - @DisplayName("throws when region is not given") - void parametersTest0() { - { - Exception exception = assertThrows( - Exception.class, - () -> { - PredictClient $client = new PredictClient("my-app-id", "my-api-key", "", new ClientOptions().setRequester(requester)); - } - ); - assertEquals("`region` is required and must be one of the following: eu, us", exception.getMessage()); - } - } - - @Test - @DisplayName("throws when incorrect region is given") - void parametersTest1() { - { - Exception exception = assertThrows( - Exception.class, - () -> { - PredictClient $client = new PredictClient("my-app-id", "my-api-key", "not_a_region", new ClientOptions().setRequester(requester)); - } - ); - assertEquals("`region` is required and must be one of the following: eu, us", exception.getMessage()); - } - } - - @Test - @DisplayName("does not throw when region is given") - void parametersTest2() { - PredictClient $client = new PredictClient("my-app-id", "my-api-key", "eu", new ClientOptions().setRequester(requester)); - } -} diff --git a/tests/output/java/src/test/java/com/algolia/methods/requests/Predict.test.java b/tests/output/java/src/test/java/com/algolia/methods/requests/Predict.test.java deleted file mode 100644 index 4ea25144f5..0000000000 --- a/tests/output/java/src/test/java/com/algolia/methods/requests/Predict.test.java +++ /dev/null @@ -1,1392 +0,0 @@ -package com.algolia.methods.requests; - -import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.fail; - -import com.algolia.EchoInterceptor; -import com.algolia.EchoResponse; -import com.algolia.api.PredictClient; -import com.algolia.model.predict.*; -import com.algolia.utils.ClientOptions; -import com.algolia.utils.HttpRequester; -import com.algolia.utils.JSONBuilder; -import com.algolia.utils.RequestOptions; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.*; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestInstance; -import org.skyscreamer.jsonassert.JSONAssert; -import org.skyscreamer.jsonassert.JSONCompareMode; - -@TestInstance(TestInstance.Lifecycle.PER_CLASS) -class PredictClientRequestsTests { - - private PredictClient client; - private EchoInterceptor echo; - private ObjectMapper json; - - @BeforeAll - void init() { - json = new JSONBuilder().failOnUnknown(true).build(); - HttpRequester requester = new HttpRequester(); - echo = new EchoInterceptor(); - requester.addInterceptor(echo.getEchoInterceptor()); - client = new PredictClient("appId", "apiKey", "eu", new ClientOptions().setRequester(requester)); - } - - @Test - @DisplayName("activate a model instance") - void activateModelInstanceTest0() { - ActivateModelParams activateModelParams0 = new ActivateModelParams(); - { - ModelsToRetrieve type1 = ModelsToRetrieve.fromValue("funnel_stage"); - activateModelParams0.setType(type1); - String name1 = "Shopping stage for EU users"; - activateModelParams0.setName(name1); - String sourceID1 = "0200030-129930"; - activateModelParams0.setSourceID(sourceID1); - String index1 = "Products Production"; - activateModelParams0.setIndex(index1); - List modelAttributes1 = new ArrayList<>(); - {} - activateModelParams0.setModelAttributes(modelAttributes1); - List contentAttributes1 = new ArrayList<>(); - { - String contentAttributes_02 = "title"; - contentAttributes1.add(contentAttributes_02); - String contentAttributes_12 = "description"; - contentAttributes1.add(contentAttributes_12); - } - activateModelParams0.setContentAttributes(contentAttributes1); - } - - assertDoesNotThrow(() -> { - client.activateModelInstance(activateModelParams0); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/predict/models"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals( - "{\"type\":\"funnel_stage\",\"name\":\"Shopping stage for EU" + - " users\",\"sourceID\":\"0200030-129930\",\"index\":\"Products" + - " Production\",\"modelAttributes\":[],\"contentAttributes\":[\"title\",\"description\"]}", - req.body, - JSONCompareMode.STRICT - ); - }); - } - - @Test - @DisplayName("create segment with required params") - void createSegmentTest0() { - CreateSegmentParams createSegmentParams0 = new CreateSegmentParams(); - { - String name1 = "segment1"; - createSegmentParams0.setName(name1); - String conditions1 = "predictions.order_value.value > 100 AND predictions.funnel_stage.score < 0.9"; - createSegmentParams0.setConditions(conditions1); - } - - assertDoesNotThrow(() -> { - client.createSegment(createSegmentParams0); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/segments"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals( - "{\"name\":\"segment1\",\"conditions\":\"predictions.order_value.value > 100 AND" + " predictions.funnel_stage.score < 0.9\"}", - req.body, - JSONCompareMode.STRICT - ); - }); - } - - @Test - @DisplayName("allow del method for a custom path with minimal parameters") - void delTest0() { - String path0 = "/test/minimal"; - - assertDoesNotThrow(() -> { - client.del(path0); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/test/minimal"); - assertEquals(req.method, "DELETE"); - assertNull(req.body); - } - - @Test - @DisplayName("allow del method for a custom path with all parameters") - void delTest1() { - String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); - { - String query1 = "parameters"; - parameters0.put("query", query1); - } - - assertDoesNotThrow(() -> { - client.del(path0, parameters0); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/test/all"); - assertEquals(req.method, "DELETE"); - assertNull(req.body); - - try { - Map expectedQuery = json.readValue("{\"query\":\"parameters\"}", new TypeReference>() {}); - Map actualQuery = req.queryParameters; - - assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { - assertEquals(expectedQuery.get(p.getKey()), p.getValue()); - } - } catch (JsonProcessingException e) { - fail("failed to parse queryParameters json"); - } - } - - @Test - @DisplayName("delete a model instance") - void deleteModelInstanceTest0() { - String modelID0 = "model1"; - - assertDoesNotThrow(() -> { - client.deleteModelInstance(modelID0); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/predict/models/model1"); - assertEquals(req.method, "DELETE"); - assertNull(req.body); - } - - @Test - @DisplayName("delete a segments configuration") - void deleteSegmentTest0() { - String segmentID0 = "segment1"; - - assertDoesNotThrow(() -> { - client.deleteSegment(segmentID0); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/segments/segment1"); - assertEquals(req.method, "DELETE"); - assertNull(req.body); - } - - @Test - @DisplayName("deleteUserProfile") - void deleteUserProfileTest0() { - String userID0 = "user1"; - - assertDoesNotThrow(() -> { - client.deleteUserProfile(userID0); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/users/user1"); - assertEquals(req.method, "DELETE"); - assertNull(req.body); - } - - @Test - @DisplayName("fetchAllSegments with no segmentType") - void fetchAllSegmentsTest0() { - assertDoesNotThrow(() -> { - client.fetchAllSegments(); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/segments"); - assertEquals(req.method, "GET"); - assertNull(req.body); - } - - @Test - @DisplayName("fetchAllSegments with segmentType custom") - void fetchAllSegmentsTest1() { - SegmentType type0 = SegmentType.fromValue("custom"); - - assertDoesNotThrow(() -> { - client.fetchAllSegments(type0); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/segments"); - assertEquals(req.method, "GET"); - assertNull(req.body); - - try { - Map expectedQuery = json.readValue("{\"type\":\"custom\"}", new TypeReference>() {}); - Map actualQuery = req.queryParameters; - - assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { - assertEquals(expectedQuery.get(p.getKey()), p.getValue()); - } - } catch (JsonProcessingException e) { - fail("failed to parse queryParameters json"); - } - } - - @Test - @DisplayName("fetchAllSegments with segmentType computed") - void fetchAllSegmentsTest2() { - SegmentType type0 = SegmentType.fromValue("computed"); - - assertDoesNotThrow(() -> { - client.fetchAllSegments(type0); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/segments"); - assertEquals(req.method, "GET"); - assertNull(req.body); - - try { - Map expectedQuery = json.readValue("{\"type\":\"computed\"}", new TypeReference>() {}); - Map actualQuery = req.queryParameters; - - assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { - assertEquals(expectedQuery.get(p.getKey()), p.getValue()); - } - } catch (JsonProcessingException e) { - fail("failed to parse queryParameters json"); - } - } - - @Test - @DisplayName("fetchAllUserProfiles with minimal parameters for modelsToRetrieve") - void fetchAllUserProfilesTest0() { - ModelsToRetrieveParam fetchAllUserProfilesParams0 = new ModelsToRetrieveParam(); - { - List modelsToRetrieve1 = new ArrayList<>(); - { - ModelsToRetrieve modelsToRetrieve_02 = ModelsToRetrieve.fromValue("funnel_stage"); - modelsToRetrieve1.add(modelsToRetrieve_02); - ModelsToRetrieve modelsToRetrieve_12 = ModelsToRetrieve.fromValue("order_value"); - modelsToRetrieve1.add(modelsToRetrieve_12); - ModelsToRetrieve modelsToRetrieve_22 = ModelsToRetrieve.fromValue("affinities"); - modelsToRetrieve1.add(modelsToRetrieve_22); - } - fetchAllUserProfilesParams0.setModelsToRetrieve(modelsToRetrieve1); - } - - assertDoesNotThrow(() -> { - client.fetchAllUserProfiles(FetchAllUserProfilesParams.of(fetchAllUserProfilesParams0)); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/users"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"modelsToRetrieve\":[\"funnel_stage\",\"order_value\",\"affinities\"]}", req.body, JSONCompareMode.STRICT); - }); - } - - @Test - @DisplayName("fetchAllUserProfiles with minimal parameters for typesToRetrieve") - void fetchAllUserProfilesTest1() { - TypesToRetrieveParam fetchAllUserProfilesParams0 = new TypesToRetrieveParam(); - { - List typesToRetrieve1 = new ArrayList<>(); - { - TypesToRetrieve typesToRetrieve_02 = TypesToRetrieve.fromValue("properties"); - typesToRetrieve1.add(typesToRetrieve_02); - TypesToRetrieve typesToRetrieve_12 = TypesToRetrieve.fromValue("segments"); - typesToRetrieve1.add(typesToRetrieve_12); - } - fetchAllUserProfilesParams0.setTypesToRetrieve(typesToRetrieve1); - } - - assertDoesNotThrow(() -> { - client.fetchAllUserProfiles(FetchAllUserProfilesParams.of(fetchAllUserProfilesParams0)); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/users"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"typesToRetrieve\":[\"properties\",\"segments\"]}", req.body, JSONCompareMode.STRICT); - }); - } - - @Test - @DisplayName("fetchAllUserProfiles with a limit") - void fetchAllUserProfilesTest2() { - LimitParam fetchAllUserProfilesParams0 = new LimitParam(); - { - int limit1 = 10; - fetchAllUserProfilesParams0.setLimit(limit1); - } - - assertDoesNotThrow(() -> { - client.fetchAllUserProfiles(FetchAllUserProfilesParams.of(fetchAllUserProfilesParams0)); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/users"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"limit\":10}", req.body, JSONCompareMode.STRICT); - }); - } - - @Test - @DisplayName("fetchAllUserProfiles with a nextPageToken") - void fetchAllUserProfilesTest3() { - NextPageTokenParam fetchAllUserProfilesParams0 = new NextPageTokenParam(); - { - String nextPageToken1 = "nextPageTokenExample123"; - fetchAllUserProfilesParams0.setNextPageToken(nextPageToken1); - } - - assertDoesNotThrow(() -> { - client.fetchAllUserProfiles(FetchAllUserProfilesParams.of(fetchAllUserProfilesParams0)); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/users"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"nextPageToken\":\"nextPageTokenExample123\"}", req.body, JSONCompareMode.STRICT); - }); - } - - @Test - @DisplayName("fetchAllUserProfiles with a previousPageToken") - void fetchAllUserProfilesTest4() { - PreviousPageTokenParam fetchAllUserProfilesParams0 = new PreviousPageTokenParam(); - { - String previousPageToken1 = "previousPageTokenExample123"; - fetchAllUserProfilesParams0.setPreviousPageToken(previousPageToken1); - } - - assertDoesNotThrow(() -> { - client.fetchAllUserProfiles(FetchAllUserProfilesParams.of(fetchAllUserProfilesParams0)); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/users"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"previousPageToken\":\"previousPageTokenExample123\"}", req.body, JSONCompareMode.STRICT); - }); - } - - @Test - @DisplayName("fetchSegment with user ID") - void fetchSegmentTest0() { - String segmentID0 = "segment1"; - - assertDoesNotThrow(() -> { - client.fetchSegment(segmentID0); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/segments/segment1"); - assertEquals(req.method, "GET"); - assertNull(req.body); - } - - @Test - @DisplayName("fetchUserProfile with minimal parameters for modelsToRetrieve") - void fetchUserProfileTest0() { - String userID0 = "user1"; - ModelsToRetrieveParam params0 = new ModelsToRetrieveParam(); - { - List modelsToRetrieve1 = new ArrayList<>(); - { - ModelsToRetrieve modelsToRetrieve_02 = ModelsToRetrieve.fromValue("funnel_stage"); - modelsToRetrieve1.add(modelsToRetrieve_02); - ModelsToRetrieve modelsToRetrieve_12 = ModelsToRetrieve.fromValue("order_value"); - modelsToRetrieve1.add(modelsToRetrieve_12); - ModelsToRetrieve modelsToRetrieve_22 = ModelsToRetrieve.fromValue("affinities"); - modelsToRetrieve1.add(modelsToRetrieve_22); - } - params0.setModelsToRetrieve(modelsToRetrieve1); - } - - assertDoesNotThrow(() -> { - client.fetchUserProfile(userID0, Params.of(params0)); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/users/user1/fetch"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"modelsToRetrieve\":[\"funnel_stage\",\"order_value\",\"affinities\"]}", req.body, JSONCompareMode.STRICT); - }); - } - - @Test - @DisplayName("fetchUserProfile with minimal parameters for typesToRetrieve") - void fetchUserProfileTest1() { - String userID0 = "user1"; - TypesToRetrieveParam params0 = new TypesToRetrieveParam(); - { - List typesToRetrieve1 = new ArrayList<>(); - { - TypesToRetrieve typesToRetrieve_02 = TypesToRetrieve.fromValue("properties"); - typesToRetrieve1.add(typesToRetrieve_02); - TypesToRetrieve typesToRetrieve_12 = TypesToRetrieve.fromValue("segments"); - typesToRetrieve1.add(typesToRetrieve_12); - } - params0.setTypesToRetrieve(typesToRetrieve1); - } - - assertDoesNotThrow(() -> { - client.fetchUserProfile(userID0, Params.of(params0)); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/users/user1/fetch"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"typesToRetrieve\":[\"properties\",\"segments\"]}", req.body, JSONCompareMode.STRICT); - }); - } - - @Test - @DisplayName("fetchUserProfile with all parameters") - void fetchUserProfileTest2() { - String userID0 = "user1"; - AllParams params0 = new AllParams(); - { - List modelsToRetrieve1 = new ArrayList<>(); - { - ModelsToRetrieve modelsToRetrieve_02 = ModelsToRetrieve.fromValue("funnel_stage"); - modelsToRetrieve1.add(modelsToRetrieve_02); - ModelsToRetrieve modelsToRetrieve_12 = ModelsToRetrieve.fromValue("order_value"); - modelsToRetrieve1.add(modelsToRetrieve_12); - ModelsToRetrieve modelsToRetrieve_22 = ModelsToRetrieve.fromValue("affinities"); - modelsToRetrieve1.add(modelsToRetrieve_22); - } - params0.setModelsToRetrieve(modelsToRetrieve1); - List typesToRetrieve1 = new ArrayList<>(); - { - TypesToRetrieve typesToRetrieve_02 = TypesToRetrieve.fromValue("properties"); - typesToRetrieve1.add(typesToRetrieve_02); - TypesToRetrieve typesToRetrieve_12 = TypesToRetrieve.fromValue("segments"); - typesToRetrieve1.add(typesToRetrieve_12); - } - params0.setTypesToRetrieve(typesToRetrieve1); - } - - assertDoesNotThrow(() -> { - client.fetchUserProfile(userID0, Params.of(params0)); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/users/user1/fetch"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals( - "{\"modelsToRetrieve\":[\"funnel_stage\",\"order_value\",\"affinities\"],\"typesToRetrieve\":[\"properties\",\"segments\"]}", - req.body, - JSONCompareMode.STRICT - ); - }); - } - - @Test - @DisplayName("allow get method for a custom path with minimal parameters") - void getTest0() { - String path0 = "/test/minimal"; - - assertDoesNotThrow(() -> { - client.get(path0); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/test/minimal"); - assertEquals(req.method, "GET"); - assertNull(req.body); - } - - @Test - @DisplayName("allow get method for a custom path with all parameters") - void getTest1() { - String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); - { - String query1 = "parameters"; - parameters0.put("query", query1); - } - - assertDoesNotThrow(() -> { - client.get(path0, parameters0); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/test/all"); - assertEquals(req.method, "GET"); - assertNull(req.body); - - try { - Map expectedQuery = json.readValue("{\"query\":\"parameters\"}", new TypeReference>() {}); - Map actualQuery = req.queryParameters; - - assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { - assertEquals(expectedQuery.get(p.getKey()), p.getValue()); - } - } catch (JsonProcessingException e) { - fail("failed to parse queryParameters json"); - } - } - - @Test - @DisplayName("get available model types") - void getAvailableModelTypesTest0() { - assertDoesNotThrow(() -> { - client.getAvailableModelTypes(); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/predict/modeltypes"); - assertEquals(req.method, "GET"); - assertNull(req.body); - } - - @Test - @DisplayName("get configurations for a model instance") - void getModelInstanceConfigTest0() { - String modelID0 = "model1"; - - assertDoesNotThrow(() -> { - client.getModelInstanceConfig(modelID0); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/predict/models/model1"); - assertEquals(req.method, "GET"); - assertNull(req.body); - } - - @Test - @DisplayName("get a list of model instances") - void getModelInstancesTest0() { - assertDoesNotThrow(() -> { - client.getModelInstances(); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/predict/models"); - assertEquals(req.method, "GET"); - assertNull(req.body); - } - - @Test - @DisplayName("get metrics for a model instance") - void getModelMetricsTest0() { - String modelID0 = "model1"; - - assertDoesNotThrow(() -> { - client.getModelMetrics(modelID0); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/predict/models/model1/metrics"); - assertEquals(req.method, "GET"); - assertNull(req.body); - } - - @Test - @DisplayName("getSegmentUsers with minimal parameters for modelsToRetrieve") - void getSegmentUsersTest0() { - String segmentID0 = "segmentID1"; - ModelsToRetrieveParam fetchAllUserProfilesParams0 = new ModelsToRetrieveParam(); - { - List modelsToRetrieve1 = new ArrayList<>(); - { - ModelsToRetrieve modelsToRetrieve_02 = ModelsToRetrieve.fromValue("funnel_stage"); - modelsToRetrieve1.add(modelsToRetrieve_02); - } - fetchAllUserProfilesParams0.setModelsToRetrieve(modelsToRetrieve1); - } - - assertDoesNotThrow(() -> { - client.getSegmentUsers(segmentID0, FetchAllUserProfilesParams.of(fetchAllUserProfilesParams0)); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/segments/segmentID1/users"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"modelsToRetrieve\":[\"funnel_stage\"]}", req.body, JSONCompareMode.STRICT); - }); - } - - @Test - @DisplayName("getSegmentUsers with minimal parameters for typesToRetrieve") - void getSegmentUsersTest1() { - String segmentID0 = "segmentID1"; - TypesToRetrieveParam fetchAllUserProfilesParams0 = new TypesToRetrieveParam(); - { - List typesToRetrieve1 = new ArrayList<>(); - { - TypesToRetrieve typesToRetrieve_02 = TypesToRetrieve.fromValue("properties"); - typesToRetrieve1.add(typesToRetrieve_02); - } - fetchAllUserProfilesParams0.setTypesToRetrieve(typesToRetrieve1); - } - - assertDoesNotThrow(() -> { - client.getSegmentUsers(segmentID0, FetchAllUserProfilesParams.of(fetchAllUserProfilesParams0)); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/segments/segmentID1/users"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"typesToRetrieve\":[\"properties\"]}", req.body, JSONCompareMode.STRICT); - }); - } - - @Test - @DisplayName("getSegmentUsers with a limit") - void getSegmentUsersTest2() { - String segmentID0 = "segmentID1"; - LimitParam fetchAllUserProfilesParams0 = new LimitParam(); - { - int limit1 = 10; - fetchAllUserProfilesParams0.setLimit(limit1); - } - - assertDoesNotThrow(() -> { - client.getSegmentUsers(segmentID0, FetchAllUserProfilesParams.of(fetchAllUserProfilesParams0)); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/segments/segmentID1/users"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"limit\":10}", req.body, JSONCompareMode.STRICT); - }); - } - - @Test - @DisplayName("getSegmentUsers with a nextPageToken") - void getSegmentUsersTest3() { - String segmentID0 = "segmentID1"; - NextPageTokenParam fetchAllUserProfilesParams0 = new NextPageTokenParam(); - { - String nextPageToken1 = "nextPageTokenExample123"; - fetchAllUserProfilesParams0.setNextPageToken(nextPageToken1); - } - - assertDoesNotThrow(() -> { - client.getSegmentUsers(segmentID0, FetchAllUserProfilesParams.of(fetchAllUserProfilesParams0)); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/segments/segmentID1/users"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"nextPageToken\":\"nextPageTokenExample123\"}", req.body, JSONCompareMode.STRICT); - }); - } - - @Test - @DisplayName("getSegmentUsers with a previousPageToken") - void getSegmentUsersTest4() { - String segmentID0 = "segmentID1"; - PreviousPageTokenParam fetchAllUserProfilesParams0 = new PreviousPageTokenParam(); - { - String previousPageToken1 = "previousPageTokenExample123"; - fetchAllUserProfilesParams0.setPreviousPageToken(previousPageToken1); - } - - assertDoesNotThrow(() -> { - client.getSegmentUsers(segmentID0, FetchAllUserProfilesParams.of(fetchAllUserProfilesParams0)); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/segments/segmentID1/users"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"previousPageToken\":\"previousPageTokenExample123\"}", req.body, JSONCompareMode.STRICT); - }); - } - - @Test - @DisplayName("allow post method for a custom path with minimal parameters") - void postTest0() { - String path0 = "/test/minimal"; - - assertDoesNotThrow(() -> { - client.post(path0); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/test/minimal"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{}", req.body, JSONCompareMode.STRICT); - }); - } - - @Test - @DisplayName("allow post method for a custom path with all parameters") - void postTest1() { - String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); - { - String query1 = "parameters"; - parameters0.put("query", query1); - } - Map body0 = new HashMap<>(); - { - String body1 = "parameters"; - body0.put("body", body1); - } - - assertDoesNotThrow(() -> { - client.post(path0, parameters0, body0); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/test/all"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"body\":\"parameters\"}", req.body, JSONCompareMode.STRICT); - }); - - try { - Map expectedQuery = json.readValue("{\"query\":\"parameters\"}", new TypeReference>() {}); - Map actualQuery = req.queryParameters; - - assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { - assertEquals(expectedQuery.get(p.getKey()), p.getValue()); - } - } catch (JsonProcessingException e) { - fail("failed to parse queryParameters json"); - } - } - - @Test - @DisplayName("requestOptions can override default query parameters") - void postTest2() { - String path0 = "/test/requestOptions"; - Map parameters0 = new HashMap<>(); - { - String query1 = "parameters"; - parameters0.put("query", query1); - } - Map body0 = new HashMap<>(); - { - String facet1 = "filters"; - body0.put("facet", facet1); - } - - RequestOptions requestOptions = new RequestOptions(); - requestOptions.addExtraQueryParameters("query", "myQueryParameter"); - - assertDoesNotThrow(() -> { - client.post(path0, parameters0, body0, requestOptions); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/test/requestOptions"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"facet\":\"filters\"}", req.body, JSONCompareMode.STRICT); - }); - - try { - Map expectedQuery = json.readValue( - "{\"query\":\"myQueryParameter\"}", - new TypeReference>() {} - ); - Map actualQuery = req.queryParameters; - - assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { - assertEquals(expectedQuery.get(p.getKey()), p.getValue()); - } - } catch (JsonProcessingException e) { - fail("failed to parse queryParameters json"); - } - } - - @Test - @DisplayName("requestOptions merges query parameters with default ones") - void postTest3() { - String path0 = "/test/requestOptions"; - Map parameters0 = new HashMap<>(); - { - String query1 = "parameters"; - parameters0.put("query", query1); - } - Map body0 = new HashMap<>(); - { - String facet1 = "filters"; - body0.put("facet", facet1); - } - - RequestOptions requestOptions = new RequestOptions(); - requestOptions.addExtraQueryParameters("query2", "myQueryParameter"); - - assertDoesNotThrow(() -> { - client.post(path0, parameters0, body0, requestOptions); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/test/requestOptions"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"facet\":\"filters\"}", req.body, JSONCompareMode.STRICT); - }); - - try { - Map expectedQuery = json.readValue( - "{\"query\":\"parameters\",\"query2\":\"myQueryParameter\"}", - new TypeReference>() {} - ); - Map actualQuery = req.queryParameters; - - assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { - assertEquals(expectedQuery.get(p.getKey()), p.getValue()); - } - } catch (JsonProcessingException e) { - fail("failed to parse queryParameters json"); - } - } - - @Test - @DisplayName("requestOptions can override default headers") - void postTest4() { - String path0 = "/test/requestOptions"; - Map parameters0 = new HashMap<>(); - { - String query1 = "parameters"; - parameters0.put("query", query1); - } - Map body0 = new HashMap<>(); - { - String facet1 = "filters"; - body0.put("facet", facet1); - } - - RequestOptions requestOptions = new RequestOptions(); - requestOptions.addExtraHeader("x-algolia-api-key", "myApiKey"); - - assertDoesNotThrow(() -> { - client.post(path0, parameters0, body0, requestOptions); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/test/requestOptions"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"facet\":\"filters\"}", req.body, JSONCompareMode.STRICT); - }); - - try { - Map expectedQuery = json.readValue("{\"query\":\"parameters\"}", new TypeReference>() {}); - Map actualQuery = req.queryParameters; - - assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { - assertEquals(expectedQuery.get(p.getKey()), p.getValue()); - } - } catch (JsonProcessingException e) { - fail("failed to parse queryParameters json"); - } - - try { - Map expectedHeaders = json.readValue( - "{\"x-algolia-api-key\":\"myApiKey\"}", - new TypeReference>() {} - ); - Map actualHeaders = req.headers; - - for (Map.Entry p : expectedHeaders.entrySet()) { - assertEquals(actualHeaders.get(p.getKey()), p.getValue()); - } - } catch (JsonProcessingException e) { - fail("failed to parse headers json"); - } - } - - @Test - @DisplayName("requestOptions merges headers with default ones") - void postTest5() { - String path0 = "/test/requestOptions"; - Map parameters0 = new HashMap<>(); - { - String query1 = "parameters"; - parameters0.put("query", query1); - } - Map body0 = new HashMap<>(); - { - String facet1 = "filters"; - body0.put("facet", facet1); - } - - RequestOptions requestOptions = new RequestOptions(); - requestOptions.addExtraHeader("x-algolia-api-key", "myApiKey"); - - assertDoesNotThrow(() -> { - client.post(path0, parameters0, body0, requestOptions); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/test/requestOptions"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"facet\":\"filters\"}", req.body, JSONCompareMode.STRICT); - }); - - try { - Map expectedQuery = json.readValue("{\"query\":\"parameters\"}", new TypeReference>() {}); - Map actualQuery = req.queryParameters; - - assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { - assertEquals(expectedQuery.get(p.getKey()), p.getValue()); - } - } catch (JsonProcessingException e) { - fail("failed to parse queryParameters json"); - } - - try { - Map expectedHeaders = json.readValue( - "{\"x-algolia-api-key\":\"myApiKey\"}", - new TypeReference>() {} - ); - Map actualHeaders = req.headers; - - for (Map.Entry p : expectedHeaders.entrySet()) { - assertEquals(actualHeaders.get(p.getKey()), p.getValue()); - } - } catch (JsonProcessingException e) { - fail("failed to parse headers json"); - } - } - - @Test - @DisplayName("requestOptions queryParameters accepts booleans") - void postTest6() { - String path0 = "/test/requestOptions"; - Map parameters0 = new HashMap<>(); - { - String query1 = "parameters"; - parameters0.put("query", query1); - } - Map body0 = new HashMap<>(); - { - String facet1 = "filters"; - body0.put("facet", facet1); - } - - RequestOptions requestOptions = new RequestOptions(); - requestOptions.addExtraQueryParameters("isItWorking", true); - - assertDoesNotThrow(() -> { - client.post(path0, parameters0, body0, requestOptions); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/test/requestOptions"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"facet\":\"filters\"}", req.body, JSONCompareMode.STRICT); - }); - - try { - Map expectedQuery = json.readValue( - "{\"query\":\"parameters\",\"isItWorking\":\"true\"}", - new TypeReference>() {} - ); - Map actualQuery = req.queryParameters; - - assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { - assertEquals(expectedQuery.get(p.getKey()), p.getValue()); - } - } catch (JsonProcessingException e) { - fail("failed to parse queryParameters json"); - } - } - - @Test - @DisplayName("requestOptions queryParameters accepts integers") - void postTest7() { - String path0 = "/test/requestOptions"; - Map parameters0 = new HashMap<>(); - { - String query1 = "parameters"; - parameters0.put("query", query1); - } - Map body0 = new HashMap<>(); - { - String facet1 = "filters"; - body0.put("facet", facet1); - } - - RequestOptions requestOptions = new RequestOptions(); - requestOptions.addExtraQueryParameters("myParam", 2); - - assertDoesNotThrow(() -> { - client.post(path0, parameters0, body0, requestOptions); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/test/requestOptions"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"facet\":\"filters\"}", req.body, JSONCompareMode.STRICT); - }); - - try { - Map expectedQuery = json.readValue( - "{\"query\":\"parameters\",\"myParam\":\"2\"}", - new TypeReference>() {} - ); - Map actualQuery = req.queryParameters; - - assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { - assertEquals(expectedQuery.get(p.getKey()), p.getValue()); - } - } catch (JsonProcessingException e) { - fail("failed to parse queryParameters json"); - } - } - - @Test - @DisplayName("requestOptions queryParameters accepts list of string") - void postTest8() { - String path0 = "/test/requestOptions"; - Map parameters0 = new HashMap<>(); - { - String query1 = "parameters"; - parameters0.put("query", query1); - } - Map body0 = new HashMap<>(); - { - String facet1 = "filters"; - body0.put("facet", facet1); - } - - RequestOptions requestOptions = new RequestOptions(); - requestOptions.addExtraQueryParameters("myParam", Arrays.asList("c", "d")); - - assertDoesNotThrow(() -> { - client.post(path0, parameters0, body0, requestOptions); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/test/requestOptions"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"facet\":\"filters\"}", req.body, JSONCompareMode.STRICT); - }); - - try { - Map expectedQuery = json.readValue( - "{\"query\":\"parameters\",\"myParam\":\"c,d\"}", - new TypeReference>() {} - ); - Map actualQuery = req.queryParameters; - - assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { - assertEquals(expectedQuery.get(p.getKey()), p.getValue()); - } - } catch (JsonProcessingException e) { - fail("failed to parse queryParameters json"); - } - } - - @Test - @DisplayName("requestOptions queryParameters accepts list of booleans") - void postTest9() { - String path0 = "/test/requestOptions"; - Map parameters0 = new HashMap<>(); - { - String query1 = "parameters"; - parameters0.put("query", query1); - } - Map body0 = new HashMap<>(); - { - String facet1 = "filters"; - body0.put("facet", facet1); - } - - RequestOptions requestOptions = new RequestOptions(); - requestOptions.addExtraQueryParameters("myParam", Arrays.asList(true, true, false)); - - assertDoesNotThrow(() -> { - client.post(path0, parameters0, body0, requestOptions); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/test/requestOptions"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"facet\":\"filters\"}", req.body, JSONCompareMode.STRICT); - }); - - try { - Map expectedQuery = json.readValue( - "{\"query\":\"parameters\",\"myParam\":\"true,true,false\"}", - new TypeReference>() {} - ); - Map actualQuery = req.queryParameters; - - assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { - assertEquals(expectedQuery.get(p.getKey()), p.getValue()); - } - } catch (JsonProcessingException e) { - fail("failed to parse queryParameters json"); - } - } - - @Test - @DisplayName("requestOptions queryParameters accepts list of integers") - void postTest10() { - String path0 = "/test/requestOptions"; - Map parameters0 = new HashMap<>(); - { - String query1 = "parameters"; - parameters0.put("query", query1); - } - Map body0 = new HashMap<>(); - { - String facet1 = "filters"; - body0.put("facet", facet1); - } - - RequestOptions requestOptions = new RequestOptions(); - requestOptions.addExtraQueryParameters("myParam", Arrays.asList(1, 2)); - - assertDoesNotThrow(() -> { - client.post(path0, parameters0, body0, requestOptions); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/test/requestOptions"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"facet\":\"filters\"}", req.body, JSONCompareMode.STRICT); - }); - - try { - Map expectedQuery = json.readValue( - "{\"query\":\"parameters\",\"myParam\":\"1,2\"}", - new TypeReference>() {} - ); - Map actualQuery = req.queryParameters; - - assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { - assertEquals(expectedQuery.get(p.getKey()), p.getValue()); - } - } catch (JsonProcessingException e) { - fail("failed to parse queryParameters json"); - } - } - - @Test - @DisplayName("allow put method for a custom path with minimal parameters") - void putTest0() { - String path0 = "/test/minimal"; - - assertDoesNotThrow(() -> { - client.put(path0); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/test/minimal"); - assertEquals(req.method, "PUT"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{}", req.body, JSONCompareMode.STRICT); - }); - } - - @Test - @DisplayName("allow put method for a custom path with all parameters") - void putTest1() { - String path0 = "/test/all"; - Map parameters0 = new HashMap<>(); - { - String query1 = "parameters"; - parameters0.put("query", query1); - } - Map body0 = new HashMap<>(); - { - String body1 = "parameters"; - body0.put("body", body1); - } - - assertDoesNotThrow(() -> { - client.put(path0, parameters0, body0); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/test/all"); - assertEquals(req.method, "PUT"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"body\":\"parameters\"}", req.body, JSONCompareMode.STRICT); - }); - - try { - Map expectedQuery = json.readValue("{\"query\":\"parameters\"}", new TypeReference>() {}); - Map actualQuery = req.queryParameters; - - assertEquals(expectedQuery.size(), actualQuery.size()); - for (Map.Entry p : actualQuery.entrySet()) { - assertEquals(expectedQuery.get(p.getKey()), p.getValue()); - } - } catch (JsonProcessingException e) { - fail("failed to parse queryParameters json"); - } - } - - @Test - @DisplayName("update a model instance") - void updateModelInstanceTest0() { - String modelID0 = "model1"; - UpdateModelParams updateModelParams0 = new UpdateModelParams(); - { - String name1 = "Shopping stage for EU users"; - updateModelParams0.setName(name1); - List modelAttributes1 = new ArrayList<>(); - { - String modelAttributes_02 = "brand"; - modelAttributes1.add(modelAttributes_02); - String modelAttributes_12 = "color"; - modelAttributes1.add(modelAttributes_12); - String modelAttributes_22 = "category_level0"; - modelAttributes1.add(modelAttributes_22); - String modelAttributes_32 = "category_level1"; - modelAttributes1.add(modelAttributes_32); - } - updateModelParams0.setModelAttributes(modelAttributes1); - List contentAttributes1 = new ArrayList<>(); - { - String contentAttributes_02 = "title"; - contentAttributes1.add(contentAttributes_02); - String contentAttributes_12 = "description"; - contentAttributes1.add(contentAttributes_12); - } - updateModelParams0.setContentAttributes(contentAttributes1); - ModelStatus modelStatus1 = ModelStatus.fromValue("inactive"); - updateModelParams0.setModelStatus(modelStatus1); - } - - assertDoesNotThrow(() -> { - client.updateModelInstance(modelID0, updateModelParams0); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/predict/models/model1"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals( - "{\"name\":\"Shopping stage for EU" + - " users\",\"modelAttributes\":[\"brand\",\"color\",\"category_level0\",\"category_level1\"],\"contentAttributes\":[\"title\",\"description\"],\"modelStatus\":\"inactive\"}", - req.body, - JSONCompareMode.STRICT - ); - }); - } - - @Test - @DisplayName("updateSegment with name") - void updateSegmentTest0() { - String segmentID0 = "segment1"; - SegmentNameParam updateSegmentParams0 = new SegmentNameParam(); - { - String name1 = "example segment name"; - updateSegmentParams0.setName(name1); - } - - assertDoesNotThrow(() -> { - client.updateSegment(segmentID0, UpdateSegmentParams.of(updateSegmentParams0)); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/segments/segment1"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals("{\"name\":\"example segment name\"}", req.body, JSONCompareMode.STRICT); - }); - } - - @Test - @DisplayName("updateSegment with conditions") - void updateSegmentTest1() { - String segmentID0 = "segment1"; - SegmentConditionsParam updateSegmentParams0 = new SegmentConditionsParam(); - { - String conditions1 = "predictions.order_value.value > 100 AND predictions.funnel_stage.score < 0.9"; - updateSegmentParams0.setConditions(conditions1); - } - - assertDoesNotThrow(() -> { - client.updateSegment(segmentID0, UpdateSegmentParams.of(updateSegmentParams0)); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/segments/segment1"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals( - "{\"conditions\":\"predictions.order_value.value > 100 AND" + " predictions.funnel_stage.score < 0.9\"}", - req.body, - JSONCompareMode.STRICT - ); - }); - } - - @Test - @DisplayName("updateSegment with name and conditions") - void updateSegmentTest2() { - String segmentID0 = "segment1"; - AllUpdateSegmentParams updateSegmentParams0 = new AllUpdateSegmentParams(); - { - String name1 = "example segment name"; - updateSegmentParams0.setName(name1); - String conditions1 = "predictions.order_value.value > 100 AND predictions.funnel_stage.score < 0.9"; - updateSegmentParams0.setConditions(conditions1); - } - - assertDoesNotThrow(() -> { - client.updateSegment(segmentID0, UpdateSegmentParams.of(updateSegmentParams0)); - }); - EchoResponse req = echo.getLastResponse(); - - assertEquals(req.path, "/1/segments/segment1"); - assertEquals(req.method, "POST"); - assertDoesNotThrow(() -> { - JSONAssert.assertEquals( - "{\"name\":\"example segment name\",\"conditions\":\"predictions.order_value.value >" + - " 100 AND predictions.funnel_stage.score < 0.9\"}", - req.body, - JSONCompareMode.STRICT - ); - }); - } -} diff --git a/tests/output/javascript/package.json b/tests/output/javascript/package.json index f9e9d2217b..f7d1574cd4 100644 --- a/tests/output/javascript/package.json +++ b/tests/output/javascript/package.json @@ -14,7 +14,6 @@ "@algolia/client-search": "link:../../../clients/algoliasearch-client-javascript/packages/client-search", "@algolia/ingestion": "link:../../../clients/algoliasearch-client-javascript/packages/ingestion", "@algolia/monitoring": "link:../../../clients/algoliasearch-client-javascript/packages/monitoring", - "@algolia/predict": "link:../../../clients/algoliasearch-client-javascript/packages/predict", "@algolia/recommend": "link:../../../clients/algoliasearch-client-javascript/packages/recommend", "@algolia/requester-node-http": "link:../../../clients/algoliasearch-client-javascript/packages/requester-node-http", "algoliasearch": "link:../../../clients/algoliasearch-client-javascript/packages/algoliasearch" diff --git a/tests/output/javascript/src/client/predict.test.ts b/tests/output/javascript/src/client/predict.test.ts deleted file mode 100644 index 41f7b69522..0000000000 --- a/tests/output/javascript/src/client/predict.test.ts +++ /dev/null @@ -1,87 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars, require-await */ -// @ts-nocheck Failing tests will have type errors, but we cannot suppress them even with @ts-expect-error because it doesn't work for a block of lines. -import type { PredictClient } from '@algolia/predict'; -import { predictClient } from '@algolia/predict'; -import { echoRequester } from '@algolia/requester-node-http'; -import type { EchoResponse } from '@algolia/requester-node-http'; - -const appId = 'test-app-id'; -const apiKey = 'test-api-key'; - -function createClient(): PredictClient { - return predictClient(appId, apiKey, 'eu', { requester: echoRequester() }); -} - -describe('commonApi', () => { - test('calls api with correct user agent', async () => { - const $client = createClient(); - - const result = (await $client.post({ - path: '/test', - })) as unknown as EchoResponse; - - expect(decodeURIComponent(result.algoliaAgent)).toMatch( - /^Algolia for JavaScript \(\d+\.\d+\.\d+(-.*)?\)(; [a-zA-Z. ]+ (\(\d+((\.\d+)?\.\d+)?(-.*)?\))?)*(; Predict (\(\d+\.\d+\.\d+(-.*)?\)))(; [a-zA-Z. ]+ (\(\d+((\.\d+)?\.\d+)?(-.*)?\))?)*$/ - ); - }); - - test('calls api with default read timeouts', async () => { - const $client = createClient(); - - const result = (await $client.get({ - path: '/test', - })) as unknown as EchoResponse; - - expect(result).toEqual( - expect.objectContaining({ connectTimeout: 2000, responseTimeout: 5000 }) - ); - }); - - test('calls api with default write timeouts', async () => { - const $client = createClient(); - - const result = (await $client.post({ - path: '/test', - })) as unknown as EchoResponse; - - expect(result).toEqual( - expect.objectContaining({ connectTimeout: 2000, responseTimeout: 30000 }) - ); - }); -}); - -describe('parameters', () => { - test('throws when region is not given', async () => { - try { - const $client = predictClient('my-app-id', 'my-api-key', '', { - requester: echoRequester(), - }); - - throw new Error('test is expected to throw error'); - } catch (e) { - expect((e as Error).message).toMatch( - '`region` is required and must be one of the following: eu, us' - ); - } - }); - - test('throws when incorrect region is given', async () => { - try { - const $client = predictClient('my-app-id', 'my-api-key', 'not_a_region', { - requester: echoRequester(), - }); - - throw new Error('test is expected to throw error'); - } catch (e) { - expect((e as Error).message).toMatch( - '`region` is required and must be one of the following: eu, us' - ); - } - }); - - test('does not throw when region is given', async () => { - const $client = predictClient('my-app-id', 'my-api-key', 'eu', { - requester: echoRequester(), - }); - }); -}); diff --git a/tests/output/javascript/src/methods/requests/predict.test.ts b/tests/output/javascript/src/methods/requests/predict.test.ts deleted file mode 100644 index 3f7b05290c..0000000000 --- a/tests/output/javascript/src/methods/requests/predict.test.ts +++ /dev/null @@ -1,875 +0,0 @@ -import type { EchoResponse, RequestOptions } from '@algolia/client-common'; -import { predictClient } from '@algolia/predict'; -import { echoRequester } from '@algolia/requester-node-http'; - -const appId = process.env.ALGOLIA_APPLICATION_ID || 'test_app_id'; -const apiKey = process.env.ALGOLIA_SEARCH_KEY || 'test_api_key'; - -const client = predictClient(appId, apiKey, 'eu', { - requester: echoRequester(), -}); - -describe('activateModelInstance', () => { - test('activate a model instance', async () => { - const req = (await client.activateModelInstance({ - type: 'funnel_stage', - name: 'Shopping stage for EU users', - sourceID: '0200030-129930', - index: 'Products Production', - modelAttributes: [], - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/predict/models'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ - type: 'funnel_stage', - name: 'Shopping stage for EU users', - sourceID: '0200030-129930', - index: 'Products Production', - modelAttributes: [], - }); - expect(req.searchParams).toStrictEqual(undefined); - }); -}); - -describe('createSegment', () => { - test('create segment with required params', async () => { - const req = (await client.createSegment({ - name: 'segment1', - conditions: { - operator: 'AND', - operands: [ - { - name: 'predictions.order_value', - filters: [{ operator: 'GT', value: 200 }], - }, - ], - }, - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/segments'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ - name: 'segment1', - conditions: { - operator: 'AND', - operands: [ - { - name: 'predictions.order_value', - filters: [{ operator: 'GT', value: 200 }], - }, - ], - }, - }); - expect(req.searchParams).toStrictEqual(undefined); - }); - - test('create segment with filter probability', async () => { - const req = (await client.createSegment({ - name: 'segment1', - conditions: { - operator: 'AND', - operands: [ - { - name: 'predictions.affinities.color', - filters: [ - { - operator: 'EQ', - value: 'red', - probability: { GTE: 0.5, LTE: 1 }, - }, - ], - }, - ], - }, - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/segments'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ - name: 'segment1', - conditions: { - operator: 'AND', - operands: [ - { - name: 'predictions.affinities.color', - filters: [ - { - operator: 'EQ', - value: 'red', - probability: { GTE: 0.5, LTE: 1 }, - }, - ], - }, - ], - }, - }); - expect(req.searchParams).toStrictEqual(undefined); - }); -}); - -describe('del', () => { - test('allow del method for a custom path with minimal parameters', async () => { - const req = (await client.del({ - path: '/test/minimal', - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/test/minimal'); - expect(req.method).toEqual('DELETE'); - expect(req.data).toEqual(undefined); - expect(req.searchParams).toStrictEqual(undefined); - }); - - test('allow del method for a custom path with all parameters', async () => { - const req = (await client.del({ - path: '/test/all', - parameters: { query: 'parameters' }, - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/test/all'); - expect(req.method).toEqual('DELETE'); - expect(req.data).toEqual(undefined); - expect(req.searchParams).toStrictEqual({ query: 'parameters' }); - }); -}); - -describe('deleteModelInstance', () => { - test('delete a model instance', async () => { - const req = (await client.deleteModelInstance({ - modelID: 'model1', - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/predict/models/model1'); - expect(req.method).toEqual('DELETE'); - expect(req.data).toEqual(undefined); - expect(req.searchParams).toStrictEqual(undefined); - }); -}); - -describe('deleteSegment', () => { - test('delete a segments configuration', async () => { - const req = (await client.deleteSegment({ - segmentID: 'segment1', - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/segments/segment1'); - expect(req.method).toEqual('DELETE'); - expect(req.data).toEqual(undefined); - expect(req.searchParams).toStrictEqual(undefined); - }); -}); - -describe('deleteUserProfile', () => { - test('deleteUserProfile', async () => { - const req = (await client.deleteUserProfile({ - userID: 'user1', - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/users/user1'); - expect(req.method).toEqual('DELETE'); - expect(req.data).toEqual(undefined); - expect(req.searchParams).toStrictEqual(undefined); - }); -}); - -describe('fetchAllSegments', () => { - test('fetchAllSegments with no segmentType', async () => { - const req = (await client.fetchAllSegments()) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/segments'); - expect(req.method).toEqual('GET'); - expect(req.data).toEqual(undefined); - expect(req.searchParams).toStrictEqual(undefined); - }); - - test('fetchAllSegments with segmentType custom', async () => { - const req = (await client.fetchAllSegments({ - type: 'custom', - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/segments'); - expect(req.method).toEqual('GET'); - expect(req.data).toEqual(undefined); - expect(req.searchParams).toStrictEqual({ type: 'custom' }); - }); - - test('fetchAllSegments with segmentType computed', async () => { - const req = (await client.fetchAllSegments({ - type: 'computed', - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/segments'); - expect(req.method).toEqual('GET'); - expect(req.data).toEqual(undefined); - expect(req.searchParams).toStrictEqual({ type: 'computed' }); - }); -}); - -describe('fetchAllUserProfiles', () => { - test('fetchAllUserProfiles with minimal parameters for modelsToRetrieve', async () => { - const req = (await client.fetchAllUserProfiles({ - modelsToRetrieve: ['funnel_stage', 'order_value', 'affinities'], - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/users'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ - modelsToRetrieve: ['funnel_stage', 'order_value', 'affinities'], - }); - expect(req.searchParams).toStrictEqual(undefined); - }); - - test('fetchAllUserProfiles with minimal parameters for typesToRetrieve', async () => { - const req = (await client.fetchAllUserProfiles({ - typesToRetrieve: ['properties', 'segments'], - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/users'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ typesToRetrieve: ['properties', 'segments'] }); - expect(req.searchParams).toStrictEqual(undefined); - }); - - test('fetchAllUserProfiles with a limit', async () => { - const req = (await client.fetchAllUserProfiles({ - limit: 10, - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/users'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ limit: 10 }); - expect(req.searchParams).toStrictEqual(undefined); - }); - - test('fetchAllUserProfiles with a nextPageToken', async () => { - const req = (await client.fetchAllUserProfiles({ - nextPageToken: 'nextPageTokenExample123', - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/users'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ nextPageToken: 'nextPageTokenExample123' }); - expect(req.searchParams).toStrictEqual(undefined); - }); - - test('fetchAllUserProfiles with a previousPageToken', async () => { - const req = (await client.fetchAllUserProfiles({ - previousPageToken: 'previousPageTokenExample123', - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/users'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ - previousPageToken: 'previousPageTokenExample123', - }); - expect(req.searchParams).toStrictEqual(undefined); - }); -}); - -describe('fetchSegment', () => { - test('fetchSegment with user ID', async () => { - const req = (await client.fetchSegment({ - segmentID: 'segment1', - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/segments/segment1'); - expect(req.method).toEqual('GET'); - expect(req.data).toEqual(undefined); - expect(req.searchParams).toStrictEqual(undefined); - }); -}); - -describe('fetchUserProfile', () => { - test('fetchUserProfile with minimal parameters for modelsToRetrieve', async () => { - const req = (await client.fetchUserProfile({ - userID: 'user1', - params: { - modelsToRetrieve: ['funnel_stage', 'order_value', 'affinities'], - }, - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/users/user1/fetch'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ - modelsToRetrieve: ['funnel_stage', 'order_value', 'affinities'], - }); - expect(req.searchParams).toStrictEqual(undefined); - }); - - test('fetchUserProfile with minimal parameters for typesToRetrieve', async () => { - const req = (await client.fetchUserProfile({ - userID: 'user1', - params: { typesToRetrieve: ['properties', 'segments'] }, - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/users/user1/fetch'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ typesToRetrieve: ['properties', 'segments'] }); - expect(req.searchParams).toStrictEqual(undefined); - }); - - test('fetchUserProfile with all parameters', async () => { - const req = (await client.fetchUserProfile({ - userID: 'user1', - params: { - modelsToRetrieve: ['funnel_stage', 'order_value', 'affinities'], - typesToRetrieve: ['properties', 'segments'], - }, - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/users/user1/fetch'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ - modelsToRetrieve: ['funnel_stage', 'order_value', 'affinities'], - typesToRetrieve: ['properties', 'segments'], - }); - expect(req.searchParams).toStrictEqual(undefined); - }); -}); - -describe('get', () => { - test('allow get method for a custom path with minimal parameters', async () => { - const req = (await client.get({ - path: '/test/minimal', - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/test/minimal'); - expect(req.method).toEqual('GET'); - expect(req.data).toEqual(undefined); - expect(req.searchParams).toStrictEqual(undefined); - }); - - test('allow get method for a custom path with all parameters', async () => { - const req = (await client.get({ - path: '/test/all', - parameters: { query: 'parameters' }, - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/test/all'); - expect(req.method).toEqual('GET'); - expect(req.data).toEqual(undefined); - expect(req.searchParams).toStrictEqual({ query: 'parameters' }); - }); -}); - -describe('getAvailableModelTypes', () => { - test('get available model types', async () => { - const req = - (await client.getAvailableModelTypes()) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/predict/modeltypes'); - expect(req.method).toEqual('GET'); - expect(req.data).toEqual(undefined); - expect(req.searchParams).toStrictEqual(undefined); - }); -}); - -describe('getModelInstanceConfig', () => { - test('get configurations for a model instance', async () => { - const req = (await client.getModelInstanceConfig({ - modelID: 'model1', - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/predict/models/model1'); - expect(req.method).toEqual('GET'); - expect(req.data).toEqual(undefined); - expect(req.searchParams).toStrictEqual(undefined); - }); -}); - -describe('getModelInstances', () => { - test('get a list of model instances', async () => { - const req = (await client.getModelInstances()) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/predict/models'); - expect(req.method).toEqual('GET'); - expect(req.data).toEqual(undefined); - expect(req.searchParams).toStrictEqual(undefined); - }); -}); - -describe('getModelMetrics', () => { - test('get metrics for a model instance', async () => { - const req = (await client.getModelMetrics({ - modelID: 'model1', - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/predict/models/model1/metrics'); - expect(req.method).toEqual('GET'); - expect(req.data).toEqual(undefined); - expect(req.searchParams).toStrictEqual(undefined); - }); -}); - -describe('getSegmentUsers', () => { - test('getSegmentUsers with minimal parameters for modelsToRetrieve', async () => { - const req = (await client.getSegmentUsers({ - segmentID: 'segmentID1', - fetchAllUserProfilesParams: { modelsToRetrieve: ['funnel_stage'] }, - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/segments/segmentID1/users'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ modelsToRetrieve: ['funnel_stage'] }); - expect(req.searchParams).toStrictEqual(undefined); - }); - - test('getSegmentUsers with minimal parameters for typesToRetrieve', async () => { - const req = (await client.getSegmentUsers({ - segmentID: 'segmentID1', - fetchAllUserProfilesParams: { typesToRetrieve: ['properties'] }, - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/segments/segmentID1/users'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ typesToRetrieve: ['properties'] }); - expect(req.searchParams).toStrictEqual(undefined); - }); - - test('getSegmentUsers with a limit', async () => { - const req = (await client.getSegmentUsers({ - segmentID: 'segmentID1', - fetchAllUserProfilesParams: { limit: 10 }, - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/segments/segmentID1/users'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ limit: 10 }); - expect(req.searchParams).toStrictEqual(undefined); - }); - - test('getSegmentUsers with a nextPageToken', async () => { - const req = (await client.getSegmentUsers({ - segmentID: 'segmentID1', - fetchAllUserProfilesParams: { nextPageToken: 'nextPageTokenExample123' }, - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/segments/segmentID1/users'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ nextPageToken: 'nextPageTokenExample123' }); - expect(req.searchParams).toStrictEqual(undefined); - }); - - test('getSegmentUsers with a previousPageToken', async () => { - const req = (await client.getSegmentUsers({ - segmentID: 'segmentID1', - fetchAllUserProfilesParams: { - previousPageToken: 'previousPageTokenExample123', - }, - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/segments/segmentID1/users'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ - previousPageToken: 'previousPageTokenExample123', - }); - expect(req.searchParams).toStrictEqual(undefined); - }); -}); - -describe('post', () => { - test('allow post method for a custom path with minimal parameters', async () => { - const req = (await client.post({ - path: '/test/minimal', - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/test/minimal'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({}); - expect(req.searchParams).toStrictEqual(undefined); - }); - - test('allow post method for a custom path with all parameters', async () => { - const req = (await client.post({ - path: '/test/all', - parameters: { query: 'parameters' }, - body: { body: 'parameters' }, - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/test/all'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ body: 'parameters' }); - expect(req.searchParams).toStrictEqual({ query: 'parameters' }); - }); - - test('requestOptions can override default query parameters', async () => { - const requestOptions: RequestOptions = { - queryParameters: { query: 'myQueryParameter' }, - }; - - const req = (await client.post( - { - path: '/test/requestOptions', - parameters: { query: 'parameters' }, - body: { facet: 'filters' }, - }, - requestOptions - )) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/test/requestOptions'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ facet: 'filters' }); - expect(req.searchParams).toStrictEqual({ query: 'myQueryParameter' }); - }); - - test('requestOptions merges query parameters with default ones', async () => { - const requestOptions: RequestOptions = { - queryParameters: { query2: 'myQueryParameter' }, - }; - - const req = (await client.post( - { - path: '/test/requestOptions', - parameters: { query: 'parameters' }, - body: { facet: 'filters' }, - }, - requestOptions - )) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/test/requestOptions'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ facet: 'filters' }); - expect(req.searchParams).toStrictEqual({ - query: 'parameters', - query2: 'myQueryParameter', - }); - }); - - test('requestOptions can override default headers', async () => { - const requestOptions: RequestOptions = { - headers: { 'x-algolia-api-key': 'myApiKey' }, - }; - - const req = (await client.post( - { - path: '/test/requestOptions', - parameters: { query: 'parameters' }, - body: { facet: 'filters' }, - }, - requestOptions - )) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/test/requestOptions'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ facet: 'filters' }); - expect(req.searchParams).toStrictEqual({ query: 'parameters' }); - expect(req.headers).toEqual( - expect.objectContaining({ 'x-algolia-api-key': 'myApiKey' }) - ); - }); - - test('requestOptions merges headers with default ones', async () => { - const requestOptions: RequestOptions = { - headers: { 'x-algolia-api-key': 'myApiKey' }, - }; - - const req = (await client.post( - { - path: '/test/requestOptions', - parameters: { query: 'parameters' }, - body: { facet: 'filters' }, - }, - requestOptions - )) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/test/requestOptions'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ facet: 'filters' }); - expect(req.searchParams).toStrictEqual({ query: 'parameters' }); - expect(req.headers).toEqual( - expect.objectContaining({ 'x-algolia-api-key': 'myApiKey' }) - ); - }); - - test('requestOptions queryParameters accepts booleans', async () => { - const requestOptions: RequestOptions = { - queryParameters: { isItWorking: true }, - }; - - const req = (await client.post( - { - path: '/test/requestOptions', - parameters: { query: 'parameters' }, - body: { facet: 'filters' }, - }, - requestOptions - )) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/test/requestOptions'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ facet: 'filters' }); - expect(req.searchParams).toStrictEqual({ - query: 'parameters', - isItWorking: 'true', - }); - }); - - test('requestOptions queryParameters accepts integers', async () => { - const requestOptions: RequestOptions = { - queryParameters: { myParam: 2 }, - }; - - const req = (await client.post( - { - path: '/test/requestOptions', - parameters: { query: 'parameters' }, - body: { facet: 'filters' }, - }, - requestOptions - )) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/test/requestOptions'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ facet: 'filters' }); - expect(req.searchParams).toStrictEqual({ - query: 'parameters', - myParam: '2', - }); - }); - - test('requestOptions queryParameters accepts list of string', async () => { - const requestOptions: RequestOptions = { - queryParameters: { myParam: ['c', 'd'] }, - }; - - const req = (await client.post( - { - path: '/test/requestOptions', - parameters: { query: 'parameters' }, - body: { facet: 'filters' }, - }, - requestOptions - )) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/test/requestOptions'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ facet: 'filters' }); - expect(req.searchParams).toStrictEqual({ - query: 'parameters', - myParam: 'c,d', - }); - }); - - test('requestOptions queryParameters accepts list of booleans', async () => { - const requestOptions: RequestOptions = { - queryParameters: { myParam: [true, true, false] }, - }; - - const req = (await client.post( - { - path: '/test/requestOptions', - parameters: { query: 'parameters' }, - body: { facet: 'filters' }, - }, - requestOptions - )) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/test/requestOptions'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ facet: 'filters' }); - expect(req.searchParams).toStrictEqual({ - query: 'parameters', - myParam: 'true,true,false', - }); - }); - - test('requestOptions queryParameters accepts list of integers', async () => { - const requestOptions: RequestOptions = { - queryParameters: { myParam: [1, 2] }, - }; - - const req = (await client.post( - { - path: '/test/requestOptions', - parameters: { query: 'parameters' }, - body: { facet: 'filters' }, - }, - requestOptions - )) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/test/requestOptions'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ facet: 'filters' }); - expect(req.searchParams).toStrictEqual({ - query: 'parameters', - myParam: '1,2', - }); - }); -}); - -describe('put', () => { - test('allow put method for a custom path with minimal parameters', async () => { - const req = (await client.put({ - path: '/test/minimal', - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/test/minimal'); - expect(req.method).toEqual('PUT'); - expect(req.data).toEqual({}); - expect(req.searchParams).toStrictEqual(undefined); - }); - - test('allow put method for a custom path with all parameters', async () => { - const req = (await client.put({ - path: '/test/all', - parameters: { query: 'parameters' }, - body: { body: 'parameters' }, - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/test/all'); - expect(req.method).toEqual('PUT'); - expect(req.data).toEqual({ body: 'parameters' }); - expect(req.searchParams).toStrictEqual({ query: 'parameters' }); - }); -}); - -describe('updateModelInstance', () => { - test('update a model instance', async () => { - const req = (await client.updateModelInstance({ - modelID: 'model1', - updateModelParams: { - name: 'Shopping stage for EU users', - modelAttributes: [ - 'brand', - 'color', - 'category_level0', - 'category_level1', - ], - modelStatus: 'inactive', - }, - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/predict/models/model1'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ - name: 'Shopping stage for EU users', - modelAttributes: ['brand', 'color', 'category_level0', 'category_level1'], - modelStatus: 'inactive', - }); - expect(req.searchParams).toStrictEqual(undefined); - }); -}); - -describe('updateSegment', () => { - test('updateSegment with name', async () => { - const req = (await client.updateSegment({ - segmentID: 'segment1', - updateSegmentParams: { name: 'example segment name' }, - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/segments/segment1'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ name: 'example segment name' }); - expect(req.searchParams).toStrictEqual(undefined); - }); - - test('updateSegment with conditions', async () => { - const req = (await client.updateSegment({ - segmentID: 'segment1', - updateSegmentParams: { - conditions: { - operator: 'AND', - operands: [ - { - name: 'predictions.order_value', - filters: [{ operator: 'GT', value: 200 }], - }, - ], - }, - }, - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/segments/segment1'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ - conditions: { - operator: 'AND', - operands: [ - { - name: 'predictions.order_value', - filters: [{ operator: 'GT', value: 200 }], - }, - ], - }, - }); - expect(req.searchParams).toStrictEqual(undefined); - }); - - test('updateSegment with name and conditions', async () => { - const req = (await client.updateSegment({ - segmentID: 'segment1', - updateSegmentParams: { - name: 'example segment name', - conditions: { - operator: 'AND', - operands: [ - { - name: 'predictions.order_value', - filters: [{ operator: 'GT', value: 200 }], - }, - ], - }, - }, - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/segments/segment1'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ - name: 'example segment name', - conditions: { - operator: 'AND', - operands: [ - { - name: 'predictions.order_value', - filters: [{ operator: 'GT', value: 200 }], - }, - ], - }, - }); - expect(req.searchParams).toStrictEqual(undefined); - }); - - test('updateSegment with filter probability', async () => { - const req = (await client.updateSegment({ - segmentID: 'segment1', - updateSegmentParams: { - conditions: { - operator: 'AND', - operands: [ - { - name: 'predictions.affinities.color', - filters: [ - { - operator: 'EQ', - value: 'red', - probability: { GTE: 0.5, LTE: 1 }, - }, - ], - }, - ], - }, - }, - })) as unknown as EchoResponse; - - expect(req.path).toEqual('/1/segments/segment1'); - expect(req.method).toEqual('POST'); - expect(req.data).toEqual({ - conditions: { - operator: 'AND', - operands: [ - { - name: 'predictions.affinities.color', - filters: [ - { - operator: 'EQ', - value: 'red', - probability: { GTE: 0.5, LTE: 1 }, - }, - ], - }, - ], - }, - }); - expect(req.searchParams).toStrictEqual(undefined); - }); -}); diff --git a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/PredictTest.kt b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/PredictTest.kt deleted file mode 100644 index dab5c74ef8..0000000000 --- a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/client/PredictTest.kt +++ /dev/null @@ -1,83 +0,0 @@ -package com.algolia.client - -import com.algolia.client.api.PredictClient -import com.algolia.client.configuration.* -import com.algolia.client.model.predict.* -import com.algolia.client.transport.* -import com.algolia.extension.* -import com.algolia.utils.* -import io.ktor.http.* -import kotlinx.coroutines.test.* -import kotlinx.serialization.json.* -import kotlin.test.* - -class PredictTest { - - @Test - fun `calls api with correct user agent`() = runTest { - val client = PredictClient(appId = "appId", apiKey = "apiKey", region = "eu") - client.runTest( - call = { - post( - path = "/test", - ) - }, - intercept = { - val regexp = "^Algolia for Kotlin \\(\\d+\\.\\d+\\.\\d+(-.*)?\\)(; [a-zA-Z. ]+ (\\(\\d+((\\.\\d+)?\\.\\d+)?(-.*)?\\))?)*(; Predict (\\(\\d+\\.\\d+\\.\\d+(-.*)?\\)))(; [a-zA-Z. ]+ (\\(\\d+((\\.\\d+)?\\.\\d+)?(-.*)?\\))?)*$".toRegex() - val header = it.url.parameters["X-Algolia-Agent"]?.decodeURLPart().orEmpty() - assertTrue(actual = header.matches(regexp), message = "Expected $header to match the following regex: $regexp") - }, - ) - } - - @Test - fun `calls api with default read timeouts`() = runTest { - val client = PredictClient(appId = "appId", apiKey = "apiKey", region = "eu") - client.runTest( - call = { - get( - path = "/test", - ) - }, - intercept = { - assertEquals(2000, it.connectTimeout) - assertEquals(5000, it.socketTimeout) - }, - ) - } - - @Test - fun `calls api with default write timeouts`() = runTest { - val client = PredictClient(appId = "appId", apiKey = "apiKey", region = "eu") - client.runTest( - call = { - post( - path = "/test", - ) - }, - intercept = { - assertEquals(2000, it.connectTimeout) - assertEquals(30000, it.socketTimeout) - }, - ) - } - - @Test - fun `throws when region is not given`() = runTest { - assertFails { - val client = PredictClient(appId = "my-app-id", apiKey = "my-api-key", "") - }.let { error -> assertError(error, "`region` is required and must be one of the following: eu, us") } - } - - @Test - fun `throws when incorrect region is given`() = runTest { - assertFails { - val client = PredictClient(appId = "my-app-id", apiKey = "my-api-key", "not_a_region") - }.let { error -> assertError(error, "`region` is required and must be one of the following: eu, us") } - } - - @Test - fun `does not throw when region is given`() = runTest { - val client = PredictClient(appId = "my-app-id", apiKey = "my-api-key", "eu") - } -} diff --git a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/extension/SegmentFilterProbability.kt b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/extension/SegmentFilterProbability.kt deleted file mode 100644 index 6de3beffaf..0000000000 --- a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/extension/SegmentFilterProbability.kt +++ /dev/null @@ -1,16 +0,0 @@ -package com.algolia.extension - -import com.algolia.client.model.predict.SegmentFilterProbability -import com.algolia.utils.toNumberType - -internal fun SegmentFilterProbability( - lt: Number? = null, - lte: Number? = null, - gt: Number? = null, - gte: Number? = null, -): SegmentFilterProbability = SegmentFilterProbability( - lt = lt?.toNumberType(), - lte = lte?.toNumberType(), - gt = gt?.toNumberType(), - gte = gte?.toNumberType(), -) diff --git a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/methods/requests/PredictTest.kt b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/methods/requests/PredictTest.kt deleted file mode 100644 index c0a18899ad..0000000000 --- a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/methods/requests/PredictTest.kt +++ /dev/null @@ -1,1118 +0,0 @@ -package com.algolia.methods.requests - -import com.algolia.client.api.PredictClient -import com.algolia.client.configuration.* -import com.algolia.client.model.predict.* -import com.algolia.client.transport.* -import com.algolia.extension.* -import com.algolia.utils.* -import io.ktor.http.* -import kotlinx.coroutines.test.* -import kotlinx.serialization.json.* -import kotlin.test.* - -class PredictTest { - - val client = PredictClient( - appId = "appId", - apiKey = "apiKey", - region = "eu", - ) - - // activateModelInstance - - @Test - fun `activate a model instance`() = runTest { - client.runTest( - call = { - activateModelInstance( - activateModelParams = ActivateModelParams( - type = ModelsToRetrieve.values().first { it.value == "funnel_stage" }, - name = "Shopping stage for EU users", - sourceID = "0200030-129930", - index = "Products Production", - modelAttributes = listOf(), - ), - ) - }, - intercept = { - assertEquals("/1/predict/models".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"type":"funnel_stage","name":"Shopping stage for EU users","sourceID":"0200030-129930","index":"Products Production","modelAttributes":[]}""", it.body) - }, - ) - } - - // createSegment - - @Test - fun `create segment with required params`() = runTest { - client.runTest( - call = { - createSegment( - createSegmentParams = CreateSegmentParams( - name = "segment1", - conditions = SegmentParentConditions( - operator = SegmentConditionOperator.values().first { it.value == "AND" }, - operands = listOf( - SegmentOperandAffinity( - name = "predictions.order_value", - filters = listOf( - SegmentAffinityFilter( - operator = SegmentFilterOperatorNumerical.values().first { it.value == "GT" }, - value = SegmentAffinityFilterValue.Number(200.toNumberType()), - ), - ), - ), - ), - ), - ), - ) - }, - intercept = { - assertEquals("/1/segments".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"name":"segment1","conditions":{"operator":"AND","operands":[{"name":"predictions.order_value","filters":[{"operator":"GT","value":200}]}]}}""", it.body) - }, - ) - } - - @Test - fun `create segment with filter probability`() = runTest { - client.runTest( - call = { - createSegment( - createSegmentParams = CreateSegmentParams( - name = "segment1", - conditions = SegmentParentConditions( - operator = SegmentConditionOperator.values().first { it.value == "AND" }, - operands = listOf( - SegmentOperandAffinity( - name = "predictions.affinities.color", - filters = listOf( - SegmentAffinityFilter( - operator = SegmentFilterOperatorNumerical.values().first { it.value == "EQ" }, - value = SegmentAffinityFilterValue.String("red"), - probability = SegmentFilterProbability( - gte = 0.5, - lte = 1, - ), - ), - ), - ), - ), - ), - ), - ) - }, - intercept = { - assertEquals("/1/segments".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"name":"segment1","conditions":{"operator":"AND","operands":[{"name":"predictions.affinities.color","filters":[{"operator":"EQ","value":"red","probability":{"GTE":0.5,"LTE":1}}]}]}}""", it.body) - }, - ) - } - - // del - - @Test - fun `allow del method for a custom path with minimal parameters`() = runTest { - client.runTest( - call = { - del( - path = "/test/minimal", - ) - }, - intercept = { - assertEquals("/1/test/minimal".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("DELETE"), it.method) - assertNoBody(it.body) - }, - ) - } - - @Test - fun `allow del method for a custom path with all parameters`() = runTest { - client.runTest( - call = { - del( - path = "/test/all", - parameters = mapOf("query" to "parameters"), - ) - }, - intercept = { - assertEquals("/1/test/all".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("DELETE"), it.method) - assertContainsAll("""{"query":"parameters"}""", it.url.parameters) - assertNoBody(it.body) - }, - ) - } - - // deleteModelInstance - - @Test - fun `delete a model instance`() = runTest { - client.runTest( - call = { - deleteModelInstance( - modelID = "model1", - ) - }, - intercept = { - assertEquals("/1/predict/models/model1".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("DELETE"), it.method) - assertNoBody(it.body) - }, - ) - } - - // deleteSegment - - @Test - fun `delete a segments configuration`() = runTest { - client.runTest( - call = { - deleteSegment( - segmentID = "segment1", - ) - }, - intercept = { - assertEquals("/1/segments/segment1".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("DELETE"), it.method) - assertNoBody(it.body) - }, - ) - } - - // deleteUserProfile - - @Test - fun `deleteUserProfile`() = runTest { - client.runTest( - call = { - deleteUserProfile( - userID = "user1", - ) - }, - intercept = { - assertEquals("/1/users/user1".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("DELETE"), it.method) - assertNoBody(it.body) - }, - ) - } - - // fetchAllSegments - - @Test - fun `fetchAllSegments with no segmentType`() = runTest { - client.runTest( - call = { - fetchAllSegments() - }, - intercept = { - assertEquals("/1/segments".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("GET"), it.method) - assertNoBody(it.body) - }, - ) - } - - @Test - fun `fetchAllSegments with segmentType custom`() = runTest { - client.runTest( - call = { - fetchAllSegments( - type = SegmentType.values().first { it.value == "custom" }, - ) - }, - intercept = { - assertEquals("/1/segments".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("GET"), it.method) - assertContainsAll("""{"type":"custom"}""", it.url.parameters) - assertNoBody(it.body) - }, - ) - } - - @Test - fun `fetchAllSegments with segmentType computed`() = runTest { - client.runTest( - call = { - fetchAllSegments( - type = SegmentType.values().first { it.value == "computed" }, - ) - }, - intercept = { - assertEquals("/1/segments".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("GET"), it.method) - assertContainsAll("""{"type":"computed"}""", it.url.parameters) - assertNoBody(it.body) - }, - ) - } - - // fetchAllUserProfiles - - @Test - fun `fetchAllUserProfiles with minimal parameters for modelsToRetrieve`() = runTest { - client.runTest( - call = { - fetchAllUserProfiles( - fetchAllUserProfilesParams = ModelsToRetrieveParam( - modelsToRetrieve = listOf(ModelsToRetrieve.values().first { it.value == "funnel_stage" }, ModelsToRetrieve.values().first { it.value == "order_value" }, ModelsToRetrieve.values().first { it.value == "affinities" }), - ), - ) - }, - intercept = { - assertEquals("/1/users".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"modelsToRetrieve":["funnel_stage","order_value","affinities"]}""", it.body) - }, - ) - } - - @Test - fun `fetchAllUserProfiles with minimal parameters for typesToRetrieve`() = runTest { - client.runTest( - call = { - fetchAllUserProfiles( - fetchAllUserProfilesParams = TypesToRetrieveParam( - typesToRetrieve = listOf(TypesToRetrieve.values().first { it.value == "properties" }, TypesToRetrieve.values().first { it.value == "segments" }), - ), - ) - }, - intercept = { - assertEquals("/1/users".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"typesToRetrieve":["properties","segments"]}""", it.body) - }, - ) - } - - @Test - fun `fetchAllUserProfiles with a limit`() = runTest { - client.runTest( - call = { - fetchAllUserProfiles( - fetchAllUserProfilesParams = LimitParam( - limit = 10, - ), - ) - }, - intercept = { - assertEquals("/1/users".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"limit":10}""", it.body) - }, - ) - } - - @Test - fun `fetchAllUserProfiles with a nextPageToken`() = runTest { - client.runTest( - call = { - fetchAllUserProfiles( - fetchAllUserProfilesParams = NextPageTokenParam( - nextPageToken = "nextPageTokenExample123", - ), - ) - }, - intercept = { - assertEquals("/1/users".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"nextPageToken":"nextPageTokenExample123"}""", it.body) - }, - ) - } - - @Test - fun `fetchAllUserProfiles with a previousPageToken`() = runTest { - client.runTest( - call = { - fetchAllUserProfiles( - fetchAllUserProfilesParams = PreviousPageTokenParam( - previousPageToken = "previousPageTokenExample123", - ), - ) - }, - intercept = { - assertEquals("/1/users".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"previousPageToken":"previousPageTokenExample123"}""", it.body) - }, - ) - } - - // fetchSegment - - @Test - fun `fetchSegment with user ID`() = runTest { - client.runTest( - call = { - fetchSegment( - segmentID = "segment1", - ) - }, - intercept = { - assertEquals("/1/segments/segment1".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("GET"), it.method) - assertNoBody(it.body) - }, - ) - } - - // fetchUserProfile - - @Test - fun `fetchUserProfile with minimal parameters for modelsToRetrieve`() = runTest { - client.runTest( - call = { - fetchUserProfile( - userID = "user1", - params = ModelsToRetrieveParam( - modelsToRetrieve = listOf(ModelsToRetrieve.values().first { it.value == "funnel_stage" }, ModelsToRetrieve.values().first { it.value == "order_value" }, ModelsToRetrieve.values().first { it.value == "affinities" }), - ), - ) - }, - intercept = { - assertEquals("/1/users/user1/fetch".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"modelsToRetrieve":["funnel_stage","order_value","affinities"]}""", it.body) - }, - ) - } - - @Test - fun `fetchUserProfile with minimal parameters for typesToRetrieve`() = runTest { - client.runTest( - call = { - fetchUserProfile( - userID = "user1", - params = TypesToRetrieveParam( - typesToRetrieve = listOf(TypesToRetrieve.values().first { it.value == "properties" }, TypesToRetrieve.values().first { it.value == "segments" }), - ), - ) - }, - intercept = { - assertEquals("/1/users/user1/fetch".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"typesToRetrieve":["properties","segments"]}""", it.body) - }, - ) - } - - @Test - fun `fetchUserProfile with all parameters`() = runTest { - client.runTest( - call = { - fetchUserProfile( - userID = "user1", - params = AllParams( - modelsToRetrieve = listOf(ModelsToRetrieve.values().first { it.value == "funnel_stage" }, ModelsToRetrieve.values().first { it.value == "order_value" }, ModelsToRetrieve.values().first { it.value == "affinities" }), - typesToRetrieve = listOf(TypesToRetrieve.values().first { it.value == "properties" }, TypesToRetrieve.values().first { it.value == "segments" }), - ), - ) - }, - intercept = { - assertEquals("/1/users/user1/fetch".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"modelsToRetrieve":["funnel_stage","order_value","affinities"],"typesToRetrieve":["properties","segments"]}""", it.body) - }, - ) - } - - // get - - @Test - fun `allow get method for a custom path with minimal parameters`() = runTest { - client.runTest( - call = { - get( - path = "/test/minimal", - ) - }, - intercept = { - assertEquals("/1/test/minimal".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("GET"), it.method) - assertNoBody(it.body) - }, - ) - } - - @Test - fun `allow get method for a custom path with all parameters`() = runTest { - client.runTest( - call = { - get( - path = "/test/all", - parameters = mapOf("query" to "parameters"), - ) - }, - intercept = { - assertEquals("/1/test/all".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("GET"), it.method) - assertContainsAll("""{"query":"parameters"}""", it.url.parameters) - assertNoBody(it.body) - }, - ) - } - - // getAvailableModelTypes - - @Test - fun `get available model types`() = runTest { - client.runTest( - call = { - getAvailableModelTypes() - }, - intercept = { - assertEquals("/1/predict/modeltypes".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("GET"), it.method) - assertNoBody(it.body) - }, - ) - } - - // getModelInstanceConfig - - @Test - fun `get configurations for a model instance`() = runTest { - client.runTest( - call = { - getModelInstanceConfig( - modelID = "model1", - ) - }, - intercept = { - assertEquals("/1/predict/models/model1".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("GET"), it.method) - assertNoBody(it.body) - }, - ) - } - - // getModelInstances - - @Test - fun `get a list of model instances`() = runTest { - client.runTest( - call = { - getModelInstances() - }, - intercept = { - assertEquals("/1/predict/models".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("GET"), it.method) - assertNoBody(it.body) - }, - ) - } - - // getModelMetrics - - @Test - fun `get metrics for a model instance`() = runTest { - client.runTest( - call = { - getModelMetrics( - modelID = "model1", - ) - }, - intercept = { - assertEquals("/1/predict/models/model1/metrics".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("GET"), it.method) - assertNoBody(it.body) - }, - ) - } - - // getSegmentUsers - - @Test - fun `getSegmentUsers with minimal parameters for modelsToRetrieve`() = runTest { - client.runTest( - call = { - getSegmentUsers( - segmentID = "segmentID1", - fetchAllUserProfilesParams = ModelsToRetrieveParam( - modelsToRetrieve = listOf(ModelsToRetrieve.values().first { it.value == "funnel_stage" }), - ), - ) - }, - intercept = { - assertEquals("/1/segments/segmentID1/users".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"modelsToRetrieve":["funnel_stage"]}""", it.body) - }, - ) - } - - @Test - fun `getSegmentUsers with minimal parameters for typesToRetrieve`() = runTest { - client.runTest( - call = { - getSegmentUsers( - segmentID = "segmentID1", - fetchAllUserProfilesParams = TypesToRetrieveParam( - typesToRetrieve = listOf(TypesToRetrieve.values().first { it.value == "properties" }), - ), - ) - }, - intercept = { - assertEquals("/1/segments/segmentID1/users".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"typesToRetrieve":["properties"]}""", it.body) - }, - ) - } - - @Test - fun `getSegmentUsers with a limit`() = runTest { - client.runTest( - call = { - getSegmentUsers( - segmentID = "segmentID1", - fetchAllUserProfilesParams = LimitParam( - limit = 10, - ), - ) - }, - intercept = { - assertEquals("/1/segments/segmentID1/users".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"limit":10}""", it.body) - }, - ) - } - - @Test - fun `getSegmentUsers with a nextPageToken`() = runTest { - client.runTest( - call = { - getSegmentUsers( - segmentID = "segmentID1", - fetchAllUserProfilesParams = NextPageTokenParam( - nextPageToken = "nextPageTokenExample123", - ), - ) - }, - intercept = { - assertEquals("/1/segments/segmentID1/users".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"nextPageToken":"nextPageTokenExample123"}""", it.body) - }, - ) - } - - @Test - fun `getSegmentUsers with a previousPageToken`() = runTest { - client.runTest( - call = { - getSegmentUsers( - segmentID = "segmentID1", - fetchAllUserProfilesParams = PreviousPageTokenParam( - previousPageToken = "previousPageTokenExample123", - ), - ) - }, - intercept = { - assertEquals("/1/segments/segmentID1/users".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"previousPageToken":"previousPageTokenExample123"}""", it.body) - }, - ) - } - - // post - - @Test - fun `allow post method for a custom path with minimal parameters`() = runTest { - client.runTest( - call = { - post( - path = "/test/minimal", - ) - }, - intercept = { - assertEquals("/1/test/minimal".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{}""", it.body) - }, - ) - } - - @Test - fun `allow post method for a custom path with all parameters`() = runTest { - client.runTest( - call = { - post( - path = "/test/all", - parameters = mapOf("query" to "parameters"), - body = buildJsonObject { - put( - "body", - JsonPrimitive("parameters"), - ) - }, - ) - }, - intercept = { - assertEquals("/1/test/all".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertContainsAll("""{"query":"parameters"}""", it.url.parameters) - assertJsonBody("""{"body":"parameters"}""", it.body) - }, - ) - } - - @Test - fun `requestOptions can override default query parameters`() = runTest { - client.runTest( - call = { - post( - path = "/test/requestOptions", - parameters = mapOf("query" to "parameters"), - body = buildJsonObject { - put( - "facet", - JsonPrimitive("filters"), - ) - }, - requestOptions = RequestOptions( - urlParameters = buildMap { - put("query", "myQueryParameter") - }, - ), - ) - }, - intercept = { - assertEquals("/1/test/requestOptions".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertContainsAll("""{"query":"myQueryParameter"}""", it.url.parameters) - assertJsonBody("""{"facet":"filters"}""", it.body) - }, - ) - } - - @Test - fun `requestOptions merges query parameters with default ones`() = runTest { - client.runTest( - call = { - post( - path = "/test/requestOptions", - parameters = mapOf("query" to "parameters"), - body = buildJsonObject { - put( - "facet", - JsonPrimitive("filters"), - ) - }, - requestOptions = RequestOptions( - urlParameters = buildMap { - put("query2", "myQueryParameter") - }, - ), - ) - }, - intercept = { - assertEquals("/1/test/requestOptions".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertContainsAll("""{"query":"parameters","query2":"myQueryParameter"}""", it.url.parameters) - assertJsonBody("""{"facet":"filters"}""", it.body) - }, - ) - } - - @Test - fun `requestOptions can override default headers`() = runTest { - client.runTest( - call = { - post( - path = "/test/requestOptions", - parameters = mapOf("query" to "parameters"), - body = buildJsonObject { - put( - "facet", - JsonPrimitive("filters"), - ) - }, - requestOptions = RequestOptions( - headers = buildMap { - put("x-algolia-api-key", "myApiKey") - }, - ), - ) - }, - intercept = { - assertEquals("/1/test/requestOptions".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertContainsAll("""{"x-algolia-api-key":"myApiKey"}""", it.headers) - assertContainsAll("""{"query":"parameters"}""", it.url.parameters) - assertJsonBody("""{"facet":"filters"}""", it.body) - }, - ) - } - - @Test - fun `requestOptions merges headers with default ones`() = runTest { - client.runTest( - call = { - post( - path = "/test/requestOptions", - parameters = mapOf("query" to "parameters"), - body = buildJsonObject { - put( - "facet", - JsonPrimitive("filters"), - ) - }, - requestOptions = RequestOptions( - headers = buildMap { - put("x-algolia-api-key", "myApiKey") - }, - ), - ) - }, - intercept = { - assertEquals("/1/test/requestOptions".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertContainsAll("""{"x-algolia-api-key":"myApiKey"}""", it.headers) - assertContainsAll("""{"query":"parameters"}""", it.url.parameters) - assertJsonBody("""{"facet":"filters"}""", it.body) - }, - ) - } - - @Test - fun `requestOptions queryParameters accepts booleans`() = runTest { - client.runTest( - call = { - post( - path = "/test/requestOptions", - parameters = mapOf("query" to "parameters"), - body = buildJsonObject { - put( - "facet", - JsonPrimitive("filters"), - ) - }, - requestOptions = RequestOptions( - urlParameters = buildMap { - put("isItWorking", true) - }, - ), - ) - }, - intercept = { - assertEquals("/1/test/requestOptions".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertContainsAll("""{"query":"parameters","isItWorking":"true"}""", it.url.parameters) - assertJsonBody("""{"facet":"filters"}""", it.body) - }, - ) - } - - @Test - fun `requestOptions queryParameters accepts integers`() = runTest { - client.runTest( - call = { - post( - path = "/test/requestOptions", - parameters = mapOf("query" to "parameters"), - body = buildJsonObject { - put( - "facet", - JsonPrimitive("filters"), - ) - }, - requestOptions = RequestOptions( - urlParameters = buildMap { - put("myParam", 2) - }, - ), - ) - }, - intercept = { - assertEquals("/1/test/requestOptions".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertContainsAll("""{"query":"parameters","myParam":"2"}""", it.url.parameters) - assertJsonBody("""{"facet":"filters"}""", it.body) - }, - ) - } - - @Test - fun `requestOptions queryParameters accepts list of string`() = runTest { - client.runTest( - call = { - post( - path = "/test/requestOptions", - parameters = mapOf("query" to "parameters"), - body = buildJsonObject { - put( - "facet", - JsonPrimitive("filters"), - ) - }, - requestOptions = RequestOptions( - urlParameters = buildMap { - put("myParam", listOf("c", "d")) - }, - ), - ) - }, - intercept = { - assertEquals("/1/test/requestOptions".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertContainsAll("""{"query":"parameters","myParam":"c,d"}""", it.url.parameters) - assertJsonBody("""{"facet":"filters"}""", it.body) - }, - ) - } - - @Test - fun `requestOptions queryParameters accepts list of booleans`() = runTest { - client.runTest( - call = { - post( - path = "/test/requestOptions", - parameters = mapOf("query" to "parameters"), - body = buildJsonObject { - put( - "facet", - JsonPrimitive("filters"), - ) - }, - requestOptions = RequestOptions( - urlParameters = buildMap { - put("myParam", listOf(true, true, false)) - }, - ), - ) - }, - intercept = { - assertEquals("/1/test/requestOptions".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertContainsAll("""{"query":"parameters","myParam":"true,true,false"}""", it.url.parameters) - assertJsonBody("""{"facet":"filters"}""", it.body) - }, - ) - } - - @Test - fun `requestOptions queryParameters accepts list of integers`() = runTest { - client.runTest( - call = { - post( - path = "/test/requestOptions", - parameters = mapOf("query" to "parameters"), - body = buildJsonObject { - put( - "facet", - JsonPrimitive("filters"), - ) - }, - requestOptions = RequestOptions( - urlParameters = buildMap { - put("myParam", listOf(1, 2)) - }, - ), - ) - }, - intercept = { - assertEquals("/1/test/requestOptions".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertContainsAll("""{"query":"parameters","myParam":"1,2"}""", it.url.parameters) - assertJsonBody("""{"facet":"filters"}""", it.body) - }, - ) - } - - // put - - @Test - fun `allow put method for a custom path with minimal parameters`() = runTest { - client.runTest( - call = { - put( - path = "/test/minimal", - ) - }, - intercept = { - assertEquals("/1/test/minimal".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("PUT"), it.method) - assertJsonBody("""{}""", it.body) - }, - ) - } - - @Test - fun `allow put method for a custom path with all parameters`() = runTest { - client.runTest( - call = { - put( - path = "/test/all", - parameters = mapOf("query" to "parameters"), - body = buildJsonObject { - put( - "body", - JsonPrimitive("parameters"), - ) - }, - ) - }, - intercept = { - assertEquals("/1/test/all".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("PUT"), it.method) - assertContainsAll("""{"query":"parameters"}""", it.url.parameters) - assertJsonBody("""{"body":"parameters"}""", it.body) - }, - ) - } - - // updateModelInstance - - @Test - fun `update a model instance`() = runTest { - client.runTest( - call = { - updateModelInstance( - modelID = "model1", - updateModelParams = UpdateModelParams( - name = "Shopping stage for EU users", - modelAttributes = listOf("brand", "color", "category_level0", "category_level1"), - modelStatus = ModelStatus.values().first { it.value == "inactive" }, - ), - ) - }, - intercept = { - assertEquals("/1/predict/models/model1".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"name":"Shopping stage for EU users","modelAttributes":["brand","color","category_level0","category_level1"],"modelStatus":"inactive"}""", it.body) - }, - ) - } - - // updateSegment - - @Test - fun `updateSegment with name`() = runTest { - client.runTest( - call = { - updateSegment( - segmentID = "segment1", - updateSegmentParams = SegmentNameParam( - name = "example segment name", - ), - ) - }, - intercept = { - assertEquals("/1/segments/segment1".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"name":"example segment name"}""", it.body) - }, - ) - } - - @Test - fun `updateSegment with conditions`() = runTest { - client.runTest( - call = { - updateSegment( - segmentID = "segment1", - updateSegmentParams = SegmentConditionsParam( - conditions = SegmentParentConditions( - operator = SegmentConditionOperator.values().first { it.value == "AND" }, - operands = listOf( - SegmentOperandAffinity( - name = "predictions.order_value", - filters = listOf( - SegmentAffinityFilter( - operator = SegmentFilterOperatorNumerical.values().first { it.value == "GT" }, - value = SegmentAffinityFilterValue.Number(200.toNumberType()), - ), - ), - ), - ), - ), - ), - ) - }, - intercept = { - assertEquals("/1/segments/segment1".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"conditions":{"operator":"AND","operands":[{"name":"predictions.order_value","filters":[{"operator":"GT","value":200}]}]}}""", it.body) - }, - ) - } - - @Test - fun `updateSegment with name and conditions`() = runTest { - client.runTest( - call = { - updateSegment( - segmentID = "segment1", - updateSegmentParams = AllUpdateSegmentParams( - name = "example segment name", - conditions = SegmentParentConditions( - operator = SegmentConditionOperator.values().first { it.value == "AND" }, - operands = listOf( - SegmentOperandAffinity( - name = "predictions.order_value", - filters = listOf( - SegmentAffinityFilter( - operator = SegmentFilterOperatorNumerical.values().first { it.value == "GT" }, - value = SegmentAffinityFilterValue.Number(200.toNumberType()), - ), - ), - ), - ), - ), - ), - ) - }, - intercept = { - assertEquals("/1/segments/segment1".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"name":"example segment name","conditions":{"operator":"AND","operands":[{"name":"predictions.order_value","filters":[{"operator":"GT","value":200}]}]}}""", it.body) - }, - ) - } - - @Test - fun `updateSegment with filter probability`() = runTest { - client.runTest( - call = { - updateSegment( - segmentID = "segment1", - updateSegmentParams = SegmentConditionsParam( - conditions = SegmentParentConditions( - operator = SegmentConditionOperator.values().first { it.value == "AND" }, - operands = listOf( - SegmentOperandAffinity( - name = "predictions.affinities.color", - filters = listOf( - SegmentAffinityFilter( - operator = SegmentFilterOperatorNumerical.values().first { it.value == "EQ" }, - value = SegmentAffinityFilterValue.String("red"), - probability = SegmentFilterProbability( - gte = 0.5, - lte = 1, - ), - ), - ), - ), - ), - ), - ), - ) - }, - intercept = { - assertEquals("/1/segments/segment1".toPathSegments(), it.url.pathSegments) - assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"conditions":{"operator":"AND","operands":[{"name":"predictions.affinities.color","filters":[{"operator":"EQ","value":"red","probability":{"GTE":0.5,"LTE":1}}]}]}}""", it.body) - }, - ) - } -} diff --git a/website/docs/contributing/CLI/specs-commands.md b/website/docs/contributing/CLI/specs-commands.md index b453f8475b..39e94e3b73 100644 --- a/website/docs/contributing/CLI/specs-commands.md +++ b/website/docs/contributing/CLI/specs-commands.md @@ -41,7 +41,7 @@ yarn docker build specs recommend ### Build many spec ```bash -yarn docker build specs recommend search predict +yarn docker build specs recommend search ingestion ``` ## Lint diff --git a/yarn.lock b/yarn.lock index 1f82fbfeb9..a0ffc8c882 100644 --- a/yarn.lock +++ b/yarn.lock @@ -124,12 +124,6 @@ __metadata: languageName: node linkType: soft -"@algolia/predict@link:../../../clients/algoliasearch-client-javascript/packages/predict::locator=javascript-playground%40workspace%3Aplayground%2Fjavascript%2Fnode": - version: 0.0.0-use.local - resolution: "@algolia/predict@link:../../../clients/algoliasearch-client-javascript/packages/predict::locator=javascript-playground%40workspace%3Aplayground%2Fjavascript%2Fnode" - languageName: node - linkType: soft - "@algolia/recommend@link:../../../clients/algoliasearch-client-javascript/packages/recommend::locator=javascript-playground%40workspace%3Aplayground%2Fjavascript%2Fnode": version: 0.0.0-use.local resolution: "@algolia/recommend@link:../../../clients/algoliasearch-client-javascript/packages/recommend::locator=javascript-playground%40workspace%3Aplayground%2Fjavascript%2Fnode" @@ -6556,7 +6550,6 @@ __metadata: "@algolia/client-query-suggestions": "link:../../../clients/algoliasearch-client-javascript/packages/client-query-suggestions" "@algolia/client-search": "link:../../../clients/algoliasearch-client-javascript/packages/client-search" "@algolia/ingestion": "link:../../../clients/algoliasearch-client-javascript/packages/ingestion" - "@algolia/predict": "link:../../../clients/algoliasearch-client-javascript/packages/predict" "@algolia/recommend": "link:../../../clients/algoliasearch-client-javascript/packages/recommend" "@algolia/requester-node-http": "link:../../../clients/algoliasearch-client-javascript/packages/requester-node-http" algoliasearch: "link:../../../clients/algoliasearch-client-javascript/packages/algoliasearch"