From 48fc1da58e6282c5b493e64467c5b6053b91e95b Mon Sep 17 00:00:00 2001 From: algolia-bot Date: Fri, 15 Nov 2024 15:37:02 +0000 Subject: [PATCH] fix(specs): remove private beta endpoint from recommend [skip-bc] (#4110) (generated) [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Clément Vannicatte --- .../Recommend/RecommendationsRequest.cs | 41 -- .../Recommend/RecommendedForYouModel.cs | 27 -- .../Recommend/RecommendedForYouQuery.cs | 153 ------- .../algoliasearch/lib/algoliasearch_lite.dart | 3 - .../algoliasearch/lib/src/deserialize.dart | 11 - .../src/model/get_recommendations_params.dart | 1 - .../lib/src/model/recommended_for_you.dart | 43 -- .../lib/src/model/recommended_for_you.g.dart | 44 -- .../src/model/recommended_for_you_model.dart | 24 -- .../src/model/recommended_for_you_query.dart | 77 ---- .../model/recommended_for_you_query.g.dart | 59 --- .../lib/algolia_client_recommend.dart | 3 - .../client_recommend/lib/src/deserialize.dart | 11 - .../src/model/get_recommendations_params.dart | 1 - .../lib/src/model/recommended_for_you.dart | 43 -- .../lib/src/model/recommended_for_you.g.dart | 44 -- .../src/model/recommended_for_you_model.dart | 24 -- .../src/model/recommended_for_you_query.dart | 77 ---- .../model/recommended_for_you_query.g.dart | 59 --- .../model_recommendations_request.go | 38 +- .../model_recommended_for_you_model.go | 63 --- .../model_recommended_for_you_query.go | 273 ------------ .../recommend/RecommendationsRequest.java | 11 - .../recommend/RecommendedForYouModel.java | 38 -- .../recommend/RecommendedForYouQuery.java | 153 ------- .../algoliasearch/lite/model/index.ts | 3 - .../lite/model/recommendationsRequest.ts | 4 +- .../lite/model/recommendedForYou.ts | 10 - .../lite/model/recommendedForYouModel.ts | 6 - .../lite/model/recommendedForYouQuery.ts | 6 - .../packages/recommend/model/index.ts | 3 - .../recommend/model/recommendationsRequest.ts | 4 +- .../recommend/model/recommendedForYou.ts | 10 - .../recommend/model/recommendedForYouModel.ts | 6 - .../recommend/model/recommendedForYouQuery.ts | 6 - .../model/recommend/RecommendationsRequest.kt | 9 - .../model/recommend/RecommendedForYouModel.kt | 16 - .../model/recommend/RecommendedForYouQuery.kt | 34 -- .../Recommend/RecommendationsRequest.php | 6 +- .../Recommend/RecommendedForYouModel.php | 32 -- .../Recommend/RecommendedForYouQuery.php | 396 ------------------ .../models/recommendations_request.py | 17 +- .../models/recommended_for_you_model.py | 32 -- .../models/recommended_for_you_query.py | 101 ----- .../recommend/recommendations_request.rb | 1 - .../recommend/recommended_for_you_model.rb | 31 -- .../recommend/recommended_for_you_query.rb | 273 ------------ .../algoliasearch/recommend/JsonSupport.scala | 1 - .../recommend/RecommendationsRequest.scala | 14 +- .../recommend/RecommendedForYou.scala | 39 -- .../recommend/RecommendedForYouModel.scala | 60 --- .../recommend/RecommendedForYouQuery.scala | 52 --- .../Models/RecommendationsRequest.swift | 7 - .../Recommend/Models/RecommendedForYou.swift | 44 -- .../Models/RecommendedForYouModel.swift | 14 - .../Models/RecommendedForYouQuery.swift | 80 ---- specs/bundled/algoliasearch.yml | 21 - specs/bundled/recommend.doc.yml | 21 - specs/bundled/recommend.yml | 21 - 59 files changed, 17 insertions(+), 2684 deletions(-) delete mode 100644 clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RecommendedForYouModel.cs delete mode 100644 clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RecommendedForYouQuery.cs delete mode 100644 clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommended_for_you.dart delete mode 100644 clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommended_for_you.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommended_for_you_model.dart delete mode 100644 clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommended_for_you_query.dart delete mode 100644 clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommended_for_you_query.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommended_for_you.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommended_for_you.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommended_for_you_model.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommended_for_you_query.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommended_for_you_query.g.dart delete mode 100644 clients/algoliasearch-client-go/algolia/recommend/model_recommended_for_you_model.go delete mode 100644 clients/algoliasearch-client-go/algolia/recommend/model_recommended_for_you_query.go delete mode 100644 clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/RecommendedForYouModel.java delete mode 100644 clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/RecommendedForYouQuery.java delete mode 100644 clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/recommendedForYou.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/recommendedForYouModel.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/recommendedForYouQuery.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/recommend/model/recommendedForYou.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/recommend/model/recommendedForYouModel.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/recommend/model/recommendedForYouQuery.ts delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendedForYouModel.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendedForYouQuery.kt delete mode 100644 clients/algoliasearch-client-php/lib/Model/Recommend/RecommendedForYouModel.php delete mode 100644 clients/algoliasearch-client-php/lib/Model/Recommend/RecommendedForYouQuery.php delete mode 100644 clients/algoliasearch-client-python/algoliasearch/recommend/models/recommended_for_you_model.py delete mode 100644 clients/algoliasearch-client-python/algoliasearch/recommend/models/recommended_for_you_query.py delete mode 100644 clients/algoliasearch-client-ruby/lib/algolia/models/recommend/recommended_for_you_model.rb delete mode 100644 clients/algoliasearch-client-ruby/lib/algolia/models/recommend/recommended_for_you_query.rb delete mode 100644 clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendedForYou.scala delete mode 100644 clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendedForYouModel.scala delete mode 100644 clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendedForYouQuery.scala delete mode 100644 clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYou.swift delete mode 100644 clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYouModel.swift delete mode 100644 clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYouQuery.swift diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RecommendationsRequest.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RecommendationsRequest.cs index b65c7fe01e..b7af35ddb8 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RecommendationsRequest.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RecommendationsRequest.cs @@ -70,16 +70,6 @@ public RecommendationsRequest(LookingSimilarQuery actualInstance) ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } - /// - /// Initializes a new instance of the RecommendationsRequest class - /// with a RecommendedForYouQuery - /// - /// An instance of RecommendedForYouQuery. - public RecommendationsRequest(RecommendedForYouQuery actualInstance) - { - ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); - } - /// /// Gets or Sets ActualInstance @@ -136,16 +126,6 @@ public LookingSimilarQuery AsLookingSimilarQuery() return (LookingSimilarQuery)ActualInstance; } - /// - /// Get the actual instance of `RecommendedForYouQuery`. If the actual instance is not `RecommendedForYouQuery`, - /// the InvalidClassException will be thrown - /// - /// An instance of RecommendedForYouQuery - public RecommendedForYouQuery AsRecommendedForYouQuery() - { - return (RecommendedForYouQuery)ActualInstance; - } - /// /// Check if the actual instance is of `BoughtTogetherQuery` type. @@ -192,15 +172,6 @@ public bool IsLookingSimilarQuery() return ActualInstance.GetType() == typeof(LookingSimilarQuery); } - /// - /// Check if the actual instance is of `RecommendedForYouQuery` type. - /// - /// Whether or not the instance is the type - public bool IsRecommendedForYouQuery() - { - return ActualInstance.GetType() == typeof(RecommendedForYouQuery); - } - /// /// Returns the string presentation of the object /// @@ -345,18 +316,6 @@ public override RecommendationsRequest Read(ref Utf8JsonReader reader, Type type System.Diagnostics.Debug.WriteLine($"Failed to deserialize into LookingSimilarQuery: {exception}"); } } - if (root.ValueKind == JsonValueKind.Object) - { - try - { - return new RecommendationsRequest(jsonDocument.Deserialize(JsonConfig.Options)); - } - catch (Exception exception) - { - // deserialization failed, try the next one - System.Diagnostics.Debug.WriteLine($"Failed to deserialize into RecommendedForYouQuery: {exception}"); - } - } throw new InvalidDataException($"The JSON string cannot be deserialized into any schema defined."); } diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RecommendedForYouModel.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RecommendedForYouModel.cs deleted file mode 100644 index 7ddc035461..0000000000 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RecommendedForYouModel.cs +++ /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. -// -using System; -using System.Text; -using System.Linq; -using System.Text.Json.Serialization; -using System.Collections.Generic; -using Algolia.Search.Serializer; -using System.Text.Json; - -namespace Algolia.Search.Models.Recommend; - -/// -/// \"Recommened for you\" model. -/// -/// \"Recommened for you\" model. -[JsonConverter(typeof(Serializer.JsonStringEnumConverter))] -public enum RecommendedForYouModel -{ - /// - /// Enum RecommendedForYou for value: recommended-for-you - /// - [JsonPropertyName("recommended-for-you")] - RecommendedForYou = 1 -} - diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RecommendedForYouQuery.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RecommendedForYouQuery.cs deleted file mode 100644 index a55183fd60..0000000000 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RecommendedForYouQuery.cs +++ /dev/null @@ -1,153 +0,0 @@ -// -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -// -using System; -using System.Text; -using System.Linq; -using System.Text.Json.Serialization; -using System.Collections.Generic; -using Algolia.Search.Serializer; -using System.Text.Json; - -namespace Algolia.Search.Models.Recommend; - -/// -/// RecommendedForYouQuery -/// -public partial class RecommendedForYouQuery -{ - - /// - /// Gets or Sets Model - /// - [JsonPropertyName("model")] - public RecommendedForYouModel? Model { get; set; } - /// - /// Initializes a new instance of the RecommendedForYouQuery class. - /// - [JsonConstructor] - public RecommendedForYouQuery() { } - /// - /// Initializes a new instance of the RecommendedForYouQuery class. - /// - /// Index name (case-sensitive). (required). - /// Minimum score a recommendation must have to be included in the response. (required). - /// model (required). - public RecommendedForYouQuery(string indexName, double threshold, RecommendedForYouModel? model) - { - IndexName = indexName ?? throw new ArgumentNullException(nameof(indexName)); - Threshold = threshold; - Model = model; - } - - /// - /// Index name (case-sensitive). - /// - /// Index name (case-sensitive). - [JsonPropertyName("indexName")] - public string IndexName { get; set; } - - /// - /// Minimum score a recommendation must have to be included in the response. - /// - /// Minimum score a recommendation must have to be included in the response. - [JsonPropertyName("threshold")] - public double Threshold { get; set; } - - /// - /// Maximum number of recommendations to retrieve. By default, all recommendations are returned and no fallback request is made. Depending on the available recommendations and the other request parameters, the actual number of recommendations may be lower than this value. - /// - /// Maximum number of recommendations to retrieve. By default, all recommendations are returned and no fallback request is made. Depending on the available recommendations and the other request parameters, the actual number of recommendations may be lower than this value. - [JsonPropertyName("maxRecommendations")] - public int? MaxRecommendations { get; set; } - - /// - /// Gets or Sets QueryParameters - /// - [JsonPropertyName("queryParameters")] - public RecommendSearchParams QueryParameters { get; set; } - - /// - /// Gets or Sets FallbackParameters - /// - [JsonPropertyName("fallbackParameters")] - public FallbackParams FallbackParameters { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - StringBuilder sb = new StringBuilder(); - sb.Append("class RecommendedForYouQuery {\n"); - sb.Append(" IndexName: ").Append(IndexName).Append("\n"); - sb.Append(" Threshold: ").Append(Threshold).Append("\n"); - sb.Append(" MaxRecommendations: ").Append(MaxRecommendations).Append("\n"); - sb.Append(" QueryParameters: ").Append(QueryParameters).Append("\n"); - sb.Append(" Model: ").Append(Model).Append("\n"); - sb.Append(" FallbackParameters: ").Append(FallbackParameters).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonSerializer.Serialize(this, JsonConfig.Options); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - if (obj is not RecommendedForYouQuery input) - { - return false; - } - - return - (IndexName == input.IndexName || (IndexName != null && IndexName.Equals(input.IndexName))) && - (Threshold == input.Threshold || Threshold.Equals(input.Threshold)) && - (MaxRecommendations == input.MaxRecommendations || MaxRecommendations.Equals(input.MaxRecommendations)) && - (QueryParameters == input.QueryParameters || (QueryParameters != null && QueryParameters.Equals(input.QueryParameters))) && - (Model == input.Model || Model.Equals(input.Model)) && - (FallbackParameters == input.FallbackParameters || (FallbackParameters != null && FallbackParameters.Equals(input.FallbackParameters))); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (IndexName != null) - { - hashCode = (hashCode * 59) + IndexName.GetHashCode(); - } - hashCode = (hashCode * 59) + Threshold.GetHashCode(); - hashCode = (hashCode * 59) + MaxRecommendations.GetHashCode(); - if (QueryParameters != null) - { - hashCode = (hashCode * 59) + QueryParameters.GetHashCode(); - } - hashCode = (hashCode * 59) + Model.GetHashCode(); - if (FallbackParameters != null) - { - hashCode = (hashCode * 59) + FallbackParameters.GetHashCode(); - } - return hashCode; - } - } - -} - diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/algoliasearch_lite.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/algoliasearch_lite.dart index 143b5ba53b..3dd0c10609 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/algoliasearch_lite.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/algoliasearch_lite.dart @@ -66,9 +66,6 @@ export 'src/model/recommend_index_settings.dart'; export 'src/model/recommend_search_params.dart'; export 'src/model/recommendations_hits.dart'; export 'src/model/recommendations_results.dart'; -export 'src/model/recommended_for_you.dart'; -export 'src/model/recommended_for_you_model.dart'; -export 'src/model/recommended_for_you_query.dart'; export 'src/model/redirect.dart'; export 'src/model/redirect_rule_index_data.dart'; export 'src/model/redirect_rule_index_metadata.dart'; diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/deserialize.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/deserialize.dart index 726eea60a4..d1d0acd1b0 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/deserialize.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/deserialize.dart @@ -59,9 +59,6 @@ import 'package:algoliasearch/src/model/recommend_index_settings.dart'; import 'package:algoliasearch/src/model/recommend_search_params.dart'; import 'package:algoliasearch/src/model/recommendations_hits.dart'; import 'package:algoliasearch/src/model/recommendations_results.dart'; -import 'package:algoliasearch/src/model/recommended_for_you.dart'; -import 'package:algoliasearch/src/model/recommended_for_you_model.dart'; -import 'package:algoliasearch/src/model/recommended_for_you_query.dart'; import 'package:algoliasearch/src/model/redirect.dart'; import 'package:algoliasearch/src/model/redirect_rule_index_data.dart'; import 'package:algoliasearch/src/model/redirect_rule_index_metadata.dart'; @@ -279,14 +276,6 @@ ReturnType deserialize(dynamic value, String targetType, case 'RecommendationsResults': return RecommendationsResults.fromJson(value as Map) as ReturnType; - case 'RecommendedForYou': - return RecommendedForYou.fromJson(value as Map) - as ReturnType; - case 'RecommendedForYouModel': - return RecommendedForYouModel.fromJson(value) as ReturnType; - case 'RecommendedForYouQuery': - return RecommendedForYouQuery.fromJson(value as Map) - as ReturnType; case 'Redirect': return Redirect.fromJson(value as Map) as ReturnType; case 'RedirectRuleIndexData': diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/get_recommendations_params.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/get_recommendations_params.dart index 141a969e43..828dceee0c 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/get_recommendations_params.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/get_recommendations_params.dart @@ -17,7 +17,6 @@ final class GetRecommendationsParams { /// - [LookingSimilarQuery] /// - [RelatedQuery] /// - [TrendingItemsQuery] - /// - [RecommendedForYouQuery] /// - [TrendingFacetsQuery] /// - [BoughtTogetherQuery] @JsonKey(name: r'requests') diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommended_for_you.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommended_for_you.dart deleted file mode 100644 index e442cd382b..0000000000 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommended_for_you.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:algoliasearch/src/model/fallback_params.dart'; -import 'package:algoliasearch/src/model/recommended_for_you_model.dart'; - -import 'package:json_annotation/json_annotation.dart'; - -part 'recommended_for_you.g.dart'; - -@JsonSerializable() -final class RecommendedForYou { - /// Returns a new [RecommendedForYou] instance. - const RecommendedForYou({ - required this.model, - this.fallbackParameters, - }); - - @JsonKey(name: r'model') - final RecommendedForYouModel model; - - @JsonKey(name: r'fallbackParameters') - final FallbackParams? fallbackParameters; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is RecommendedForYou && - other.model == model && - other.fallbackParameters == fallbackParameters; - - @override - int get hashCode => model.hashCode + fallbackParameters.hashCode; - - factory RecommendedForYou.fromJson(Map json) => - _$RecommendedForYouFromJson(json); - - Map toJson() => _$RecommendedForYouToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommended_for_you.g.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommended_for_you.g.dart deleted file mode 100644 index 62aa5cd745..0000000000 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommended_for_you.g.dart +++ /dev/null @@ -1,44 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'recommended_for_you.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -RecommendedForYou _$RecommendedForYouFromJson(Map json) => - $checkedCreate( - 'RecommendedForYou', - json, - ($checkedConvert) { - final val = RecommendedForYou( - model: $checkedConvert( - 'model', (v) => $enumDecode(_$RecommendedForYouModelEnumMap, v)), - fallbackParameters: $checkedConvert( - 'fallbackParameters', - (v) => v == null - ? null - : FallbackParams.fromJson(v as Map)), - ); - return val; - }, - ); - -Map _$RecommendedForYouToJson(RecommendedForYou instance) { - final val = { - 'model': instance.model.toJson(), - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('fallbackParameters', instance.fallbackParameters?.toJson()); - return val; -} - -const _$RecommendedForYouModelEnumMap = { - RecommendedForYouModel.recommendedForYou: 'recommended-for-you', -}; diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommended_for_you_model.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommended_for_you_model.dart deleted file mode 100644 index 9a88c29ca9..0000000000 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommended_for_you_model.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'; - -/// \"Recommened for you\" model. -@JsonEnum(valueField: 'raw') -enum RecommendedForYouModel { - recommendedForYou(r'recommended-for-you'); - - const RecommendedForYouModel(this.raw); - final dynamic raw; - - dynamic toJson() => raw; - - static RecommendedForYouModel fromJson(dynamic json) { - for (final value in values) { - if (value.raw == json) return value; - } - throw ArgumentError.value(json, "raw", "No enum value with that value"); - } - - @override - String toString() => raw.toString(); -} diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommended_for_you_query.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommended_for_you_query.dart deleted file mode 100644 index 680f2591d9..0000000000 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommended_for_you_query.dart +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -// ignore_for_file: unused_element -import 'package:algoliasearch/src/model/fallback_params.dart'; -import 'package:algoliasearch/src/model/recommended_for_you_model.dart'; -import 'package:algoliasearch/src/model/recommend_search_params.dart'; - -import 'package:json_annotation/json_annotation.dart'; - -part 'recommended_for_you_query.g.dart'; - -@JsonSerializable() -final class RecommendedForYouQuery { - /// Returns a new [RecommendedForYouQuery] instance. - const RecommendedForYouQuery({ - required this.indexName, - required this.threshold, - this.maxRecommendations, - this.queryParameters, - required this.model, - this.fallbackParameters, - }); - - /// Index name (case-sensitive). - @JsonKey(name: r'indexName') - final String indexName; - - /// Minimum score a recommendation must have to be included in the response. - // minimum: 0 - // maximum: 100 - @JsonKey(name: r'threshold') - final double threshold; - - /// Maximum number of recommendations to retrieve. By default, all recommendations are returned and no fallback request is made. Depending on the available recommendations and the other request parameters, the actual number of recommendations may be lower than this value. - // minimum: 1 - // maximum: 1000 - @JsonKey(name: r'maxRecommendations') - final int? maxRecommendations; - - @JsonKey(name: r'queryParameters') - final RecommendSearchParams? queryParameters; - - @JsonKey(name: r'model') - final RecommendedForYouModel model; - - @JsonKey(name: r'fallbackParameters') - final FallbackParams? fallbackParameters; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is RecommendedForYouQuery && - other.indexName == indexName && - other.threshold == threshold && - other.maxRecommendations == maxRecommendations && - other.queryParameters == queryParameters && - other.model == model && - other.fallbackParameters == fallbackParameters; - - @override - int get hashCode => - indexName.hashCode + - threshold.hashCode + - maxRecommendations.hashCode + - queryParameters.hashCode + - model.hashCode + - fallbackParameters.hashCode; - - factory RecommendedForYouQuery.fromJson(Map json) => - _$RecommendedForYouQueryFromJson(json); - - Map toJson() => _$RecommendedForYouQueryToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommended_for_you_query.g.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommended_for_you_query.g.dart deleted file mode 100644 index 276d270df0..0000000000 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/recommended_for_you_query.g.dart +++ /dev/null @@ -1,59 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'recommended_for_you_query.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -RecommendedForYouQuery _$RecommendedForYouQueryFromJson( - Map json) => - $checkedCreate( - 'RecommendedForYouQuery', - json, - ($checkedConvert) { - final val = RecommendedForYouQuery( - indexName: $checkedConvert('indexName', (v) => v as String), - threshold: $checkedConvert('threshold', (v) => (v as num).toDouble()), - maxRecommendations: $checkedConvert( - 'maxRecommendations', (v) => (v as num?)?.toInt()), - queryParameters: $checkedConvert( - 'queryParameters', - (v) => v == null - ? null - : RecommendSearchParams.fromJson(v as Map)), - model: $checkedConvert( - 'model', (v) => $enumDecode(_$RecommendedForYouModelEnumMap, v)), - fallbackParameters: $checkedConvert( - 'fallbackParameters', - (v) => v == null - ? null - : FallbackParams.fromJson(v as Map)), - ); - return val; - }, - ); - -Map _$RecommendedForYouQueryToJson( - RecommendedForYouQuery instance) { - final val = { - 'indexName': instance.indexName, - 'threshold': instance.threshold, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('maxRecommendations', instance.maxRecommendations); - writeNotNull('queryParameters', instance.queryParameters?.toJson()); - val['model'] = instance.model.toJson(); - writeNotNull('fallbackParameters', instance.fallbackParameters?.toJson()); - return val; -} - -const _$RecommendedForYouModelEnumMap = { - RecommendedForYouModel.recommendedForYou: 'recommended-for-you', -}; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/algolia_client_recommend.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/algolia_client_recommend.dart index bb755bd48d..5eac3ba2ea 100644 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/algolia_client_recommend.dart +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/algolia_client_recommend.dart @@ -56,9 +56,6 @@ export 'src/model/recommend_search_params.dart'; export 'src/model/recommend_updated_at_response.dart'; export 'src/model/recommendations_hits.dart'; export 'src/model/recommendations_results.dart'; -export 'src/model/recommended_for_you.dart'; -export 'src/model/recommended_for_you_model.dart'; -export 'src/model/recommended_for_you_query.dart'; export 'src/model/redirect.dart'; export 'src/model/redirect_rule_index_data.dart'; export 'src/model/redirect_rule_index_metadata.dart'; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/deserialize.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/deserialize.dart index fd3165dabd..0e5ac3186a 100644 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/deserialize.dart +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/deserialize.dart @@ -49,9 +49,6 @@ import 'package:algolia_client_recommend/src/model/recommend_search_params.dart' import 'package:algolia_client_recommend/src/model/recommend_updated_at_response.dart'; import 'package:algolia_client_recommend/src/model/recommendations_hits.dart'; import 'package:algolia_client_recommend/src/model/recommendations_results.dart'; -import 'package:algolia_client_recommend/src/model/recommended_for_you.dart'; -import 'package:algolia_client_recommend/src/model/recommended_for_you_model.dart'; -import 'package:algolia_client_recommend/src/model/recommended_for_you_query.dart'; import 'package:algolia_client_recommend/src/model/redirect.dart'; import 'package:algolia_client_recommend/src/model/redirect_rule_index_data.dart'; import 'package:algolia_client_recommend/src/model/redirect_rule_index_metadata.dart'; @@ -233,14 +230,6 @@ ReturnType deserialize(dynamic value, String targetType, case 'RecommendationsResults': return RecommendationsResults.fromJson(value as Map) as ReturnType; - case 'RecommendedForYou': - return RecommendedForYou.fromJson(value as Map) - as ReturnType; - case 'RecommendedForYouModel': - return RecommendedForYouModel.fromJson(value) as ReturnType; - case 'RecommendedForYouQuery': - return RecommendedForYouQuery.fromJson(value as Map) - as ReturnType; case 'Redirect': return Redirect.fromJson(value as Map) as ReturnType; case 'RedirectRuleIndexData': diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_params.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_params.dart index 141a969e43..828dceee0c 100644 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_params.dart +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/get_recommendations_params.dart @@ -17,7 +17,6 @@ final class GetRecommendationsParams { /// - [LookingSimilarQuery] /// - [RelatedQuery] /// - [TrendingItemsQuery] - /// - [RecommendedForYouQuery] /// - [TrendingFacetsQuery] /// - [BoughtTogetherQuery] @JsonKey(name: r'requests') diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommended_for_you.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommended_for_you.dart deleted file mode 100644 index a824178a36..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommended_for_you.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_recommend/src/model/recommended_for_you_model.dart'; -import 'package:algolia_client_recommend/src/model/fallback_params.dart'; - -import 'package:json_annotation/json_annotation.dart'; - -part 'recommended_for_you.g.dart'; - -@JsonSerializable() -final class RecommendedForYou { - /// Returns a new [RecommendedForYou] instance. - const RecommendedForYou({ - required this.model, - this.fallbackParameters, - }); - - @JsonKey(name: r'model') - final RecommendedForYouModel model; - - @JsonKey(name: r'fallbackParameters') - final FallbackParams? fallbackParameters; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is RecommendedForYou && - other.model == model && - other.fallbackParameters == fallbackParameters; - - @override - int get hashCode => model.hashCode + fallbackParameters.hashCode; - - factory RecommendedForYou.fromJson(Map json) => - _$RecommendedForYouFromJson(json); - - Map toJson() => _$RecommendedForYouToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommended_for_you.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommended_for_you.g.dart deleted file mode 100644 index 62aa5cd745..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommended_for_you.g.dart +++ /dev/null @@ -1,44 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'recommended_for_you.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -RecommendedForYou _$RecommendedForYouFromJson(Map json) => - $checkedCreate( - 'RecommendedForYou', - json, - ($checkedConvert) { - final val = RecommendedForYou( - model: $checkedConvert( - 'model', (v) => $enumDecode(_$RecommendedForYouModelEnumMap, v)), - fallbackParameters: $checkedConvert( - 'fallbackParameters', - (v) => v == null - ? null - : FallbackParams.fromJson(v as Map)), - ); - return val; - }, - ); - -Map _$RecommendedForYouToJson(RecommendedForYou instance) { - final val = { - 'model': instance.model.toJson(), - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('fallbackParameters', instance.fallbackParameters?.toJson()); - return val; -} - -const _$RecommendedForYouModelEnumMap = { - RecommendedForYouModel.recommendedForYou: 'recommended-for-you', -}; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommended_for_you_model.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommended_for_you_model.dart deleted file mode 100644 index 9a88c29ca9..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommended_for_you_model.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'; - -/// \"Recommened for you\" model. -@JsonEnum(valueField: 'raw') -enum RecommendedForYouModel { - recommendedForYou(r'recommended-for-you'); - - const RecommendedForYouModel(this.raw); - final dynamic raw; - - dynamic toJson() => raw; - - static RecommendedForYouModel fromJson(dynamic json) { - for (final value in values) { - if (value.raw == json) return value; - } - throw ArgumentError.value(json, "raw", "No enum value with that value"); - } - - @override - String toString() => raw.toString(); -} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommended_for_you_query.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommended_for_you_query.dart deleted file mode 100644 index e4fee24b0e..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommended_for_you_query.dart +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -// ignore_for_file: unused_element -import 'package:algolia_client_recommend/src/model/recommended_for_you_model.dart'; -import 'package:algolia_client_recommend/src/model/recommend_search_params.dart'; -import 'package:algolia_client_recommend/src/model/fallback_params.dart'; - -import 'package:json_annotation/json_annotation.dart'; - -part 'recommended_for_you_query.g.dart'; - -@JsonSerializable() -final class RecommendedForYouQuery { - /// Returns a new [RecommendedForYouQuery] instance. - const RecommendedForYouQuery({ - required this.indexName, - required this.threshold, - this.maxRecommendations, - this.queryParameters, - required this.model, - this.fallbackParameters, - }); - - /// Index name (case-sensitive). - @JsonKey(name: r'indexName') - final String indexName; - - /// Minimum score a recommendation must have to be included in the response. - // minimum: 0 - // maximum: 100 - @JsonKey(name: r'threshold') - final double threshold; - - /// Maximum number of recommendations to retrieve. By default, all recommendations are returned and no fallback request is made. Depending on the available recommendations and the other request parameters, the actual number of recommendations may be lower than this value. - // minimum: 1 - // maximum: 1000 - @JsonKey(name: r'maxRecommendations') - final int? maxRecommendations; - - @JsonKey(name: r'queryParameters') - final RecommendSearchParams? queryParameters; - - @JsonKey(name: r'model') - final RecommendedForYouModel model; - - @JsonKey(name: r'fallbackParameters') - final FallbackParams? fallbackParameters; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is RecommendedForYouQuery && - other.indexName == indexName && - other.threshold == threshold && - other.maxRecommendations == maxRecommendations && - other.queryParameters == queryParameters && - other.model == model && - other.fallbackParameters == fallbackParameters; - - @override - int get hashCode => - indexName.hashCode + - threshold.hashCode + - maxRecommendations.hashCode + - queryParameters.hashCode + - model.hashCode + - fallbackParameters.hashCode; - - factory RecommendedForYouQuery.fromJson(Map json) => - _$RecommendedForYouQueryFromJson(json); - - Map toJson() => _$RecommendedForYouQueryToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommended_for_you_query.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommended_for_you_query.g.dart deleted file mode 100644 index 276d270df0..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/recommended_for_you_query.g.dart +++ /dev/null @@ -1,59 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'recommended_for_you_query.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -RecommendedForYouQuery _$RecommendedForYouQueryFromJson( - Map json) => - $checkedCreate( - 'RecommendedForYouQuery', - json, - ($checkedConvert) { - final val = RecommendedForYouQuery( - indexName: $checkedConvert('indexName', (v) => v as String), - threshold: $checkedConvert('threshold', (v) => (v as num).toDouble()), - maxRecommendations: $checkedConvert( - 'maxRecommendations', (v) => (v as num?)?.toInt()), - queryParameters: $checkedConvert( - 'queryParameters', - (v) => v == null - ? null - : RecommendSearchParams.fromJson(v as Map)), - model: $checkedConvert( - 'model', (v) => $enumDecode(_$RecommendedForYouModelEnumMap, v)), - fallbackParameters: $checkedConvert( - 'fallbackParameters', - (v) => v == null - ? null - : FallbackParams.fromJson(v as Map)), - ); - return val; - }, - ); - -Map _$RecommendedForYouQueryToJson( - RecommendedForYouQuery instance) { - final val = { - 'indexName': instance.indexName, - 'threshold': instance.threshold, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('maxRecommendations', instance.maxRecommendations); - writeNotNull('queryParameters', instance.queryParameters?.toJson()); - val['model'] = instance.model.toJson(); - writeNotNull('fallbackParameters', instance.fallbackParameters?.toJson()); - return val; -} - -const _$RecommendedForYouModelEnumMap = { - RecommendedForYouModel.recommendedForYou: 'recommended-for-you', -}; diff --git a/clients/algoliasearch-client-go/algolia/recommend/model_recommendations_request.go b/clients/algoliasearch-client-go/algolia/recommend/model_recommendations_request.go index a341cfc8f8..b37346636d 100644 --- a/clients/algoliasearch-client-go/algolia/recommend/model_recommendations_request.go +++ b/clients/algoliasearch-client-go/algolia/recommend/model_recommendations_request.go @@ -8,12 +8,11 @@ import ( // RecommendationsRequest - struct for RecommendationsRequest. type RecommendationsRequest struct { - BoughtTogetherQuery *BoughtTogetherQuery - LookingSimilarQuery *LookingSimilarQuery - RecommendedForYouQuery *RecommendedForYouQuery - RelatedQuery *RelatedQuery - TrendingFacetsQuery *TrendingFacetsQuery - TrendingItemsQuery *TrendingItemsQuery + BoughtTogetherQuery *BoughtTogetherQuery + LookingSimilarQuery *LookingSimilarQuery + RelatedQuery *RelatedQuery + TrendingFacetsQuery *TrendingFacetsQuery + TrendingItemsQuery *TrendingItemsQuery } // BoughtTogetherQueryAsRecommendationsRequest is a convenience function that returns BoughtTogetherQuery wrapped in RecommendationsRequest. @@ -51,13 +50,6 @@ func LookingSimilarQueryAsRecommendationsRequest(v *LookingSimilarQuery) *Recomm } } -// RecommendedForYouQueryAsRecommendationsRequest is a convenience function that returns RecommendedForYouQuery wrapped in RecommendationsRequest. -func RecommendedForYouQueryAsRecommendationsRequest(v *RecommendedForYouQuery) *RecommendationsRequest { - return &RecommendationsRequest{ - RecommendedForYouQuery: v, - } -} - // Unmarshal JSON data into one of the pointers in the struct. func (dst *RecommendationsRequest) UnmarshalJSON(data []byte) error { var err error @@ -96,13 +88,6 @@ func (dst *RecommendationsRequest) UnmarshalJSON(data []byte) error { } else { dst.LookingSimilarQuery = nil } - // try to unmarshal data into RecommendedForYouQuery - err = newStrictDecoder(data).Decode(&dst.RecommendedForYouQuery) - if err == nil && validateStruct(dst.RecommendedForYouQuery) == nil { - return nil // found the correct type - } else { - dst.RecommendedForYouQuery = nil - } return fmt.Errorf("Data failed to match schemas in oneOf(RecommendationsRequest)") } @@ -127,15 +112,6 @@ func (src RecommendationsRequest) MarshalJSON() ([]byte, error) { return serialized, nil } - if src.RecommendedForYouQuery != nil { - serialized, err := json.Marshal(&src.RecommendedForYouQuery) - if err != nil { - return nil, fmt.Errorf("failed to unmarshal one of RecommendedForYouQuery of RecommendationsRequest: %w", err) - } - - return serialized, nil - } - if src.RelatedQuery != nil { serialized, err := json.Marshal(&src.RelatedQuery) if err != nil { @@ -176,10 +152,6 @@ func (obj RecommendationsRequest) GetActualInstance() any { return *obj.LookingSimilarQuery } - if obj.RecommendedForYouQuery != nil { - return *obj.RecommendedForYouQuery - } - if obj.RelatedQuery != nil { return *obj.RelatedQuery } diff --git a/clients/algoliasearch-client-go/algolia/recommend/model_recommended_for_you_model.go b/clients/algoliasearch-client-go/algolia/recommend/model_recommended_for_you_model.go deleted file mode 100644 index 9d590d2a00..0000000000 --- a/clients/algoliasearch-client-go/algolia/recommend/model_recommended_for_you_model.go +++ /dev/null @@ -1,63 +0,0 @@ -// Code generated by 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 recommend - -import ( - "encoding/json" - "fmt" -) - -// RecommendedForYouModel \"Recommend for you\" model. -type RecommendedForYouModel string - -// List of recommendedForYouModel. -const ( - RECOMMENDED_FOR_YOU_MODEL_RECOMMENDED_FOR_YOU RecommendedForYouModel = "recommended-for-you" -) - -// All allowed values of RecommendedForYouModel enum. -var AllowedRecommendedForYouModelEnumValues = []RecommendedForYouModel{ - "recommended-for-you", -} - -func (v *RecommendedForYouModel) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return fmt.Errorf("failed to unmarshal value '%s' for enum 'RecommendedForYouModel': %w", string(src), err) - } - enumTypeValue := RecommendedForYouModel(value) - for _, existing := range AllowedRecommendedForYouModelEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid RecommendedForYouModel", value) -} - -// NewRecommendedForYouModelFromValue returns a pointer to a valid RecommendedForYouModel -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewRecommendedForYouModelFromValue(v string) (*RecommendedForYouModel, error) { - ev := RecommendedForYouModel(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for RecommendedForYouModel: valid values are %v", v, AllowedRecommendedForYouModelEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v RecommendedForYouModel) IsValid() bool { - for _, existing := range AllowedRecommendedForYouModelEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to recommendedForYouModel value. -func (v RecommendedForYouModel) Ptr() *RecommendedForYouModel { - return &v -} diff --git a/clients/algoliasearch-client-go/algolia/recommend/model_recommended_for_you_query.go b/clients/algoliasearch-client-go/algolia/recommend/model_recommended_for_you_query.go deleted file mode 100644 index 64202cf940..0000000000 --- a/clients/algoliasearch-client-go/algolia/recommend/model_recommended_for_you_query.go +++ /dev/null @@ -1,273 +0,0 @@ -// Code generated by 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 recommend - -import ( - "encoding/json" - "fmt" -) - -// RecommendedForYouQuery struct for RecommendedForYouQuery. -type RecommendedForYouQuery struct { - // Index name (case-sensitive). - IndexName string `json:"indexName"` - // Minimum score a recommendation must have to be included in the response. - Threshold float64 `json:"threshold"` - // Maximum number of recommendations to retrieve. By default, all recommendations are returned and no fallback request is made. Depending on the available recommendations and the other request parameters, the actual number of recommendations may be lower than this value. - MaxRecommendations *int32 `json:"maxRecommendations,omitempty"` - QueryParameters *RecommendSearchParams `json:"queryParameters,omitempty"` - Model RecommendedForYouModel `json:"model"` - FallbackParameters *FallbackParams `json:"fallbackParameters,omitempty"` -} - -type RecommendedForYouQueryOption func(f *RecommendedForYouQuery) - -func WithRecommendedForYouQueryMaxRecommendations(val int32) RecommendedForYouQueryOption { - return func(f *RecommendedForYouQuery) { - f.MaxRecommendations = &val - } -} - -func WithRecommendedForYouQueryQueryParameters(val RecommendSearchParams) RecommendedForYouQueryOption { - return func(f *RecommendedForYouQuery) { - f.QueryParameters = &val - } -} - -func WithRecommendedForYouQueryFallbackParameters(val FallbackParams) RecommendedForYouQueryOption { - return func(f *RecommendedForYouQuery) { - f.FallbackParameters = &val - } -} - -// NewRecommendedForYouQuery instantiates a new RecommendedForYouQuery 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 NewRecommendedForYouQuery(indexName string, threshold float64, model RecommendedForYouModel, opts ...RecommendedForYouQueryOption) *RecommendedForYouQuery { - this := &RecommendedForYouQuery{} - this.IndexName = indexName - this.Threshold = threshold - this.Model = model - for _, opt := range opts { - opt(this) - } - return this -} - -// NewEmptyRecommendedForYouQuery return a pointer to an empty RecommendedForYouQuery object. -func NewEmptyRecommendedForYouQuery() *RecommendedForYouQuery { - return &RecommendedForYouQuery{} -} - -// GetIndexName returns the IndexName field value. -func (o *RecommendedForYouQuery) GetIndexName() string { - if o == nil { - var ret string - return ret - } - - return o.IndexName -} - -// GetIndexNameOk returns a tuple with the IndexName field value -// and a boolean to check if the value has been set. -func (o *RecommendedForYouQuery) GetIndexNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.IndexName, true -} - -// SetIndexName sets field value. -func (o *RecommendedForYouQuery) SetIndexName(v string) *RecommendedForYouQuery { - o.IndexName = v - return o -} - -// GetThreshold returns the Threshold field value. -func (o *RecommendedForYouQuery) GetThreshold() float64 { - if o == nil { - var ret float64 - return ret - } - - return o.Threshold -} - -// GetThresholdOk returns a tuple with the Threshold field value -// and a boolean to check if the value has been set. -func (o *RecommendedForYouQuery) GetThresholdOk() (*float64, bool) { - if o == nil { - return nil, false - } - return &o.Threshold, true -} - -// SetThreshold sets field value. -func (o *RecommendedForYouQuery) SetThreshold(v float64) *RecommendedForYouQuery { - o.Threshold = v - return o -} - -// GetMaxRecommendations returns the MaxRecommendations field value if set, zero value otherwise. -func (o *RecommendedForYouQuery) GetMaxRecommendations() int32 { - if o == nil || o.MaxRecommendations == nil { - var ret int32 - return ret - } - return *o.MaxRecommendations -} - -// GetMaxRecommendationsOk returns a tuple with the MaxRecommendations field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RecommendedForYouQuery) GetMaxRecommendationsOk() (*int32, bool) { - if o == nil || o.MaxRecommendations == nil { - return nil, false - } - return o.MaxRecommendations, true -} - -// HasMaxRecommendations returns a boolean if a field has been set. -func (o *RecommendedForYouQuery) HasMaxRecommendations() bool { - if o != nil && o.MaxRecommendations != nil { - return true - } - - return false -} - -// SetMaxRecommendations gets a reference to the given int32 and assigns it to the MaxRecommendations field. -func (o *RecommendedForYouQuery) SetMaxRecommendations(v int32) *RecommendedForYouQuery { - o.MaxRecommendations = &v - return o -} - -// GetQueryParameters returns the QueryParameters field value if set, zero value otherwise. -func (o *RecommendedForYouQuery) GetQueryParameters() RecommendSearchParams { - if o == nil || o.QueryParameters == nil { - var ret RecommendSearchParams - return ret - } - return *o.QueryParameters -} - -// GetQueryParametersOk returns a tuple with the QueryParameters field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RecommendedForYouQuery) GetQueryParametersOk() (*RecommendSearchParams, bool) { - if o == nil || o.QueryParameters == nil { - return nil, false - } - return o.QueryParameters, true -} - -// HasQueryParameters returns a boolean if a field has been set. -func (o *RecommendedForYouQuery) HasQueryParameters() bool { - if o != nil && o.QueryParameters != nil { - return true - } - - return false -} - -// SetQueryParameters gets a reference to the given RecommendSearchParams and assigns it to the QueryParameters field. -func (o *RecommendedForYouQuery) SetQueryParameters(v *RecommendSearchParams) *RecommendedForYouQuery { - o.QueryParameters = v - return o -} - -// GetModel returns the Model field value. -func (o *RecommendedForYouQuery) GetModel() RecommendedForYouModel { - if o == nil { - var ret RecommendedForYouModel - return ret - } - - return o.Model -} - -// GetModelOk returns a tuple with the Model field value -// and a boolean to check if the value has been set. -func (o *RecommendedForYouQuery) GetModelOk() (*RecommendedForYouModel, bool) { - if o == nil { - return nil, false - } - return &o.Model, true -} - -// SetModel sets field value. -func (o *RecommendedForYouQuery) SetModel(v RecommendedForYouModel) *RecommendedForYouQuery { - o.Model = v - return o -} - -// GetFallbackParameters returns the FallbackParameters field value if set, zero value otherwise. -func (o *RecommendedForYouQuery) GetFallbackParameters() FallbackParams { - if o == nil || o.FallbackParameters == nil { - var ret FallbackParams - return ret - } - return *o.FallbackParameters -} - -// GetFallbackParametersOk returns a tuple with the FallbackParameters field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RecommendedForYouQuery) GetFallbackParametersOk() (*FallbackParams, bool) { - if o == nil || o.FallbackParameters == nil { - return nil, false - } - return o.FallbackParameters, true -} - -// HasFallbackParameters returns a boolean if a field has been set. -func (o *RecommendedForYouQuery) HasFallbackParameters() bool { - if o != nil && o.FallbackParameters != nil { - return true - } - - return false -} - -// SetFallbackParameters gets a reference to the given FallbackParams and assigns it to the FallbackParameters field. -func (o *RecommendedForYouQuery) SetFallbackParameters(v *FallbackParams) *RecommendedForYouQuery { - o.FallbackParameters = v - return o -} - -func (o RecommendedForYouQuery) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if true { - toSerialize["indexName"] = o.IndexName - } - if true { - toSerialize["threshold"] = o.Threshold - } - if o.MaxRecommendations != nil { - toSerialize["maxRecommendations"] = o.MaxRecommendations - } - if o.QueryParameters != nil { - toSerialize["queryParameters"] = o.QueryParameters - } - if true { - toSerialize["model"] = o.Model - } - if o.FallbackParameters != nil { - toSerialize["fallbackParameters"] = o.FallbackParameters - } - serialized, err := json.Marshal(toSerialize) - if err != nil { - return nil, fmt.Errorf("failed to marshal RecommendedForYouQuery: %w", err) - } - - return serialized, nil -} - -func (o RecommendedForYouQuery) String() string { - out := "" - out += fmt.Sprintf(" indexName=%v\n", o.IndexName) - out += fmt.Sprintf(" threshold=%v\n", o.Threshold) - out += fmt.Sprintf(" maxRecommendations=%v\n", o.MaxRecommendations) - out += fmt.Sprintf(" queryParameters=%v\n", o.QueryParameters) - out += fmt.Sprintf(" model=%v\n", o.Model) - out += fmt.Sprintf(" fallbackParameters=%v\n", o.FallbackParameters) - return fmt.Sprintf("RecommendedForYouQuery {\n%s}", out) -} diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/RecommendationsRequest.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/RecommendationsRequest.java index f18c0ffc17..6ae7e27614 100644 --- a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/RecommendationsRequest.java +++ b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/RecommendationsRequest.java @@ -66,17 +66,6 @@ public RecommendationsRequest deserialize(JsonParser jp, DeserializationContext LOGGER.finest("Failed to deserialize oneOf LookingSimilarQuery (error: " + e.getMessage() + ") (type: LookingSimilarQuery)"); } } - // deserialize RecommendedForYouQuery - if (tree.isObject()) { - try (JsonParser parser = tree.traverse(jp.getCodec())) { - return parser.readValueAs(RecommendedForYouQuery.class); - } catch (Exception e) { - // deserialization failed, continue - LOGGER.finest( - "Failed to deserialize oneOf RecommendedForYouQuery (error: " + e.getMessage() + ") (type: RecommendedForYouQuery)" - ); - } - } throw new AlgoliaRuntimeException(String.format("Failed to deserialize json element: %s", tree)); } diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/RecommendedForYouModel.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/RecommendedForYouModel.java deleted file mode 100644 index d952bc5612..0000000000 --- a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/RecommendedForYouModel.java +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by 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.model.recommend; - -import com.fasterxml.jackson.annotation.*; -import com.fasterxml.jackson.databind.annotation.*; - -/** \"Recommened for you\" model. */ -public enum RecommendedForYouModel { - RECOMMENDED_FOR_YOU("recommended-for-you"); - - private final String value; - - RecommendedForYouModel(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static RecommendedForYouModel fromValue(String value) { - for (RecommendedForYouModel b : RecommendedForYouModel.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/RecommendedForYouQuery.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/RecommendedForYouQuery.java deleted file mode 100644 index 47ab287c06..0000000000 --- a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/RecommendedForYouQuery.java +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by 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.model.recommend; - -import com.fasterxml.jackson.annotation.*; -import com.fasterxml.jackson.databind.annotation.*; -import java.util.Objects; - -/** RecommendedForYouQuery */ -@JsonDeserialize(as = RecommendedForYouQuery.class) -public class RecommendedForYouQuery implements RecommendationsRequest { - - @JsonProperty("indexName") - private String indexName; - - @JsonProperty("threshold") - private Double threshold; - - @JsonProperty("maxRecommendations") - private Integer maxRecommendations; - - @JsonProperty("queryParameters") - private RecommendSearchParams queryParameters; - - @JsonProperty("model") - private RecommendedForYouModel model; - - @JsonProperty("fallbackParameters") - private FallbackParams fallbackParameters; - - public RecommendedForYouQuery setIndexName(String indexName) { - this.indexName = indexName; - return this; - } - - /** Index name (case-sensitive). */ - @javax.annotation.Nonnull - public String getIndexName() { - return indexName; - } - - public RecommendedForYouQuery setThreshold(Double threshold) { - this.threshold = threshold; - return this; - } - - /** - * Minimum score a recommendation must have to be included in the response. minimum: 0 maximum: - * 100 - */ - @javax.annotation.Nonnull - public Double getThreshold() { - return threshold; - } - - public RecommendedForYouQuery setMaxRecommendations(Integer maxRecommendations) { - this.maxRecommendations = maxRecommendations; - return this; - } - - /** - * Maximum number of recommendations to retrieve. By default, all recommendations are returned and - * no fallback request is made. Depending on the available recommendations and the other request - * parameters, the actual number of recommendations may be lower than this value. minimum: 1 - * maximum: 1000 - */ - @javax.annotation.Nullable - public Integer getMaxRecommendations() { - return maxRecommendations; - } - - public RecommendedForYouQuery setQueryParameters(RecommendSearchParams queryParameters) { - this.queryParameters = queryParameters; - return this; - } - - /** Get queryParameters */ - @javax.annotation.Nullable - public RecommendSearchParams getQueryParameters() { - return queryParameters; - } - - public RecommendedForYouQuery setModel(RecommendedForYouModel model) { - this.model = model; - return this; - } - - /** Get model */ - @javax.annotation.Nonnull - public RecommendedForYouModel getModel() { - return model; - } - - public RecommendedForYouQuery setFallbackParameters(FallbackParams fallbackParameters) { - this.fallbackParameters = fallbackParameters; - return this; - } - - /** Get fallbackParameters */ - @javax.annotation.Nullable - public FallbackParams getFallbackParameters() { - return fallbackParameters; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RecommendedForYouQuery recommendedForYouQuery = (RecommendedForYouQuery) o; - return ( - Objects.equals(this.indexName, recommendedForYouQuery.indexName) && - Objects.equals(this.threshold, recommendedForYouQuery.threshold) && - Objects.equals(this.maxRecommendations, recommendedForYouQuery.maxRecommendations) && - Objects.equals(this.queryParameters, recommendedForYouQuery.queryParameters) && - Objects.equals(this.model, recommendedForYouQuery.model) && - Objects.equals(this.fallbackParameters, recommendedForYouQuery.fallbackParameters) - ); - } - - @Override - public int hashCode() { - return Objects.hash(indexName, threshold, maxRecommendations, queryParameters, model, fallbackParameters); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RecommendedForYouQuery {\n"); - sb.append(" indexName: ").append(toIndentedString(indexName)).append("\n"); - sb.append(" threshold: ").append(toIndentedString(threshold)).append("\n"); - sb.append(" maxRecommendations: ").append(toIndentedString(maxRecommendations)).append("\n"); - sb.append(" queryParameters: ").append(toIndentedString(queryParameters)).append("\n"); - sb.append(" model: ").append(toIndentedString(model)).append("\n"); - sb.append(" fallbackParameters: ").append(toIndentedString(fallbackParameters)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/index.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/index.ts index f58133a792..4ff806c5a7 100644 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/index.ts +++ b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/index.ts @@ -73,9 +73,6 @@ export * from './recommendationsHit'; export * from './recommendationsHits'; export * from './recommendationsRequest'; export * from './recommendationsResults'; -export * from './recommendedForYou'; -export * from './recommendedForYouModel'; -export * from './recommendedForYouQuery'; export * from './recommendHit'; export * from './recommendIndexSettings'; export * from './recommendSearchParams'; diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/recommendationsRequest.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/recommendationsRequest.ts index 3eefd54512..4600576aaa 100644 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/recommendationsRequest.ts +++ b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/recommendationsRequest.ts @@ -4,7 +4,6 @@ import type { BoughtTogetherQuery } from './boughtTogetherQuery'; import type { LookingSimilarQuery } from './lookingSimilarQuery'; -import type { RecommendedForYouQuery } from './recommendedForYouQuery'; import type { RelatedQuery } from './relatedQuery'; import type { TrendingFacetsQuery } from './trendingFacetsQuery'; import type { TrendingItemsQuery } from './trendingItemsQuery'; @@ -14,5 +13,4 @@ export type RecommendationsRequest = | RelatedQuery | TrendingItemsQuery | TrendingFacetsQuery - | LookingSimilarQuery - | RecommendedForYouQuery; + | LookingSimilarQuery; diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/recommendedForYou.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/recommendedForYou.ts deleted file mode 100644 index d85bef828e..0000000000 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/recommendedForYou.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 { FallbackParams } from './fallbackParams'; -import type { RecommendedForYouModel } from './recommendedForYouModel'; - -export type RecommendedForYou = { - model: RecommendedForYouModel; - - fallbackParameters?: FallbackParams; -}; diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/recommendedForYouModel.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/recommendedForYouModel.ts deleted file mode 100644 index 060ac32bdf..0000000000 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/recommendedForYouModel.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. - -/** - * \"Recommened for you\" model. - */ -export type RecommendedForYouModel = 'recommended-for-you'; diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/recommendedForYouQuery.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/recommendedForYouQuery.ts deleted file mode 100644 index 94e7470728..0000000000 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/recommendedForYouQuery.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 { BaseRecommendRequest } from './baseRecommendRequest'; -import type { RecommendedForYou } from './recommendedForYou'; - -export type RecommendedForYouQuery = BaseRecommendRequest & RecommendedForYou; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/index.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/index.ts index f984c96237..5cb6abe07f 100644 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/index.ts +++ b/clients/algoliasearch-client-javascript/packages/recommend/model/index.ts @@ -58,9 +58,6 @@ export * from './recommendationsHit'; export * from './recommendationsHits'; export * from './recommendationsRequest'; export * from './recommendationsResults'; -export * from './recommendedForYou'; -export * from './recommendedForYouModel'; -export * from './recommendedForYouQuery'; export * from './recommendHit'; export * from './recommendIndexSettings'; export * from './recommendModels'; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/recommendationsRequest.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/recommendationsRequest.ts index 3eefd54512..4600576aaa 100644 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/recommendationsRequest.ts +++ b/clients/algoliasearch-client-javascript/packages/recommend/model/recommendationsRequest.ts @@ -4,7 +4,6 @@ import type { BoughtTogetherQuery } from './boughtTogetherQuery'; import type { LookingSimilarQuery } from './lookingSimilarQuery'; -import type { RecommendedForYouQuery } from './recommendedForYouQuery'; import type { RelatedQuery } from './relatedQuery'; import type { TrendingFacetsQuery } from './trendingFacetsQuery'; import type { TrendingItemsQuery } from './trendingItemsQuery'; @@ -14,5 +13,4 @@ export type RecommendationsRequest = | RelatedQuery | TrendingItemsQuery | TrendingFacetsQuery - | LookingSimilarQuery - | RecommendedForYouQuery; + | LookingSimilarQuery; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/recommendedForYou.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/recommendedForYou.ts deleted file mode 100644 index d85bef828e..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/recommendedForYou.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 { FallbackParams } from './fallbackParams'; -import type { RecommendedForYouModel } from './recommendedForYouModel'; - -export type RecommendedForYou = { - model: RecommendedForYouModel; - - fallbackParameters?: FallbackParams; -}; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/recommendedForYouModel.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/recommendedForYouModel.ts deleted file mode 100644 index 060ac32bdf..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/recommendedForYouModel.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. - -/** - * \"Recommened for you\" model. - */ -export type RecommendedForYouModel = 'recommended-for-you'; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/recommendedForYouQuery.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/recommendedForYouQuery.ts deleted file mode 100644 index 94e7470728..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/recommendedForYouQuery.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 { BaseRecommendRequest } from './baseRecommendRequest'; -import type { RecommendedForYou } from './recommendedForYou'; - -export type RecommendedForYouQuery = BaseRecommendRequest & RecommendedForYou; diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendationsRequest.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendationsRequest.kt index 37b260d0f3..55160fee52 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendationsRequest.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendationsRequest.kt @@ -16,7 +16,6 @@ import kotlin.jvm.JvmInline * Implementations: * - [BoughtTogetherQuery] * - [LookingSimilarQuery] - * - [RecommendedForYouQuery] * - [RelatedQuery] * - [TrendingFacetsQuery] * - [TrendingItemsQuery] @@ -43,10 +42,6 @@ public sealed interface RecommendationsRequest { @JvmInline public value class LookingSimilarQueryValue(public val value: LookingSimilarQuery) : RecommendationsRequest - @Serializable - @JvmInline - public value class RecommendedForYouQueryValue(public val value: RecommendedForYouQuery) : RecommendationsRequest - public companion object { public fun of(value: BoughtTogetherQuery): RecommendationsRequest { @@ -64,9 +59,6 @@ public sealed interface RecommendationsRequest { public fun of(value: LookingSimilarQuery): RecommendationsRequest { return LookingSimilarQueryValue(value) } - public fun of(value: RecommendedForYouQuery): RecommendationsRequest { - return RecommendedForYouQueryValue(value) - } } } @@ -78,7 +70,6 @@ internal class RecommendationsRequestSerializer : JsonContentPolymorphicSerializ element is JsonObject -> TrendingItemsQuery.serializer() element is JsonObject -> TrendingFacetsQuery.serializer() element is JsonObject -> LookingSimilarQuery.serializer() - element is JsonObject -> RecommendedForYouQuery.serializer() else -> throw AlgoliaClientException("Failed to deserialize json element: $element") } } diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendedForYouModel.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendedForYouModel.kt deleted file mode 100644 index c6b4482cef..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendedForYouModel.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.recommend - -import kotlinx.serialization.* - -/** - * \"Recommened for you\" model. - */ -@Serializable -public enum class RecommendedForYouModel(public val value: kotlin.String) { - - @SerialName(value = "recommended-for-you") - RecommendedForYou("recommended-for-you"); - - override fun toString(): kotlin.String = value -} diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendedForYouQuery.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendedForYouQuery.kt deleted file mode 100644 index 6041dc9eef..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendedForYouQuery.kt +++ /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. */ -package com.algolia.client.model.recommend - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * RecommendedForYouQuery - * - * @param indexName Index name (case-sensitive). - * @param threshold Minimum score a recommendation must have to be included in the response. - * @param model - * @param maxRecommendations Maximum number of recommendations to retrieve. By default, all recommendations are returned and no fallback request is made. Depending on the available recommendations and the other request parameters, the actual number of recommendations may be lower than this value. - * @param queryParameters - * @param fallbackParameters - */ -@Serializable -public data class RecommendedForYouQuery( - - /** Index name (case-sensitive). */ - @SerialName(value = "indexName") val indexName: String, - - /** Minimum score a recommendation must have to be included in the response. */ - @SerialName(value = "threshold") val threshold: Double, - - @SerialName(value = "model") val model: RecommendedForYouModel, - - /** Maximum number of recommendations to retrieve. By default, all recommendations are returned and no fallback request is made. Depending on the available recommendations and the other request parameters, the actual number of recommendations may be lower than this value. */ - @SerialName(value = "maxRecommendations") val maxRecommendations: Int? = null, - - @SerialName(value = "queryParameters") val queryParameters: RecommendSearchParams? = null, - - @SerialName(value = "fallbackParameters") val fallbackParameters: FallbackParams? = null, -) : RecommendationsRequest diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationsRequest.php b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationsRequest.php index a7b4532ee7..55e1dd8a94 100644 --- a/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationsRequest.php +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationsRequest.php @@ -24,7 +24,7 @@ class RecommendationsRequest extends AbstractModel implements ModelInterface, \A 'threshold' => 'float', 'maxRecommendations' => 'int', 'queryParameters' => '\Algolia\AlgoliaSearch\Model\Recommend\RecommendSearchParams', - 'model' => '\Algolia\AlgoliaSearch\Model\Recommend\RecommendedForYouModel', + 'model' => '\Algolia\AlgoliaSearch\Model\Recommend\LookingSimilarModel', 'objectID' => 'string', 'fallbackParameters' => '\Algolia\AlgoliaSearch\Model\Recommend\FallbackParams', 'facetName' => 'mixed', @@ -332,7 +332,7 @@ public function setQueryParameters($queryParameters) /** * Gets model. * - * @return RecommendedForYouModel + * @return LookingSimilarModel */ public function getModel() { @@ -342,7 +342,7 @@ public function getModel() /** * Sets model. * - * @param RecommendedForYouModel $model model + * @param LookingSimilarModel $model model * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendedForYouModel.php b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendedForYouModel.php deleted file mode 100644 index fd131fbcc2..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendedForYouModel.php +++ /dev/null @@ -1,32 +0,0 @@ - 'string', - 'threshold' => 'float', - 'maxRecommendations' => 'int', - 'queryParameters' => '\Algolia\AlgoliaSearch\Model\Recommend\RecommendSearchParams', - 'model' => '\Algolia\AlgoliaSearch\Model\Recommend\RecommendedForYouModel', - 'fallbackParameters' => '\Algolia\AlgoliaSearch\Model\Recommend\FallbackParams', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization. - * - * @var string[] - */ - protected static $modelFormats = [ - 'indexName' => null, - 'threshold' => 'double', - 'maxRecommendations' => null, - 'queryParameters' => null, - 'model' => null, - 'fallbackParameters' => null, - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name. - * - * @var string[] - */ - protected static $attributeMap = [ - 'indexName' => 'indexName', - 'threshold' => 'threshold', - 'maxRecommendations' => 'maxRecommendations', - 'queryParameters' => 'queryParameters', - 'model' => 'model', - 'fallbackParameters' => 'fallbackParameters', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses). - * - * @var string[] - */ - protected static $setters = [ - 'indexName' => 'setIndexName', - 'threshold' => 'setThreshold', - 'maxRecommendations' => 'setMaxRecommendations', - 'queryParameters' => 'setQueryParameters', - 'model' => 'setModel', - 'fallbackParameters' => 'setFallbackParameters', - ]; - - /** - * Array of attributes to getter functions (for serialization of requests). - * - * @var string[] - */ - protected static $getters = [ - 'indexName' => 'getIndexName', - 'threshold' => 'getThreshold', - 'maxRecommendations' => 'getMaxRecommendations', - 'queryParameters' => 'getQueryParameters', - 'model' => 'getModel', - 'fallbackParameters' => 'getFallbackParameters', - ]; - - /** - * Associative array for storing property values. - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor. - * - * @param mixed[] $data Associated array of property values - */ - public function __construct(?array $data = null) - { - if (isset($data['indexName'])) { - $this->container['indexName'] = $data['indexName']; - } - if (isset($data['threshold'])) { - $this->container['threshold'] = $data['threshold']; - } - if (isset($data['maxRecommendations'])) { - $this->container['maxRecommendations'] = $data['maxRecommendations']; - } - if (isset($data['queryParameters'])) { - $this->container['queryParameters'] = $data['queryParameters']; - } - if (isset($data['model'])) { - $this->container['model'] = $data['model']; - } - if (isset($data['fallbackParameters'])) { - $this->container['fallbackParameters'] = $data['fallbackParameters']; - } - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name. - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of property to type mappings. Used for (de)serialization. - * - * @return array - */ - public static function modelTypes() - { - return self::$modelTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization. - * - * @return array - */ - public static function modelFormats() - { - return self::$modelFormats; - } - - /** - * Array of attributes to setter functions (for deserialization of responses). - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests). - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if (!isset($this->container['indexName']) || null === $this->container['indexName']) { - $invalidProperties[] = "'indexName' can't be null"; - } - if (!isset($this->container['threshold']) || null === $this->container['threshold']) { - $invalidProperties[] = "'threshold' can't be null"; - } - if (!isset($this->container['model']) || null === $this->container['model']) { - $invalidProperties[] = "'model' can't be null"; - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed. - * - * @return bool True if all properties are valid - */ - public function valid() - { - return 0 === count($this->listInvalidProperties()); - } - - /** - * Gets indexName. - * - * @return string - */ - public function getIndexName() - { - return $this->container['indexName'] ?? null; - } - - /** - * Sets indexName. - * - * @param string $indexName index name (case-sensitive) - * - * @return self - */ - public function setIndexName($indexName) - { - $this->container['indexName'] = $indexName; - - return $this; - } - - /** - * Gets threshold. - * - * @return float - */ - public function getThreshold() - { - return $this->container['threshold'] ?? null; - } - - /** - * Sets threshold. - * - * @param float $threshold minimum score a recommendation must have to be included in the response - * - * @return self - */ - public function setThreshold($threshold) - { - $this->container['threshold'] = $threshold; - - return $this; - } - - /** - * Gets maxRecommendations. - * - * @return null|int - */ - public function getMaxRecommendations() - { - return $this->container['maxRecommendations'] ?? null; - } - - /** - * Sets maxRecommendations. - * - * @param null|int $maxRecommendations Maximum number of recommendations to retrieve. By default, all recommendations are returned and no fallback request is made. Depending on the available recommendations and the other request parameters, the actual number of recommendations may be lower than this value. - * - * @return self - */ - public function setMaxRecommendations($maxRecommendations) - { - $this->container['maxRecommendations'] = $maxRecommendations; - - return $this; - } - - /** - * Gets queryParameters. - * - * @return null|RecommendSearchParams - */ - public function getQueryParameters() - { - return $this->container['queryParameters'] ?? null; - } - - /** - * Sets queryParameters. - * - * @param null|RecommendSearchParams $queryParameters queryParameters - * - * @return self - */ - public function setQueryParameters($queryParameters) - { - $this->container['queryParameters'] = $queryParameters; - - return $this; - } - - /** - * Gets model. - * - * @return RecommendedForYouModel - */ - public function getModel() - { - return $this->container['model'] ?? null; - } - - /** - * Sets model. - * - * @param RecommendedForYouModel $model model - * - * @return self - */ - public function setModel($model) - { - $this->container['model'] = $model; - - return $this; - } - - /** - * Gets fallbackParameters. - * - * @return null|FallbackParams - */ - public function getFallbackParameters() - { - return $this->container['fallbackParameters'] ?? null; - } - - /** - * Sets fallbackParameters. - * - * @param null|FallbackParams $fallbackParameters fallbackParameters - * - * @return self - */ - public function setFallbackParameters($fallbackParameters) - { - $this->container['fallbackParameters'] = $fallbackParameters; - - return $this; - } - - /** - * Returns true if offset exists. False otherwise. - * - * @param int $offset Offset - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param int $offset Offset - * - * @return null|mixed - */ - public function offsetGet($offset): mixed - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param null|int $offset Offset - * @param mixed $value Value to be set - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param int $offset Offset - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } -} diff --git a/clients/algoliasearch-client-python/algoliasearch/recommend/models/recommendations_request.py b/clients/algoliasearch-client-python/algoliasearch/recommend/models/recommendations_request.py index ad5f9f534a..4bc634fd75 100644 --- a/clients/algoliasearch-client-python/algoliasearch/recommend/models/recommendations_request.py +++ b/clients/algoliasearch-client-python/algoliasearch/recommend/models/recommendations_request.py @@ -20,9 +20,6 @@ from algoliasearch.recommend.models.bought_together_query import BoughtTogetherQuery from algoliasearch.recommend.models.looking_similar_query import LookingSimilarQuery -from algoliasearch.recommend.models.recommended_for_you_query import ( - RecommendedForYouQuery, -) from algoliasearch.recommend.models.related_query import RelatedQuery from algoliasearch.recommend.models.trending_facets_query import TrendingFacetsQuery from algoliasearch.recommend.models.trending_items_query import TrendingItemsQuery @@ -43,12 +40,9 @@ class RecommendationsRequest(BaseModel): oneof_schema_5_validator: Optional[LookingSimilarQuery] = Field(default=None) - oneof_schema_6_validator: Optional[RecommendedForYouQuery] = Field(default=None) - actual_instance: Union[ BoughtTogetherQuery, LookingSimilarQuery, - RecommendedForYouQuery, RelatedQuery, TrendingFacetsQuery, TrendingItemsQuery, @@ -57,7 +51,6 @@ class RecommendationsRequest(BaseModel): one_of_schemas: Set[str] = { "BoughtTogetherQuery", "LookingSimilarQuery", - "RecommendedForYouQuery", "RelatedQuery", "TrendingFacetsQuery", "TrendingItemsQuery", @@ -83,7 +76,6 @@ def unwrap_actual_instance( ) -> Union[ BoughtTogetherQuery, LookingSimilarQuery, - RecommendedForYouQuery, RelatedQuery, TrendingFacetsQuery, TrendingItemsQuery, @@ -133,18 +125,12 @@ def from_json(cls, json_str: str) -> Self: try: instance.actual_instance = LookingSimilarQuery.from_json(json_str) - return instance - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - try: - instance.actual_instance = RecommendedForYouQuery.from_json(json_str) - return instance except (ValidationError, ValueError) as e: error_messages.append(str(e)) raise ValueError( - "No match found when deserializing the JSON string into RecommendationsRequest with oneOf schemas: BoughtTogetherQuery, LookingSimilarQuery, RecommendedForYouQuery, RelatedQuery, TrendingFacetsQuery, TrendingItemsQuery. Details: " + "No match found when deserializing the JSON string into RecommendationsRequest with oneOf schemas: BoughtTogetherQuery, LookingSimilarQuery, RelatedQuery, TrendingFacetsQuery, TrendingItemsQuery. Details: " + ", ".join(error_messages) ) @@ -167,7 +153,6 @@ def to_dict( Dict[str, Any], BoughtTogetherQuery, LookingSimilarQuery, - RecommendedForYouQuery, RelatedQuery, TrendingFacetsQuery, TrendingItemsQuery, diff --git a/clients/algoliasearch-client-python/algoliasearch/recommend/models/recommended_for_you_model.py b/clients/algoliasearch-client-python/algoliasearch/recommend/models/recommended_for_you_model.py deleted file mode 100644 index 51d52fb1e8..0000000000 --- a/clients/algoliasearch-client-python/algoliasearch/recommend/models/recommended_for_you_model.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding: utf-8 - -""" -Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -""" - -from __future__ import annotations - -from enum import Enum -from json import loads -from sys import version_info - -if version_info >= (3, 11): - from typing import Self -else: - from typing_extensions import Self - - -class RecommendedForYouModel(str, Enum): - """ - \"Recommened for you\" model. - """ - - """ - allowed enum values - """ - RECOMMENDED_FOR_YOU = "recommended-for-you" - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of RecommendedForYouModel from a JSON string""" - return cls(loads(json_str)) diff --git a/clients/algoliasearch-client-python/algoliasearch/recommend/models/recommended_for_you_query.py b/clients/algoliasearch-client-python/algoliasearch/recommend/models/recommended_for_you_query.py deleted file mode 100644 index 5ff7470c31..0000000000 --- a/clients/algoliasearch-client-python/algoliasearch/recommend/models/recommended_for_you_query.py +++ /dev/null @@ -1,101 +0,0 @@ -# coding: utf-8 - -""" -Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -""" - -from __future__ import annotations - -from json import loads -from sys import version_info -from typing import Any, Dict, Optional - -from pydantic import BaseModel, ConfigDict - -if version_info >= (3, 11): - from typing import Self -else: - from typing_extensions import Self - - -from algoliasearch.recommend.models.fallback_params import FallbackParams -from algoliasearch.recommend.models.recommend_search_params import RecommendSearchParams -from algoliasearch.recommend.models.recommended_for_you_model import ( - RecommendedForYouModel, -) - -_ALIASES = { - "index_name": "indexName", - "threshold": "threshold", - "max_recommendations": "maxRecommendations", - "query_parameters": "queryParameters", - "model": "model", - "fallback_parameters": "fallbackParameters", -} - - -def _alias_generator(name: str) -> str: - return _ALIASES.get(name, name) - - -class RecommendedForYouQuery(BaseModel): - """ - RecommendedForYouQuery - """ - - index_name: str - """ Index name (case-sensitive). """ - threshold: float - """ Minimum score a recommendation must have to be included in the response. """ - max_recommendations: Optional[int] = None - """ Maximum number of recommendations to retrieve. By default, all recommendations are returned and no fallback request is made. Depending on the available recommendations and the other request parameters, the actual number of recommendations may be lower than this value. """ - query_parameters: Optional[RecommendSearchParams] = None - model: RecommendedForYouModel - fallback_parameters: Optional[FallbackParams] = None - - model_config = ConfigDict( - use_enum_values=True, - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - alias_generator=_alias_generator, - ) - - def to_json(self) -> str: - return self.model_dump_json(by_alias=True, exclude_unset=True) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of RecommendedForYouQuery from a JSON string""" - return cls.from_dict(loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias.""" - return self.model_dump( - by_alias=True, - exclude_none=True, - exclude_unset=True, - ) - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of RecommendedForYouQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - obj["queryParameters"] = ( - RecommendSearchParams.from_dict(obj["queryParameters"]) - if obj.get("queryParameters") is not None - else None - ) - obj["model"] = obj.get("model") - obj["fallbackParameters"] = ( - FallbackParams.from_dict(obj["fallbackParameters"]) - if obj.get("fallbackParameters") is not None - else None - ) - - return cls.model_validate(obj) diff --git a/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/recommendations_request.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/recommendations_request.rb index b8b34ef228..c594b6d4eb 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/recommendations_request.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/recommendations_request.rb @@ -12,7 +12,6 @@ def openapi_one_of [ :"BoughtTogetherQuery", :"LookingSimilarQuery", - :"RecommendedForYouQuery", :"RelatedQuery", :"TrendingFacetsQuery", :"TrendingItemsQuery" diff --git a/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/recommended_for_you_model.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/recommended_for_you_model.rb deleted file mode 100644 index e864e46a26..0000000000 --- a/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/recommended_for_you_model.rb +++ /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. - -require "date" -require "time" - -module Algolia - module Recommend - class RecommendedForYouModel - RECOMMENDED_FOR_YOU = "recommended-for-you".freeze - - def self.all_vars - @all_vars ||= [RECOMMENDED_FOR_YOU].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if RecommendedForYouModel.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #RecommendedForYouModel" - end - end - end -end diff --git a/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/recommended_for_you_query.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/recommended_for_you_query.rb deleted file mode 100644 index f1e899e1d7..0000000000 --- a/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/recommended_for_you_query.rb +++ /dev/null @@ -1,273 +0,0 @@ -# Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -require "date" -require "time" - -module Algolia - module Recommend - class RecommendedForYouQuery - # Index name (case-sensitive). - attr_accessor :index_name - - # Minimum score a recommendation must have to be included in the response. - attr_accessor :threshold - - # Maximum number of recommendations to retrieve. By default, all recommendations are returned and no fallback request is made. Depending on the available recommendations and the other request parameters, the actual number of recommendations may be lower than this value. - attr_accessor :max_recommendations - - attr_accessor :query_parameters - - attr_accessor :model - - attr_accessor :fallback_parameters - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :index_name => :indexName, - :threshold => :threshold, - :max_recommendations => :maxRecommendations, - :query_parameters => :queryParameters, - :model => :model, - :fallback_parameters => :fallbackParameters - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.types_mapping - { - :index_name => :"String", - :threshold => :"Float", - :max_recommendations => :"Integer", - :query_parameters => :"RecommendSearchParams", - :model => :"RecommendedForYouModel", - :fallback_parameters => :"FallbackParams" - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new( - [] - ) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :"BaseRecommendRequest", - :"RecommendedForYou" - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - raise( - ArgumentError, - "The input argument (attributes) must be a hash in `Algolia::RecommendedForYouQuery` initialize method" - ) - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - raise( - ArgumentError, - "`#{k}` is not a valid attribute in `Algolia::RecommendedForYouQuery`. Please check the name to make sure it's valid. List of attributes: " + - self.class.attribute_map.keys.inspect - ) - end - - h[k.to_sym] = v - } - - if attributes.key?(:index_name) - self.index_name = attributes[:index_name] - else - self.index_name = nil - end - - if attributes.key?(:threshold) - self.threshold = attributes[:threshold] - else - self.threshold = nil - end - - if attributes.key?(:max_recommendations) - self.max_recommendations = attributes[:max_recommendations] - end - - if attributes.key?(:query_parameters) - self.query_parameters = attributes[:query_parameters] - end - - if attributes.key?(:model) - self.model = attributes[:model] - else - self.model = nil - end - - if attributes.key?(:fallback_parameters) - self.fallback_parameters = attributes[:fallback_parameters] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(other) - return true if self.equal?(other) - self.class == other.class && - index_name == other.index_name && - threshold == other.threshold && - max_recommendations == other.max_recommendations && - query_parameters == other.query_parameters && - model == other.model && - fallback_parameters == other.fallback_parameters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(other) - self == other - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [index_name, threshold, max_recommendations, query_parameters, model, fallback_parameters].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - types_mapping.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash[key.to_sym] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v| - _deserialize(::Regexp.last_match(1), v) - } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]]) - end - end - - new(transformed_hash) - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - # model - else - # models (e.g. Pet) or oneOf - klass = Algolia::Recommend.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass - .build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - def to_json(*_args) - to_hash.to_json - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to?(:to_hash) - value.to_hash - else - value - end - end - - end - - end -end diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/JsonSupport.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/JsonSupport.scala index c747a930b2..c04b09dca3 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/JsonSupport.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/JsonSupport.scala @@ -43,7 +43,6 @@ object JsonSupport { new MatchLevelSerializer() :+ new QueryTypeSerializer() :+ new RecommendModelsSerializer() :+ - new RecommendedForYouModelSerializer() :+ new RelatedModelSerializer() :+ new RemoveWordsIfNoResultsSerializer() :+ new SortRemainingBySerializer() :+ diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendationsRequest.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendationsRequest.scala index 87e98a18e5..fb01a74620 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendationsRequest.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendationsRequest.scala @@ -29,7 +29,7 @@ */ package algoliasearch.recommend -import algoliasearch.recommend.RecommendedForYouModel._ +import algoliasearch.recommend.LookingSimilarModel._ import org.json4s._ @@ -51,7 +51,6 @@ object RecommendationsRequestSerializer extends Serializer[RecommendationsReques case value: JObject => Extraction.extract[TrendingItemsQuery](value) case value: JObject => Extraction.extract[TrendingFacetsQuery](value) case value: JObject => Extraction.extract[LookingSimilarQuery](value) - case value: JObject => Extraction.extract[RecommendedForYouQuery](value) case _ => throw new MappingException("Can't convert " + json + " to RecommendationsRequest") } } @@ -59,12 +58,11 @@ object RecommendationsRequestSerializer extends Serializer[RecommendationsReques override def serialize(implicit format: Formats): PartialFunction[Any, JValue] = { case value: RecommendationsRequest => value match { - case value: BoughtTogetherQuery => Extraction.decompose(value)(format - this) - case value: RelatedQuery => Extraction.decompose(value)(format - this) - case value: TrendingItemsQuery => Extraction.decompose(value)(format - this) - case value: TrendingFacetsQuery => Extraction.decompose(value)(format - this) - case value: LookingSimilarQuery => Extraction.decompose(value)(format - this) - case value: RecommendedForYouQuery => Extraction.decompose(value)(format - this) + case value: BoughtTogetherQuery => Extraction.decompose(value)(format - this) + case value: RelatedQuery => Extraction.decompose(value)(format - this) + case value: TrendingItemsQuery => Extraction.decompose(value)(format - this) + case value: TrendingFacetsQuery => Extraction.decompose(value)(format - this) + case value: LookingSimilarQuery => Extraction.decompose(value)(format - this) } } } diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendedForYou.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendedForYou.scala deleted file mode 100644 index 8445f374a3..0000000000 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendedForYou.scala +++ /dev/null @@ -1,39 +0,0 @@ -/** Recommend API The Recommend API lets you retrieve recommendations from one of Algolia's AI recommendation models - * that you previously trained on your data. ## Client libraries Use Algolia's API clients and libraries to reliably - * integrate Algolia's APIs with your apps. The official API clients are covered by Algolia's [Service Level - * Agreement](https://www.algolia.com/policies/sla/). See: [Algolia's - * ecosystem](https://www.algolia.com/doc/guides/getting-started/how-algolia-works/in-depth/ecosystem/) ## Base URLs - * The base URLs for requests to the Recommend API are: - `https://{APPLICATION_ID}.algolia.net` - - * `https://{APPLICATION_ID}-dsn.algolia.net`. If your subscription includes a [Distributed Search - * Network](https://dashboard.algolia.com/infra), this ensures that requests are sent to servers closest to users. Both - * URLs provide high availability by distributing requests with load balancing. **All requests must use HTTPS.** ## - * Retry strategy To guarantee a high availability, implement a retry strategy for all API requests using the URLs of - * your servers as fallbacks: - `https://{APPLICATION_ID}-1.algolianet.com` - - * `https://{APPLICATION_ID}-2.algolianet.com` - `https://{APPLICATION_ID}-3.algolianet.com` These URLs use a different - * DNS provider than the primary URLs. You should randomize this list to ensure an even load across the three servers. - * All Algolia API clients implement this retry strategy. ## Authentication To authenticate your API requests, add - * these headers: - `x-algolia-application-id`. Your Algolia application ID. - `x-algolia-api-key`. An API key with the - * necessary permissions to make the request. The required access control list (ACL) to make a request is listed in - * each endpoint's reference. You can find your application ID and API key in the [Algolia - * dashboard](https://dashboard.algolia.com/account). ## Request format Request bodies must be JSON objects. ## - * Response status and errors The Recommend API returns JSON responses. Since JSON doesn't guarantee any specific - * ordering, don't rely on the order of attributes in the API response. Successful responses return a `2xx` status. - * Client errors return a `4xx` status. Server errors are indicated by a `5xx` status. Error responses have a `message` - * property with more information. ## Version The current version of the Recommend API is version 1, as indicated by - * the `/1/` in each endpoint's URL. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech Do not edit the class manually. - */ -package algoliasearch.recommend - -import algoliasearch.recommend.RecommendedForYouModel._ - -/** RecommendedForYou - */ -case class RecommendedForYou( - model: RecommendedForYouModel, - fallbackParameters: Option[FallbackParams] = scala.None -) diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendedForYouModel.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendedForYouModel.scala deleted file mode 100644 index 67462cc65c..0000000000 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendedForYouModel.scala +++ /dev/null @@ -1,60 +0,0 @@ -/** Recommend API The Recommend API lets you retrieve recommendations from one of Algolia's AI recommendation models - * that you previously trained on your data. ## Client libraries Use Algolia's API clients and libraries to reliably - * integrate Algolia's APIs with your apps. The official API clients are covered by Algolia's [Service Level - * Agreement](https://www.algolia.com/policies/sla/). See: [Algolia's - * ecosystem](https://www.algolia.com/doc/guides/getting-started/how-algolia-works/in-depth/ecosystem/) ## Base URLs - * The base URLs for requests to the Recommend API are: - `https://{APPLICATION_ID}.algolia.net` - - * `https://{APPLICATION_ID}-dsn.algolia.net`. If your subscription includes a [Distributed Search - * Network](https://dashboard.algolia.com/infra), this ensures that requests are sent to servers closest to users. Both - * URLs provide high availability by distributing requests with load balancing. **All requests must use HTTPS.** ## - * Retry strategy To guarantee a high availability, implement a retry strategy for all API requests using the URLs of - * your servers as fallbacks: - `https://{APPLICATION_ID}-1.algolianet.com` - - * `https://{APPLICATION_ID}-2.algolianet.com` - `https://{APPLICATION_ID}-3.algolianet.com` These URLs use a different - * DNS provider than the primary URLs. You should randomize this list to ensure an even load across the three servers. - * All Algolia API clients implement this retry strategy. ## Authentication To authenticate your API requests, add - * these headers: - `x-algolia-application-id`. Your Algolia application ID. - `x-algolia-api-key`. An API key with the - * necessary permissions to make the request. The required access control list (ACL) to make a request is listed in - * each endpoint's reference. You can find your application ID and API key in the [Algolia - * dashboard](https://dashboard.algolia.com/account). ## Request format Request bodies must be JSON objects. ## - * Response status and errors The Recommend API returns JSON responses. Since JSON doesn't guarantee any specific - * ordering, don't rely on the order of attributes in the API response. Successful responses return a `2xx` status. - * Client errors return a `4xx` status. Server errors are indicated by a `5xx` status. Error responses have a `message` - * property with more information. ## Version The current version of the Recommend API is version 1, as indicated by - * the `/1/` in each endpoint's URL. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech Do not edit the class manually. - */ -package algoliasearch.recommend - -import org.json4s._ - -sealed trait RecommendedForYouModel - -/** \"Recommened for you\" model. - */ -object RecommendedForYouModel { - case object RecommendedForYou extends RecommendedForYouModel { - override def toString = "recommended-for-you" - } - val values: Seq[RecommendedForYouModel] = Seq(RecommendedForYou) - - def withName(name: String): RecommendedForYouModel = RecommendedForYouModel.values - .find(_.toString == name) - .getOrElse(throw new MappingException(s"Unknown RecommendedForYouModel value: $name")) -} - -class RecommendedForYouModelSerializer - extends CustomSerializer[RecommendedForYouModel](_ => - ( - { - case JString(value) => RecommendedForYouModel.withName(value) - case JNull => null - }, - { case value: RecommendedForYouModel => - JString(value.toString) - } - ) - ) diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendedForYouQuery.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendedForYouQuery.scala deleted file mode 100644 index c88ab8bd05..0000000000 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/RecommendedForYouQuery.scala +++ /dev/null @@ -1,52 +0,0 @@ -/** Recommend API The Recommend API lets you retrieve recommendations from one of Algolia's AI recommendation models - * that you previously trained on your data. ## Client libraries Use Algolia's API clients and libraries to reliably - * integrate Algolia's APIs with your apps. The official API clients are covered by Algolia's [Service Level - * Agreement](https://www.algolia.com/policies/sla/). See: [Algolia's - * ecosystem](https://www.algolia.com/doc/guides/getting-started/how-algolia-works/in-depth/ecosystem/) ## Base URLs - * The base URLs for requests to the Recommend API are: - `https://{APPLICATION_ID}.algolia.net` - - * `https://{APPLICATION_ID}-dsn.algolia.net`. If your subscription includes a [Distributed Search - * Network](https://dashboard.algolia.com/infra), this ensures that requests are sent to servers closest to users. Both - * URLs provide high availability by distributing requests with load balancing. **All requests must use HTTPS.** ## - * Retry strategy To guarantee a high availability, implement a retry strategy for all API requests using the URLs of - * your servers as fallbacks: - `https://{APPLICATION_ID}-1.algolianet.com` - - * `https://{APPLICATION_ID}-2.algolianet.com` - `https://{APPLICATION_ID}-3.algolianet.com` These URLs use a different - * DNS provider than the primary URLs. You should randomize this list to ensure an even load across the three servers. - * All Algolia API clients implement this retry strategy. ## Authentication To authenticate your API requests, add - * these headers: - `x-algolia-application-id`. Your Algolia application ID. - `x-algolia-api-key`. An API key with the - * necessary permissions to make the request. The required access control list (ACL) to make a request is listed in - * each endpoint's reference. You can find your application ID and API key in the [Algolia - * dashboard](https://dashboard.algolia.com/account). ## Request format Request bodies must be JSON objects. ## - * Response status and errors The Recommend API returns JSON responses. Since JSON doesn't guarantee any specific - * ordering, don't rely on the order of attributes in the API response. Successful responses return a `2xx` status. - * Client errors return a `4xx` status. Server errors are indicated by a `5xx` status. Error responses have a `message` - * property with more information. ## Version The current version of the Recommend API is version 1, as indicated by - * the `/1/` in each endpoint's URL. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech Do not edit the class manually. - */ -package algoliasearch.recommend - -import algoliasearch.recommend.RecommendedForYouModel._ - -/** RecommendedForYouQuery - * - * @param indexName - * Index name (case-sensitive). - * @param threshold - * Minimum score a recommendation must have to be included in the response. - * @param maxRecommendations - * Maximum number of recommendations to retrieve. By default, all recommendations are returned and no fallback - * request is made. Depending on the available recommendations and the other request parameters, the actual number of - * recommendations may be lower than this value. - */ -case class RecommendedForYouQuery( - indexName: String, - threshold: Double, - maxRecommendations: Option[Int] = scala.None, - queryParameters: Option[RecommendSearchParams] = scala.None, - model: RecommendedForYouModel, - fallbackParameters: Option[FallbackParams] = scala.None -) extends RecommendationsRequestTrait diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsRequest.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsRequest.swift index 1b24bad099..0b042587e3 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsRequest.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsRequest.swift @@ -12,7 +12,6 @@ public enum RecommendationsRequest: Codable, JSONEncodable, AbstractEncodable { case trendingItemsQuery(TrendingItemsQuery) case trendingFacetsQuery(TrendingFacetsQuery) case lookingSimilarQuery(LookingSimilarQuery) - case recommendedForYouQuery(RecommendedForYouQuery) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() @@ -27,8 +26,6 @@ public enum RecommendationsRequest: Codable, JSONEncodable, AbstractEncodable { try container.encode(value) case let .lookingSimilarQuery(value): try container.encode(value) - case let .recommendedForYouQuery(value): - try container.encode(value) } } @@ -44,8 +41,6 @@ public enum RecommendationsRequest: Codable, JSONEncodable, AbstractEncodable { self = .trendingFacetsQuery(value) } else if let value = try? container.decode(LookingSimilarQuery.self) { self = .lookingSimilarQuery(value) - } else if let value = try? container.decode(RecommendedForYouQuery.self) { - self = .recommendedForYouQuery(value) } else { throw DecodingError.typeMismatch( Self.Type.self, @@ -69,8 +64,6 @@ public enum RecommendationsRequest: Codable, JSONEncodable, AbstractEncodable { value as TrendingFacetsQuery case let .lookingSimilarQuery(value): value as LookingSimilarQuery - case let .recommendedForYouQuery(value): - value as RecommendedForYouQuery } } } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYou.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYou.swift deleted file mode 100644 index 49e225cc99..0000000000 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYou.swift +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by 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 Foundation -#if canImport(Core) - import Core -#endif - -public struct RecommendedForYou: Codable, JSONEncodable { - public var model: RecommendedForYouModel - public var fallbackParameters: FallbackParams? - - public init(model: RecommendedForYouModel, fallbackParameters: FallbackParams? = nil) { - self.model = model - self.fallbackParameters = fallbackParameters - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case model - case fallbackParameters - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode(self.model, forKey: .model) - try container.encodeIfPresent(self.fallbackParameters, forKey: .fallbackParameters) - } -} - -extension RecommendedForYou: Equatable { - public static func ==(lhs: RecommendedForYou, rhs: RecommendedForYou) -> Bool { - lhs.model == rhs.model && - lhs.fallbackParameters == rhs.fallbackParameters - } -} - -extension RecommendedForYou: Hashable { - public func hash(into hasher: inout Hasher) { - hasher.combine(self.model.hashValue) - hasher.combine(self.fallbackParameters?.hashValue) - } -} diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYouModel.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYouModel.swift deleted file mode 100644 index af7afe8fd4..0000000000 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYouModel.swift +++ /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 Foundation -#if canImport(Core) - import Core -#endif - -/// \"Recommened for you\" model. -public enum RecommendedForYouModel: String, Codable, CaseIterable { - case recommendedForYou = "recommended-for-you" -} - -extension RecommendedForYouModel: Hashable {} diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYouQuery.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYouQuery.swift deleted file mode 100644 index 8fa9ddbc3c..0000000000 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYouQuery.swift +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by 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 Foundation -#if canImport(Core) - import Core -#endif - -public struct RecommendedForYouQuery: Codable, JSONEncodable { - /// Index name (case-sensitive). - public var indexName: String - /// Minimum score a recommendation must have to be included in the response. - public var threshold: Double - /// Maximum number of recommendations to retrieve. By default, all recommendations are returned and no fallback - /// request is made. Depending on the available recommendations and the other request parameters, the actual number - /// of recommendations may be lower than this value. - public var maxRecommendations: Int? - public var queryParameters: RecommendSearchParams? - public var model: RecommendedForYouModel - public var fallbackParameters: FallbackParams? - - public init( - indexName: String, - threshold: Double, - maxRecommendations: Int? = nil, - queryParameters: RecommendSearchParams? = nil, - model: RecommendedForYouModel, - fallbackParameters: FallbackParams? = nil - ) { - self.indexName = indexName - self.threshold = threshold - self.maxRecommendations = maxRecommendations - self.queryParameters = queryParameters - self.model = model - self.fallbackParameters = fallbackParameters - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case indexName - case threshold - case maxRecommendations - case queryParameters - case model - case fallbackParameters - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode(self.indexName, forKey: .indexName) - try container.encode(self.threshold, forKey: .threshold) - try container.encodeIfPresent(self.maxRecommendations, forKey: .maxRecommendations) - try container.encodeIfPresent(self.queryParameters, forKey: .queryParameters) - try container.encode(self.model, forKey: .model) - try container.encodeIfPresent(self.fallbackParameters, forKey: .fallbackParameters) - } -} - -extension RecommendedForYouQuery: Equatable { - public static func ==(lhs: RecommendedForYouQuery, rhs: RecommendedForYouQuery) -> Bool { - lhs.indexName == rhs.indexName && - lhs.threshold == rhs.threshold && - lhs.maxRecommendations == rhs.maxRecommendations && - lhs.queryParameters == rhs.queryParameters && - lhs.model == rhs.model && - lhs.fallbackParameters == rhs.fallbackParameters - } -} - -extension RecommendedForYouQuery: Hashable { - public func hash(into hasher: inout Hasher) { - hasher.combine(self.indexName.hashValue) - hasher.combine(self.threshold.hashValue) - hasher.combine(self.maxRecommendations?.hashValue) - hasher.combine(self.queryParameters?.hashValue) - hasher.combine(self.model.hashValue) - hasher.combine(self.fallbackParameters?.hashValue) - } -} diff --git a/specs/bundled/algoliasearch.yml b/specs/bundled/algoliasearch.yml index bcfed1febe..84a9742442 100644 --- a/specs/bundled/algoliasearch.yml +++ b/specs/bundled/algoliasearch.yml @@ -4754,26 +4754,6 @@ components: allOf: - $ref: '#/components/schemas/baseRecommendRequest' - $ref: '#/components/schemas/lookingSimilar' - recommendedForYouModel: - type: string - description: | - "Recommened for you" model. - enum: - - recommended-for-you - recommendedForYou: - type: object - properties: - model: - $ref: '#/components/schemas/recommendedForYouModel' - fallbackParameters: - $ref: '#/components/schemas/fallbackParams' - required: - - model - recommendedForYouQuery: - title: Recommended for you - allOf: - - $ref: '#/components/schemas/baseRecommendRequest' - - $ref: '#/components/schemas/recommendedForYou' recommendationsRequest: oneOf: - $ref: '#/components/schemas/boughtTogetherQuery' @@ -4781,7 +4761,6 @@ components: - $ref: '#/components/schemas/trendingItemsQuery' - $ref: '#/components/schemas/trendingFacetsQuery' - $ref: '#/components/schemas/lookingSimilarQuery' - - $ref: '#/components/schemas/recommendedForYouQuery' recommendScore: type: number format: double diff --git a/specs/bundled/recommend.doc.yml b/specs/bundled/recommend.doc.yml index f489f365f0..b6ffdd735b 100644 --- a/specs/bundled/recommend.doc.yml +++ b/specs/bundled/recommend.doc.yml @@ -5151,26 +5151,6 @@ components: allOf: - $ref: '#/components/schemas/baseRecommendRequest' - $ref: '#/components/schemas/lookingSimilar' - recommendedForYouModel: - type: string - description: | - "Recommened for you" model. - enum: - - recommended-for-you - recommendedForYou: - type: object - properties: - model: - $ref: '#/components/schemas/recommendedForYouModel' - fallbackParameters: - $ref: '#/components/schemas/fallbackParams' - required: - - model - recommendedForYouQuery: - title: Recommended for you - allOf: - - $ref: '#/components/schemas/baseRecommendRequest' - - $ref: '#/components/schemas/recommendedForYou' recommendationsRequest: oneOf: - $ref: '#/components/schemas/boughtTogetherQuery' @@ -5178,7 +5158,6 @@ components: - $ref: '#/components/schemas/trendingItemsQuery' - $ref: '#/components/schemas/trendingFacetsQuery' - $ref: '#/components/schemas/lookingSimilarQuery' - - $ref: '#/components/schemas/recommendedForYouQuery' processingTimeMS: type: integer description: Time the server took to process the request, in milliseconds. diff --git a/specs/bundled/recommend.yml b/specs/bundled/recommend.yml index 551a3757e4..1ea9fb727f 100644 --- a/specs/bundled/recommend.yml +++ b/specs/bundled/recommend.yml @@ -3057,26 +3057,6 @@ components: allOf: - $ref: '#/components/schemas/baseRecommendRequest' - $ref: '#/components/schemas/lookingSimilar' - recommendedForYouModel: - type: string - description: | - "Recommened for you" model. - enum: - - recommended-for-you - recommendedForYou: - type: object - properties: - model: - $ref: '#/components/schemas/recommendedForYouModel' - fallbackParameters: - $ref: '#/components/schemas/fallbackParams' - required: - - model - recommendedForYouQuery: - title: Recommended for you - allOf: - - $ref: '#/components/schemas/baseRecommendRequest' - - $ref: '#/components/schemas/recommendedForYou' recommendationsRequest: oneOf: - $ref: '#/components/schemas/boughtTogetherQuery' @@ -3084,7 +3064,6 @@ components: - $ref: '#/components/schemas/trendingItemsQuery' - $ref: '#/components/schemas/trendingFacetsQuery' - $ref: '#/components/schemas/lookingSimilarQuery' - - $ref: '#/components/schemas/recommendedForYouQuery' processingTimeMS: type: integer description: Time the server took to process the request, in milliseconds.