From e094effed07aebf0b05b470ac8a9428b1919c199 Mon Sep 17 00:00:00 2001 From: algolia-bot Date: Thu, 10 Oct 2024 10:42:36 +0000 Subject: [PATCH] fix(specs): correct type for banners [skip-bc] (#3939) (generated) [skip ci] Co-authored-by: Pierre Millot --- .../Models/Recommend/BannerImage.cs | 4 +- .../algoliasearch/Models/Recommend/Banners.cs | 88 ------- .../algoliasearch/Models/Recommend/Widgets.cs | 7 +- .../Models/Search/BannerImage.cs | 4 +- .../algoliasearch/Models/Search/Banners.cs | 88 ------- .../algoliasearch/Models/Search/Widgets.cs | 7 +- .../algoliasearch/lib/algoliasearch_lite.dart | 1 - .../algoliasearch/lib/src/deserialize.dart | 3 - .../lib/src/model/banner_image.dart | 2 +- .../lib/src/model/banner_image.g.dart | 9 +- .../algoliasearch/lib/src/model/banners.dart | 35 --- .../lib/src/model/banners.g.dart | 35 --- .../algoliasearch/lib/src/model/widgets.dart | 5 +- .../lib/src/model/widgets.g.dart | 8 +- .../lib/algolia_client_recommend.dart | 1 - .../client_recommend/lib/src/deserialize.dart | 3 - .../lib/src/model/banner_image.dart | 2 +- .../lib/src/model/banner_image.g.dart | 9 +- .../lib/src/model/banners.dart | 35 --- .../lib/src/model/banners.g.dart | 35 --- .../lib/src/model/widgets.dart | 5 +- .../lib/src/model/widgets.g.dart | 8 +- .../lib/algolia_client_search.dart | 1 - .../client_search/lib/src/deserialize.dart | 3 - .../lib/src/model/banner_image.dart | 2 +- .../lib/src/model/banner_image.g.dart | 9 +- .../client_search/lib/src/model/banners.dart | 35 --- .../lib/src/model/banners.g.dart | 35 --- .../client_search/lib/src/model/widgets.dart | 5 +- .../lib/src/model/widgets.g.dart | 8 +- .../algolia/recommend/model_banner_image.go | 20 +- .../algolia/recommend/model_banners.go | 89 ------- .../algolia/recommend/model_widgets.go | 19 +- .../algolia/search/model_banner_image.go | 20 +- .../algolia/search/model_banners.go | 89 ------- .../algolia/search/model_widgets.go | 19 +- .../algolia/model/recommend/BannerImage.java | 16 +- .../com/algolia/model/recommend/Banners.java | 62 ----- .../com/algolia/model/recommend/Widgets.java | 18 +- .../com/algolia/model/search/BannerImage.java | 16 +- .../com/algolia/model/search/Banners.java | 62 ----- .../com/algolia/model/search/Widgets.java | 18 +- .../packages/algoliasearch/builds/models.ts | 2 - .../algoliasearch/lite/model/bannerImage.ts | 2 +- .../algoliasearch/lite/model/banners.ts | 10 - .../algoliasearch/lite/model/index.ts | 1 - .../algoliasearch/lite/model/widgets.ts | 7 +- .../client-search/model/bannerImage.ts | 2 +- .../packages/client-search/model/banners.ts | 10 - .../packages/client-search/model/index.ts | 1 - .../packages/client-search/model/widgets.ts | 7 +- .../packages/recommend/model/bannerImage.ts | 2 +- .../packages/recommend/model/banners.ts | 10 - .../packages/recommend/model/index.ts | 1 - .../packages/recommend/model/widgets.ts | 7 +- .../client/model/recommend/BannerImage.kt | 2 +- .../algolia/client/model/recommend/Banners.kt | 16 -- .../algolia/client/model/recommend/Widgets.kt | 5 +- .../client/model/search/BannerImage.kt | 2 +- .../algolia/client/model/search/Banners.kt | 16 -- .../algolia/client/model/search/Widgets.kt | 5 +- .../lib/Model/Recommend/BannerImage.php | 6 +- .../lib/Model/Recommend/Banners.php | 226 ------------------ .../lib/Model/Recommend/Widgets.php | 6 +- .../lib/Model/Search/BannerImage.php | 6 +- .../lib/Model/Search/Banners.php | 226 ------------------ .../lib/Model/Search/Widgets.php | 6 +- .../recommend/models/banner_image.py | 6 +- .../algoliasearch/recommend/models/banners.py | 76 ------ .../algoliasearch/recommend/models/widgets.py | 9 +- .../search/models/banner_image.py | 6 +- .../algoliasearch/search/models/banners.py | 76 ------ .../algoliasearch/search/models/widgets.py | 9 +- .../algolia/models/recommend/banner_image.rb | 6 +- .../lib/algolia/models/recommend/banners.rb | 209 ---------------- .../lib/algolia/models/recommend/widgets.rb | 7 +- .../lib/algolia/models/search/banner_image.rb | 6 +- .../lib/algolia/models/search/banners.rb | 209 ---------------- .../lib/algolia/models/search/widgets.rb | 7 +- .../algoliasearch/recommend/BannerImage.scala | 2 +- .../algoliasearch/recommend/Banners.scala | 36 --- .../algoliasearch/recommend/Widgets.scala | 5 +- .../algoliasearch/search/BannerImage.scala | 2 +- .../scala/algoliasearch/search/Banners.scala | 40 ---- .../scala/algoliasearch/search/Widgets.scala | 5 +- .../Models/RecommendBannerImage.swift | 4 +- .../Recommend/Models/RecommendBanners.swift | 39 --- .../Recommend/Models/RecommendWidgets.swift | 5 +- .../Search/Models/SearchBannerImage.swift | 4 +- .../Sources/Search/Models/SearchBanners.swift | 39 --- .../Sources/Search/Models/SearchWidgets.swift | 5 +- specs/bundled/algoliasearch.yml | 11 +- specs/bundled/crawler.doc.yml | 11 +- specs/bundled/crawler.yml | 11 +- specs/bundled/recommend.doc.yml | 13 +- specs/bundled/recommend.yml | 11 +- specs/bundled/search.doc.yml | 13 +- specs/bundled/search.yml | 11 +- 98 files changed, 281 insertions(+), 2136 deletions(-) delete mode 100644 clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/Banners.cs delete mode 100644 clients/algoliasearch-client-csharp/algoliasearch/Models/Search/Banners.cs delete mode 100644 clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/banners.dart delete mode 100644 clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/banners.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/banners.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/banners.g.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_search/lib/src/model/banners.dart delete mode 100644 clients/algoliasearch-client-dart/packages/client_search/lib/src/model/banners.g.dart delete mode 100644 clients/algoliasearch-client-go/algolia/recommend/model_banners.go delete mode 100644 clients/algoliasearch-client-go/algolia/search/model_banners.go delete mode 100644 clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/Banners.java delete mode 100644 clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/Banners.java delete mode 100644 clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/banners.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/client-search/model/banners.ts delete mode 100644 clients/algoliasearch-client-javascript/packages/recommend/model/banners.ts delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/Banners.kt delete mode 100644 clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/Banners.kt delete mode 100644 clients/algoliasearch-client-php/lib/Model/Recommend/Banners.php delete mode 100644 clients/algoliasearch-client-php/lib/Model/Search/Banners.php delete mode 100644 clients/algoliasearch-client-python/algoliasearch/recommend/models/banners.py delete mode 100644 clients/algoliasearch-client-python/algoliasearch/search/models/banners.py delete mode 100644 clients/algoliasearch-client-ruby/lib/algolia/models/recommend/banners.rb delete mode 100644 clients/algoliasearch-client-ruby/lib/algolia/models/search/banners.rb delete mode 100644 clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/Banners.scala delete mode 100644 clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/Banners.scala delete mode 100644 clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendBanners.swift delete mode 100644 clients/algoliasearch-client-swift/Sources/Search/Models/SearchBanners.swift diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/BannerImage.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/BannerImage.cs index 07bad83975..022e124d9f 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/BannerImage.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/BannerImage.cs @@ -27,7 +27,7 @@ public BannerImage() /// Gets or Sets Urls /// [JsonPropertyName("urls")] - public BannerImageUrl Urls { get; set; } + public List Urls { get; set; } /// /// Gets or Sets Title @@ -71,7 +71,7 @@ public override bool Equals(object obj) } return - (Urls == input.Urls || (Urls != null && Urls.Equals(input.Urls))) && + (Urls == input.Urls || Urls != null && input.Urls != null && Urls.SequenceEqual(input.Urls)) && (Title == input.Title || (Title != null && Title.Equals(input.Title))); } diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/Banners.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/Banners.cs deleted file mode 100644 index c74d1b4b3a..0000000000 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/Banners.cs +++ /dev/null @@ -1,88 +0,0 @@ -// -// Code generated by 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; - -/// -/// banners defined in the merchandising studio for the given search. -/// -public partial class Banners -{ - /// - /// Initializes a new instance of the Banners class. - /// - public Banners() - { - } - - /// - /// Gets or Sets VarBanners - /// - [JsonPropertyName("banners")] - public Banner VarBanners { 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 Banners {\n"); - sb.Append(" VarBanners: ").Append(VarBanners).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 Banners input) - { - return false; - } - - return - (VarBanners == input.VarBanners || (VarBanners != null && VarBanners.Equals(input.VarBanners))); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (VarBanners != null) - { - hashCode = (hashCode * 59) + VarBanners.GetHashCode(); - } - return hashCode; - } - } - -} - diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/Widgets.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/Widgets.cs index efefce8645..2f4e2e3266 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/Widgets.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/Widgets.cs @@ -24,10 +24,11 @@ public Widgets() } /// - /// Gets or Sets Banners + /// banners defined in the merchandising studio for the given search. /// + /// banners defined in the merchandising studio for the given search. [JsonPropertyName("banners")] - public Banners Banners { get; set; } + public List Banners { get; set; } /// /// Returns the string presentation of the object @@ -64,7 +65,7 @@ public override bool Equals(object obj) } return - (Banners == input.Banners || (Banners != null && Banners.Equals(input.Banners))); + (Banners == input.Banners || Banners != null && input.Banners != null && Banners.SequenceEqual(input.Banners)); } /// diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/BannerImage.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/BannerImage.cs index 4a7172cf2c..9234a46992 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/BannerImage.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/BannerImage.cs @@ -27,7 +27,7 @@ public BannerImage() /// Gets or Sets Urls /// [JsonPropertyName("urls")] - public BannerImageUrl Urls { get; set; } + public List Urls { get; set; } /// /// Gets or Sets Title @@ -71,7 +71,7 @@ public override bool Equals(object obj) } return - (Urls == input.Urls || (Urls != null && Urls.Equals(input.Urls))) && + (Urls == input.Urls || Urls != null && input.Urls != null && Urls.SequenceEqual(input.Urls)) && (Title == input.Title || (Title != null && Title.Equals(input.Title))); } diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/Banners.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/Banners.cs deleted file mode 100644 index fb0ad4d6d6..0000000000 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/Banners.cs +++ /dev/null @@ -1,88 +0,0 @@ -// -// Code generated by 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.Search; - -/// -/// banners defined in the merchandising studio for the given search. -/// -public partial class Banners -{ - /// - /// Initializes a new instance of the Banners class. - /// - public Banners() - { - } - - /// - /// Gets or Sets VarBanners - /// - [JsonPropertyName("banners")] - public Banner VarBanners { 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 Banners {\n"); - sb.Append(" VarBanners: ").Append(VarBanners).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 Banners input) - { - return false; - } - - return - (VarBanners == input.VarBanners || (VarBanners != null && VarBanners.Equals(input.VarBanners))); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (VarBanners != null) - { - hashCode = (hashCode * 59) + VarBanners.GetHashCode(); - } - return hashCode; - } - } - -} - diff --git a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/Widgets.cs b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/Widgets.cs index c270edcf87..1c0b73a917 100644 --- a/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/Widgets.cs +++ b/clients/algoliasearch-client-csharp/algoliasearch/Models/Search/Widgets.cs @@ -24,10 +24,11 @@ public Widgets() } /// - /// Gets or Sets Banners + /// banners defined in the merchandising studio for the given search. /// + /// banners defined in the merchandising studio for the given search. [JsonPropertyName("banners")] - public Banners Banners { get; set; } + public List Banners { get; set; } /// /// Returns the string presentation of the object @@ -64,7 +65,7 @@ public override bool Equals(object obj) } return - (Banners == input.Banners || (Banners != null && Banners.Equals(input.Banners))); + (Banners == input.Banners || Banners != null && input.Banners != null && Banners.SequenceEqual(input.Banners)); } /// 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 fa71e4583a..143b5ba53b 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/algoliasearch_lite.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/algoliasearch_lite.dart @@ -15,7 +15,6 @@ export 'src/model/banner.dart'; export 'src/model/banner_image.dart'; export 'src/model/banner_image_url.dart'; export 'src/model/banner_link.dart'; -export 'src/model/banners.dart'; export 'src/model/base_get_api_key_response.dart'; export 'src/model/base_index_settings.dart'; export 'src/model/base_recommend_index_settings.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 da16a77248..726eea60a4 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/deserialize.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/deserialize.dart @@ -8,7 +8,6 @@ import 'package:algoliasearch/src/model/banner.dart'; import 'package:algoliasearch/src/model/banner_image.dart'; import 'package:algoliasearch/src/model/banner_image_url.dart'; import 'package:algoliasearch/src/model/banner_link.dart'; -import 'package:algoliasearch/src/model/banners.dart'; import 'package:algoliasearch/src/model/base_get_api_key_response.dart'; import 'package:algoliasearch/src/model/base_index_settings.dart'; import 'package:algoliasearch/src/model/base_recommend_index_settings.dart'; @@ -146,8 +145,6 @@ ReturnType deserialize(dynamic value, String targetType, as ReturnType; case 'BannerLink': return BannerLink.fromJson(value as Map) as ReturnType; - case 'Banners': - return Banners.fromJson(value as Map) as ReturnType; case 'BaseGetApiKeyResponse': return BaseGetApiKeyResponse.fromJson(value as Map) as ReturnType; diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/banner_image.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/banner_image.dart index 8b9ebdb875..6ce0da88b5 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/banner_image.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/banner_image.dart @@ -15,7 +15,7 @@ final class BannerImage { }); @JsonKey(name: r'urls') - final BannerImageUrl? urls; + final List? urls; @JsonKey(name: r'title') final String? title; diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/banner_image.g.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/banner_image.g.dart index 4f212baf8a..f9f50f986d 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/banner_image.g.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/banner_image.g.dart @@ -13,9 +13,10 @@ BannerImage _$BannerImageFromJson(Map json) => $checkedCreate( final val = BannerImage( urls: $checkedConvert( 'urls', - (v) => v == null - ? null - : BannerImageUrl.fromJson(v as Map)), + (v) => (v as List?) + ?.map( + (e) => BannerImageUrl.fromJson(e as Map)) + .toList()), title: $checkedConvert('title', (v) => v as String?), ); return val; @@ -31,7 +32,7 @@ Map _$BannerImageToJson(BannerImage instance) { } } - writeNotNull('urls', instance.urls?.toJson()); + writeNotNull('urls', instance.urls?.map((e) => e.toJson()).toList()); writeNotNull('title', instance.title); return val; } diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/banners.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/banners.dart deleted file mode 100644 index 6a94baf98b..0000000000 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/banners.dart +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -// ignore_for_file: unused_element -import 'package:algoliasearch/src/model/banner.dart'; - -import 'package:json_annotation/json_annotation.dart'; - -part 'banners.g.dart'; - -@JsonSerializable() -final class Banners { - /// Returns a new [Banners] instance. - const Banners({ - this.banners, - }); - - @JsonKey(name: r'banners') - final Banner? banners; - - @override - bool operator ==(Object other) => - identical(this, other) || other is Banners && other.banners == banners; - - @override - int get hashCode => banners.hashCode; - - factory Banners.fromJson(Map json) => - _$BannersFromJson(json); - - Map toJson() => _$BannersToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/banners.g.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/banners.g.dart deleted file mode 100644 index 9512578996..0000000000 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/banners.g.dart +++ /dev/null @@ -1,35 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'banners.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -Banners _$BannersFromJson(Map json) => $checkedCreate( - 'Banners', - json, - ($checkedConvert) { - final val = Banners( - banners: $checkedConvert( - 'banners', - (v) => v == null - ? null - : Banner.fromJson(v as Map)), - ); - return val; - }, - ); - -Map _$BannersToJson(Banners instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('banners', instance.banners?.toJson()); - return val; -} diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/widgets.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/widgets.dart index 8e92bd8e6c..bb7fbb291f 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/widgets.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/widgets.dart @@ -1,6 +1,6 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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/banners.dart'; +import 'package:algoliasearch/src/model/banner.dart'; import 'package:json_annotation/json_annotation.dart'; @@ -13,8 +13,9 @@ final class Widgets { this.banners, }); + /// banners defined in the merchandising studio for the given search. @JsonKey(name: r'banners') - final Banners? banners; + final List? banners; @override bool operator ==(Object other) => diff --git a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/widgets.g.dart b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/widgets.g.dart index 37719e7e60..fe50ed495b 100644 --- a/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/widgets.g.dart +++ b/clients/algoliasearch-client-dart/packages/algoliasearch/lib/src/model/widgets.g.dart @@ -13,9 +13,9 @@ Widgets _$WidgetsFromJson(Map json) => $checkedCreate( final val = Widgets( banners: $checkedConvert( 'banners', - (v) => v == null - ? null - : Banners.fromJson(v as Map)), + (v) => (v as List?) + ?.map((e) => Banner.fromJson(e as Map)) + .toList()), ); return val; }, @@ -30,6 +30,6 @@ Map _$WidgetsToJson(Widgets instance) { } } - writeNotNull('banners', instance.banners?.toJson()); + writeNotNull('banners', instance.banners?.map((e) => e.toJson()).toList()); return val; } 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 657ee14950..bb755bd48d 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 @@ -13,7 +13,6 @@ export 'src/model/banner.dart'; export 'src/model/banner_image.dart'; export 'src/model/banner_image_url.dart'; export 'src/model/banner_link.dart'; -export 'src/model/banners.dart'; export 'src/model/base_index_settings.dart'; export 'src/model/base_recommend_index_settings.dart'; export 'src/model/base_recommend_request.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 71ca83d706..fd3165dabd 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 @@ -6,7 +6,6 @@ import 'package:algolia_client_recommend/src/model/banner.dart'; import 'package:algolia_client_recommend/src/model/banner_image.dart'; import 'package:algolia_client_recommend/src/model/banner_image_url.dart'; import 'package:algolia_client_recommend/src/model/banner_link.dart'; -import 'package:algolia_client_recommend/src/model/banners.dart'; import 'package:algolia_client_recommend/src/model/base_index_settings.dart'; import 'package:algolia_client_recommend/src/model/base_recommend_index_settings.dart'; import 'package:algolia_client_recommend/src/model/base_recommend_request.dart'; @@ -120,8 +119,6 @@ ReturnType deserialize(dynamic value, String targetType, as ReturnType; case 'BannerLink': return BannerLink.fromJson(value as Map) as ReturnType; - case 'Banners': - return Banners.fromJson(value as Map) as ReturnType; case 'BaseIndexSettings': return BaseIndexSettings.fromJson(value as Map) as ReturnType; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/banner_image.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/banner_image.dart index a761e1e0a9..49a126dfad 100644 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/banner_image.dart +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/banner_image.dart @@ -15,7 +15,7 @@ final class BannerImage { }); @JsonKey(name: r'urls') - final BannerImageUrl? urls; + final List? urls; @JsonKey(name: r'title') final String? title; diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/banner_image.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/banner_image.g.dart index 4f212baf8a..f9f50f986d 100644 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/banner_image.g.dart +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/banner_image.g.dart @@ -13,9 +13,10 @@ BannerImage _$BannerImageFromJson(Map json) => $checkedCreate( final val = BannerImage( urls: $checkedConvert( 'urls', - (v) => v == null - ? null - : BannerImageUrl.fromJson(v as Map)), + (v) => (v as List?) + ?.map( + (e) => BannerImageUrl.fromJson(e as Map)) + .toList()), title: $checkedConvert('title', (v) => v as String?), ); return val; @@ -31,7 +32,7 @@ Map _$BannerImageToJson(BannerImage instance) { } } - writeNotNull('urls', instance.urls?.toJson()); + writeNotNull('urls', instance.urls?.map((e) => e.toJson()).toList()); writeNotNull('title', instance.title); return val; } diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/banners.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/banners.dart deleted file mode 100644 index 9421dee912..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/banners.dart +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -// ignore_for_file: unused_element -import 'package:algolia_client_recommend/src/model/banner.dart'; - -import 'package:json_annotation/json_annotation.dart'; - -part 'banners.g.dart'; - -@JsonSerializable() -final class Banners { - /// Returns a new [Banners] instance. - const Banners({ - this.banners, - }); - - @JsonKey(name: r'banners') - final Banner? banners; - - @override - bool operator ==(Object other) => - identical(this, other) || other is Banners && other.banners == banners; - - @override - int get hashCode => banners.hashCode; - - factory Banners.fromJson(Map json) => - _$BannersFromJson(json); - - Map toJson() => _$BannersToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/banners.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/banners.g.dart deleted file mode 100644 index 9512578996..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/banners.g.dart +++ /dev/null @@ -1,35 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'banners.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -Banners _$BannersFromJson(Map json) => $checkedCreate( - 'Banners', - json, - ($checkedConvert) { - final val = Banners( - banners: $checkedConvert( - 'banners', - (v) => v == null - ? null - : Banner.fromJson(v as Map)), - ); - return val; - }, - ); - -Map _$BannersToJson(Banners instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('banners', instance.banners?.toJson()); - return val; -} diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/widgets.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/widgets.dart index c73d91af68..a97da4c9d5 100644 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/widgets.dart +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/widgets.dart @@ -1,6 +1,6 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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/banners.dart'; +import 'package:algolia_client_recommend/src/model/banner.dart'; import 'package:json_annotation/json_annotation.dart'; @@ -13,8 +13,9 @@ final class Widgets { this.banners, }); + /// banners defined in the merchandising studio for the given search. @JsonKey(name: r'banners') - final Banners? banners; + final List? banners; @override bool operator ==(Object other) => diff --git a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/widgets.g.dart b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/widgets.g.dart index 37719e7e60..fe50ed495b 100644 --- a/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/widgets.g.dart +++ b/clients/algoliasearch-client-dart/packages/client_recommend/lib/src/model/widgets.g.dart @@ -13,9 +13,9 @@ Widgets _$WidgetsFromJson(Map json) => $checkedCreate( final val = Widgets( banners: $checkedConvert( 'banners', - (v) => v == null - ? null - : Banners.fromJson(v as Map)), + (v) => (v as List?) + ?.map((e) => Banner.fromJson(e as Map)) + .toList()), ); return val; }, @@ -30,6 +30,6 @@ Map _$WidgetsToJson(Widgets instance) { } } - writeNotNull('banners', instance.banners?.toJson()); + writeNotNull('banners', instance.banners?.map((e) => e.toJson()).toList()); return val; } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/algolia_client_search.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/algolia_client_search.dart index dc902dec87..37a46c15f7 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/algolia_client_search.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/algolia_client_search.dart @@ -20,7 +20,6 @@ export 'src/model/banner.dart'; export 'src/model/banner_image.dart'; export 'src/model/banner_image_url.dart'; export 'src/model/banner_link.dart'; -export 'src/model/banners.dart'; export 'src/model/base_get_api_key_response.dart'; export 'src/model/base_index_settings.dart'; export 'src/model/base_search_params.dart'; diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/deserialize.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/deserialize.dart index e3323d163b..2fd8b3372b 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/deserialize.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/deserialize.dart @@ -13,7 +13,6 @@ import 'package:algolia_client_search/src/model/banner.dart'; import 'package:algolia_client_search/src/model/banner_image.dart'; import 'package:algolia_client_search/src/model/banner_image_url.dart'; import 'package:algolia_client_search/src/model/banner_link.dart'; -import 'package:algolia_client_search/src/model/banners.dart'; import 'package:algolia_client_search/src/model/base_get_api_key_response.dart'; import 'package:algolia_client_search/src/model/base_index_settings.dart'; import 'package:algolia_client_search/src/model/base_search_params.dart'; @@ -210,8 +209,6 @@ ReturnType deserialize(dynamic value, String targetType, as ReturnType; case 'BannerLink': return BannerLink.fromJson(value as Map) as ReturnType; - case 'Banners': - return Banners.fromJson(value as Map) as ReturnType; case 'BaseGetApiKeyResponse': return BaseGetApiKeyResponse.fromJson(value as Map) as ReturnType; diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/banner_image.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/banner_image.dart index 0df42a03e0..b9db664749 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/banner_image.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/banner_image.dart @@ -15,7 +15,7 @@ final class BannerImage { }); @JsonKey(name: r'urls') - final BannerImageUrl? urls; + final List? urls; @JsonKey(name: r'title') final String? title; diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/banner_image.g.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/banner_image.g.dart index 4f212baf8a..f9f50f986d 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/banner_image.g.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/banner_image.g.dart @@ -13,9 +13,10 @@ BannerImage _$BannerImageFromJson(Map json) => $checkedCreate( final val = BannerImage( urls: $checkedConvert( 'urls', - (v) => v == null - ? null - : BannerImageUrl.fromJson(v as Map)), + (v) => (v as List?) + ?.map( + (e) => BannerImageUrl.fromJson(e as Map)) + .toList()), title: $checkedConvert('title', (v) => v as String?), ); return val; @@ -31,7 +32,7 @@ Map _$BannerImageToJson(BannerImage instance) { } } - writeNotNull('urls', instance.urls?.toJson()); + writeNotNull('urls', instance.urls?.map((e) => e.toJson()).toList()); writeNotNull('title', instance.title); return val; } diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/banners.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/banners.dart deleted file mode 100644 index f74eeaacbc..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/banners.dart +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. -// ignore_for_file: unused_element -import 'package:algolia_client_search/src/model/banner.dart'; - -import 'package:json_annotation/json_annotation.dart'; - -part 'banners.g.dart'; - -@JsonSerializable() -final class Banners { - /// Returns a new [Banners] instance. - const Banners({ - this.banners, - }); - - @JsonKey(name: r'banners') - final Banner? banners; - - @override - bool operator ==(Object other) => - identical(this, other) || other is Banners && other.banners == banners; - - @override - int get hashCode => banners.hashCode; - - factory Banners.fromJson(Map json) => - _$BannersFromJson(json); - - Map toJson() => _$BannersToJson(this); - - @override - String toString() { - return toJson().toString(); - } -} diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/banners.g.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/banners.g.dart deleted file mode 100644 index 9512578996..0000000000 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/banners.g.dart +++ /dev/null @@ -1,35 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'banners.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -Banners _$BannersFromJson(Map json) => $checkedCreate( - 'Banners', - json, - ($checkedConvert) { - final val = Banners( - banners: $checkedConvert( - 'banners', - (v) => v == null - ? null - : Banner.fromJson(v as Map)), - ); - return val; - }, - ); - -Map _$BannersToJson(Banners instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('banners', instance.banners?.toJson()); - return val; -} diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/widgets.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/widgets.dart index a12b94b588..494680f8f7 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/widgets.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/widgets.dart @@ -1,6 +1,6 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual 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_search/src/model/banners.dart'; +import 'package:algolia_client_search/src/model/banner.dart'; import 'package:json_annotation/json_annotation.dart'; @@ -13,8 +13,9 @@ final class Widgets { this.banners, }); + /// banners defined in the merchandising studio for the given search. @JsonKey(name: r'banners') - final Banners? banners; + final List? banners; @override bool operator ==(Object other) => diff --git a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/widgets.g.dart b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/widgets.g.dart index 37719e7e60..fe50ed495b 100644 --- a/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/widgets.g.dart +++ b/clients/algoliasearch-client-dart/packages/client_search/lib/src/model/widgets.g.dart @@ -13,9 +13,9 @@ Widgets _$WidgetsFromJson(Map json) => $checkedCreate( final val = Widgets( banners: $checkedConvert( 'banners', - (v) => v == null - ? null - : Banners.fromJson(v as Map)), + (v) => (v as List?) + ?.map((e) => Banner.fromJson(e as Map)) + .toList()), ); return val; }, @@ -30,6 +30,6 @@ Map _$WidgetsToJson(Widgets instance) { } } - writeNotNull('banners', instance.banners?.toJson()); + writeNotNull('banners', instance.banners?.map((e) => e.toJson()).toList()); return val; } diff --git a/clients/algoliasearch-client-go/algolia/recommend/model_banner_image.go b/clients/algoliasearch-client-go/algolia/recommend/model_banner_image.go index 513a219af8..7146b00274 100644 --- a/clients/algoliasearch-client-go/algolia/recommend/model_banner_image.go +++ b/clients/algoliasearch-client-go/algolia/recommend/model_banner_image.go @@ -8,15 +8,15 @@ import ( // BannerImage image of a search banner. type BannerImage struct { - Urls *BannerImageUrl `json:"urls,omitempty"` - Title *string `json:"title,omitempty"` + Urls []BannerImageUrl `json:"urls,omitempty"` + Title *string `json:"title,omitempty"` } type BannerImageOption func(f *BannerImage) -func WithBannerImageUrls(val BannerImageUrl) BannerImageOption { +func WithBannerImageUrls(val []BannerImageUrl) BannerImageOption { return func(f *BannerImage) { - f.Urls = &val + f.Urls = val } } @@ -44,17 +44,17 @@ func NewEmptyBannerImage() *BannerImage { } // GetUrls returns the Urls field value if set, zero value otherwise. -func (o *BannerImage) GetUrls() BannerImageUrl { +func (o *BannerImage) GetUrls() []BannerImageUrl { if o == nil || o.Urls == nil { - var ret BannerImageUrl + var ret []BannerImageUrl return ret } - return *o.Urls + return o.Urls } // GetUrlsOk returns a tuple with the Urls field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *BannerImage) GetUrlsOk() (*BannerImageUrl, bool) { +func (o *BannerImage) GetUrlsOk() ([]BannerImageUrl, bool) { if o == nil || o.Urls == nil { return nil, false } @@ -70,8 +70,8 @@ func (o *BannerImage) HasUrls() bool { return false } -// SetUrls gets a reference to the given BannerImageUrl and assigns it to the Urls field. -func (o *BannerImage) SetUrls(v *BannerImageUrl) *BannerImage { +// SetUrls gets a reference to the given []BannerImageUrl and assigns it to the Urls field. +func (o *BannerImage) SetUrls(v []BannerImageUrl) *BannerImage { o.Urls = v return o } diff --git a/clients/algoliasearch-client-go/algolia/recommend/model_banners.go b/clients/algoliasearch-client-go/algolia/recommend/model_banners.go deleted file mode 100644 index c4816c7c59..0000000000 --- a/clients/algoliasearch-client-go/algolia/recommend/model_banners.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by 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" -) - -// Banners banners defined in the merchandising studio for the given search. -type Banners struct { - Banners *Banner `json:"banners,omitempty"` -} - -type BannersOption func(f *Banners) - -func WithBannersBanners(val Banner) BannersOption { - return func(f *Banners) { - f.Banners = &val - } -} - -// NewBanners instantiates a new Banners 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 NewBanners(opts ...BannersOption) *Banners { - this := &Banners{} - for _, opt := range opts { - opt(this) - } - return this -} - -// NewEmptyBanners return a pointer to an empty Banners object. -func NewEmptyBanners() *Banners { - return &Banners{} -} - -// GetBanners returns the Banners field value if set, zero value otherwise. -func (o *Banners) GetBanners() Banner { - if o == nil || o.Banners == nil { - var ret Banner - return ret - } - return *o.Banners -} - -// GetBannersOk returns a tuple with the Banners field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Banners) GetBannersOk() (*Banner, bool) { - if o == nil || o.Banners == nil { - return nil, false - } - return o.Banners, true -} - -// HasBanners returns a boolean if a field has been set. -func (o *Banners) HasBanners() bool { - if o != nil && o.Banners != nil { - return true - } - - return false -} - -// SetBanners gets a reference to the given Banner and assigns it to the Banners field. -func (o *Banners) SetBanners(v *Banner) *Banners { - o.Banners = v - return o -} - -func (o Banners) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if o.Banners != nil { - toSerialize["banners"] = o.Banners - } - serialized, err := json.Marshal(toSerialize) - if err != nil { - return nil, fmt.Errorf("failed to marshal Banners: %w", err) - } - - return serialized, nil -} - -func (o Banners) String() string { - out := "" - out += fmt.Sprintf(" banners=%v\n", o.Banners) - return fmt.Sprintf("Banners {\n%s}", out) -} diff --git a/clients/algoliasearch-client-go/algolia/recommend/model_widgets.go b/clients/algoliasearch-client-go/algolia/recommend/model_widgets.go index 3fe348bcac..8732373712 100644 --- a/clients/algoliasearch-client-go/algolia/recommend/model_widgets.go +++ b/clients/algoliasearch-client-go/algolia/recommend/model_widgets.go @@ -8,14 +8,15 @@ import ( // Widgets widgets returned from any rules that are applied to the current search. type Widgets struct { - Banners *Banners `json:"banners,omitempty"` + // banners defined in the merchandising studio for the given search. + Banners []Banner `json:"banners,omitempty"` } type WidgetsOption func(f *Widgets) -func WithWidgetsBanners(val Banners) WidgetsOption { +func WithWidgetsBanners(val []Banner) WidgetsOption { return func(f *Widgets) { - f.Banners = &val + f.Banners = val } } @@ -37,17 +38,17 @@ func NewEmptyWidgets() *Widgets { } // GetBanners returns the Banners field value if set, zero value otherwise. -func (o *Widgets) GetBanners() Banners { +func (o *Widgets) GetBanners() []Banner { if o == nil || o.Banners == nil { - var ret Banners + var ret []Banner return ret } - return *o.Banners + return o.Banners } // GetBannersOk returns a tuple with the Banners field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Widgets) GetBannersOk() (*Banners, bool) { +func (o *Widgets) GetBannersOk() ([]Banner, bool) { if o == nil || o.Banners == nil { return nil, false } @@ -63,8 +64,8 @@ func (o *Widgets) HasBanners() bool { return false } -// SetBanners gets a reference to the given Banners and assigns it to the Banners field. -func (o *Widgets) SetBanners(v *Banners) *Widgets { +// SetBanners gets a reference to the given []Banner and assigns it to the Banners field. +func (o *Widgets) SetBanners(v []Banner) *Widgets { o.Banners = v return o } diff --git a/clients/algoliasearch-client-go/algolia/search/model_banner_image.go b/clients/algoliasearch-client-go/algolia/search/model_banner_image.go index b492083afd..1e8bc112cf 100644 --- a/clients/algoliasearch-client-go/algolia/search/model_banner_image.go +++ b/clients/algoliasearch-client-go/algolia/search/model_banner_image.go @@ -8,15 +8,15 @@ import ( // BannerImage image of a search banner. type BannerImage struct { - Urls *BannerImageUrl `json:"urls,omitempty"` - Title *string `json:"title,omitempty"` + Urls []BannerImageUrl `json:"urls,omitempty"` + Title *string `json:"title,omitempty"` } type BannerImageOption func(f *BannerImage) -func WithBannerImageUrls(val BannerImageUrl) BannerImageOption { +func WithBannerImageUrls(val []BannerImageUrl) BannerImageOption { return func(f *BannerImage) { - f.Urls = &val + f.Urls = val } } @@ -44,17 +44,17 @@ func NewEmptyBannerImage() *BannerImage { } // GetUrls returns the Urls field value if set, zero value otherwise. -func (o *BannerImage) GetUrls() BannerImageUrl { +func (o *BannerImage) GetUrls() []BannerImageUrl { if o == nil || o.Urls == nil { - var ret BannerImageUrl + var ret []BannerImageUrl return ret } - return *o.Urls + return o.Urls } // GetUrlsOk returns a tuple with the Urls field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *BannerImage) GetUrlsOk() (*BannerImageUrl, bool) { +func (o *BannerImage) GetUrlsOk() ([]BannerImageUrl, bool) { if o == nil || o.Urls == nil { return nil, false } @@ -70,8 +70,8 @@ func (o *BannerImage) HasUrls() bool { return false } -// SetUrls gets a reference to the given BannerImageUrl and assigns it to the Urls field. -func (o *BannerImage) SetUrls(v *BannerImageUrl) *BannerImage { +// SetUrls gets a reference to the given []BannerImageUrl and assigns it to the Urls field. +func (o *BannerImage) SetUrls(v []BannerImageUrl) *BannerImage { o.Urls = v return o } diff --git a/clients/algoliasearch-client-go/algolia/search/model_banners.go b/clients/algoliasearch-client-go/algolia/search/model_banners.go deleted file mode 100644 index 6ab86d95f4..0000000000 --- a/clients/algoliasearch-client-go/algolia/search/model_banners.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by 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 search - -import ( - "encoding/json" - "fmt" -) - -// Banners banners defined in the merchandising studio for the given search. -type Banners struct { - Banners *Banner `json:"banners,omitempty"` -} - -type BannersOption func(f *Banners) - -func WithBannersBanners(val Banner) BannersOption { - return func(f *Banners) { - f.Banners = &val - } -} - -// NewBanners instantiates a new Banners 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 NewBanners(opts ...BannersOption) *Banners { - this := &Banners{} - for _, opt := range opts { - opt(this) - } - return this -} - -// NewEmptyBanners return a pointer to an empty Banners object. -func NewEmptyBanners() *Banners { - return &Banners{} -} - -// GetBanners returns the Banners field value if set, zero value otherwise. -func (o *Banners) GetBanners() Banner { - if o == nil || o.Banners == nil { - var ret Banner - return ret - } - return *o.Banners -} - -// GetBannersOk returns a tuple with the Banners field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Banners) GetBannersOk() (*Banner, bool) { - if o == nil || o.Banners == nil { - return nil, false - } - return o.Banners, true -} - -// HasBanners returns a boolean if a field has been set. -func (o *Banners) HasBanners() bool { - if o != nil && o.Banners != nil { - return true - } - - return false -} - -// SetBanners gets a reference to the given Banner and assigns it to the Banners field. -func (o *Banners) SetBanners(v *Banner) *Banners { - o.Banners = v - return o -} - -func (o Banners) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - if o.Banners != nil { - toSerialize["banners"] = o.Banners - } - serialized, err := json.Marshal(toSerialize) - if err != nil { - return nil, fmt.Errorf("failed to marshal Banners: %w", err) - } - - return serialized, nil -} - -func (o Banners) String() string { - out := "" - out += fmt.Sprintf(" banners=%v\n", o.Banners) - return fmt.Sprintf("Banners {\n%s}", out) -} diff --git a/clients/algoliasearch-client-go/algolia/search/model_widgets.go b/clients/algoliasearch-client-go/algolia/search/model_widgets.go index 9e208f1746..c799877e99 100644 --- a/clients/algoliasearch-client-go/algolia/search/model_widgets.go +++ b/clients/algoliasearch-client-go/algolia/search/model_widgets.go @@ -8,14 +8,15 @@ import ( // Widgets widgets returned from any rules that are applied to the current search. type Widgets struct { - Banners *Banners `json:"banners,omitempty"` + // banners defined in the merchandising studio for the given search. + Banners []Banner `json:"banners,omitempty"` } type WidgetsOption func(f *Widgets) -func WithWidgetsBanners(val Banners) WidgetsOption { +func WithWidgetsBanners(val []Banner) WidgetsOption { return func(f *Widgets) { - f.Banners = &val + f.Banners = val } } @@ -37,17 +38,17 @@ func NewEmptyWidgets() *Widgets { } // GetBanners returns the Banners field value if set, zero value otherwise. -func (o *Widgets) GetBanners() Banners { +func (o *Widgets) GetBanners() []Banner { if o == nil || o.Banners == nil { - var ret Banners + var ret []Banner return ret } - return *o.Banners + return o.Banners } // GetBannersOk returns a tuple with the Banners field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Widgets) GetBannersOk() (*Banners, bool) { +func (o *Widgets) GetBannersOk() ([]Banner, bool) { if o == nil || o.Banners == nil { return nil, false } @@ -63,8 +64,8 @@ func (o *Widgets) HasBanners() bool { return false } -// SetBanners gets a reference to the given Banners and assigns it to the Banners field. -func (o *Widgets) SetBanners(v *Banners) *Widgets { +// SetBanners gets a reference to the given []Banner and assigns it to the Banners field. +func (o *Widgets) SetBanners(v []Banner) *Widgets { o.Banners = v return o } diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/BannerImage.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/BannerImage.java index ea2c8c50c6..16816c9525 100644 --- a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/BannerImage.java +++ b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/BannerImage.java @@ -5,25 +5,35 @@ import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.annotation.*; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; /** image of a search banner. */ public class BannerImage { @JsonProperty("urls") - private BannerImageUrl urls; + private List urls; @JsonProperty("title") private String title; - public BannerImage setUrls(BannerImageUrl urls) { + public BannerImage setUrls(List urls) { this.urls = urls; return this; } + public BannerImage addUrls(BannerImageUrl urlsItem) { + if (this.urls == null) { + this.urls = new ArrayList<>(); + } + this.urls.add(urlsItem); + return this; + } + /** Get urls */ @javax.annotation.Nullable - public BannerImageUrl getUrls() { + public List getUrls() { return urls; } diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/Banners.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/Banners.java deleted file mode 100644 index 2e7626da82..0000000000 --- a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/Banners.java +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by 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; - -/** banners defined in the merchandising studio for the given search. */ -public class Banners { - - @JsonProperty("banners") - private Banner banners; - - public Banners setBanners(Banner banners) { - this.banners = banners; - return this; - } - - /** Get banners */ - @javax.annotation.Nullable - public Banner getBanners() { - return banners; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Banners banners = (Banners) o; - return Objects.equals(this.banners, banners.banners); - } - - @Override - public int hashCode() { - return Objects.hash(banners); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Banners {\n"); - sb.append(" banners: ").append(toIndentedString(banners)).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-java/algoliasearch/src/main/java/com/algolia/model/recommend/Widgets.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/Widgets.java index 7458bf1a66..5bb569bf07 100644 --- a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/Widgets.java +++ b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/recommend/Widgets.java @@ -5,22 +5,32 @@ import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.annotation.*; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; /** widgets returned from any rules that are applied to the current search. */ public class Widgets { @JsonProperty("banners") - private Banners banners; + private List banners; - public Widgets setBanners(Banners banners) { + public Widgets setBanners(List banners) { this.banners = banners; return this; } - /** Get banners */ + public Widgets addBanners(Banner bannersItem) { + if (this.banners == null) { + this.banners = new ArrayList<>(); + } + this.banners.add(bannersItem); + return this; + } + + /** banners defined in the merchandising studio for the given search. */ @javax.annotation.Nullable - public Banners getBanners() { + public List getBanners() { return banners; } diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/BannerImage.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/BannerImage.java index c38a1f4c92..7ec15062f6 100644 --- a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/BannerImage.java +++ b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/BannerImage.java @@ -5,25 +5,35 @@ import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.annotation.*; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; /** image of a search banner. */ public class BannerImage { @JsonProperty("urls") - private BannerImageUrl urls; + private List urls; @JsonProperty("title") private String title; - public BannerImage setUrls(BannerImageUrl urls) { + public BannerImage setUrls(List urls) { this.urls = urls; return this; } + public BannerImage addUrls(BannerImageUrl urlsItem) { + if (this.urls == null) { + this.urls = new ArrayList<>(); + } + this.urls.add(urlsItem); + return this; + } + /** Get urls */ @javax.annotation.Nullable - public BannerImageUrl getUrls() { + public List getUrls() { return urls; } diff --git a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/Banners.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/Banners.java deleted file mode 100644 index 77a74c39ba..0000000000 --- a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/Banners.java +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by 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.search; - -import com.fasterxml.jackson.annotation.*; -import com.fasterxml.jackson.databind.annotation.*; -import java.util.Objects; - -/** banners defined in the merchandising studio for the given search. */ -public class Banners { - - @JsonProperty("banners") - private Banner banners; - - public Banners setBanners(Banner banners) { - this.banners = banners; - return this; - } - - /** Get banners */ - @javax.annotation.Nullable - public Banner getBanners() { - return banners; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Banners banners = (Banners) o; - return Objects.equals(this.banners, banners.banners); - } - - @Override - public int hashCode() { - return Objects.hash(banners); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Banners {\n"); - sb.append(" banners: ").append(toIndentedString(banners)).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-java/algoliasearch/src/main/java/com/algolia/model/search/Widgets.java b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/Widgets.java index d512a87fda..42070c200a 100644 --- a/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/Widgets.java +++ b/clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/Widgets.java @@ -5,22 +5,32 @@ import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.annotation.*; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; /** widgets returned from any rules that are applied to the current search. */ public class Widgets { @JsonProperty("banners") - private Banners banners; + private List banners; - public Widgets setBanners(Banners banners) { + public Widgets setBanners(List banners) { this.banners = banners; return this; } - /** Get banners */ + public Widgets addBanners(Banner bannersItem) { + if (this.banners == null) { + this.banners = new ArrayList<>(); + } + this.banners.add(bannersItem); + return this; + } + + /** banners defined in the merchandising studio for the given search. */ @javax.annotation.Nullable - public Banners getBanners() { + public List getBanners() { return banners; } diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch/builds/models.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch/builds/models.ts index f720bc95a9..201e705bab 100644 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch/builds/models.ts +++ b/clients/algoliasearch-client-javascript/packages/algoliasearch/builds/models.ts @@ -16,7 +16,6 @@ import type { BannerImage, BannerImageUrl, BannerLink, - Banners, BaseIndexSettings, BaseSearchParams, BaseSearchParamsWithoutQuery, @@ -111,7 +110,6 @@ export { BannerImage, BannerImageUrl, BannerLink, - Banners, BaseIndexSettings, BaseSearchParams, BaseSearchParamsWithoutQuery, diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/bannerImage.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/bannerImage.ts index 72c4687feb..9be9f38782 100644 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/bannerImage.ts +++ b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/bannerImage.ts @@ -6,7 +6,7 @@ import type { BannerImageUrl } from './bannerImageUrl'; * image of a search banner. */ export type BannerImage = { - urls?: BannerImageUrl; + urls?: Array; title?: string; }; diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/banners.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/banners.ts deleted file mode 100644 index eea9e5bc88..0000000000 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/banners.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 { Banner } from './banner'; - -/** - * banners defined in the merchandising studio for the given search. - */ -export type Banners = { - banners?: Banner; -}; 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 09e0c11800..e67ddd63eb 100644 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/index.ts +++ b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/index.ts @@ -13,7 +13,6 @@ export * from './banner'; export * from './bannerImage'; export * from './bannerImageUrl'; export * from './bannerLink'; -export * from './banners'; export * from './baseGetApiKeyResponse'; export * from './baseIndexSettings'; export * from './baseRecommendIndexSettings'; diff --git a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/widgets.ts b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/widgets.ts index 788ff522e6..0f50c381b5 100644 --- a/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/widgets.ts +++ b/clients/algoliasearch-client-javascript/packages/algoliasearch/lite/model/widgets.ts @@ -1,10 +1,13 @@ // Code generated by 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 { Banners } from './banners'; +import type { Banner } from './banner'; /** * widgets returned from any rules that are applied to the current search. */ export type Widgets = { - banners?: Banners; + /** + * banners defined in the merchandising studio for the given search. + */ + banners?: Array; }; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/bannerImage.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/bannerImage.ts index 72c4687feb..9be9f38782 100644 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/bannerImage.ts +++ b/clients/algoliasearch-client-javascript/packages/client-search/model/bannerImage.ts @@ -6,7 +6,7 @@ import type { BannerImageUrl } from './bannerImageUrl'; * image of a search banner. */ export type BannerImage = { - urls?: BannerImageUrl; + urls?: Array; title?: string; }; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/banners.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/banners.ts deleted file mode 100644 index eea9e5bc88..0000000000 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/banners.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 { Banner } from './banner'; - -/** - * banners defined in the merchandising studio for the given search. - */ -export type Banners = { - banners?: Banner; -}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/index.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/index.ts index c8de1a30dd..13e821cb3b 100644 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/index.ts +++ b/clients/algoliasearch-client-javascript/packages/client-search/model/index.ts @@ -19,7 +19,6 @@ export * from './banner'; export * from './bannerImage'; export * from './bannerImageUrl'; export * from './bannerLink'; -export * from './banners'; export * from './baseGetApiKeyResponse'; export * from './baseIndexSettings'; export * from './baseSearchParams'; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/model/widgets.ts b/clients/algoliasearch-client-javascript/packages/client-search/model/widgets.ts index 788ff522e6..0f50c381b5 100644 --- a/clients/algoliasearch-client-javascript/packages/client-search/model/widgets.ts +++ b/clients/algoliasearch-client-javascript/packages/client-search/model/widgets.ts @@ -1,10 +1,13 @@ // Code generated by 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 { Banners } from './banners'; +import type { Banner } from './banner'; /** * widgets returned from any rules that are applied to the current search. */ export type Widgets = { - banners?: Banners; + /** + * banners defined in the merchandising studio for the given search. + */ + banners?: Array; }; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/bannerImage.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/bannerImage.ts index 72c4687feb..9be9f38782 100644 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/bannerImage.ts +++ b/clients/algoliasearch-client-javascript/packages/recommend/model/bannerImage.ts @@ -6,7 +6,7 @@ import type { BannerImageUrl } from './bannerImageUrl'; * image of a search banner. */ export type BannerImage = { - urls?: BannerImageUrl; + urls?: Array; title?: string; }; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/banners.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/banners.ts deleted file mode 100644 index eea9e5bc88..0000000000 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/banners.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 { Banner } from './banner'; - -/** - * banners defined in the merchandising studio for the given search. - */ -export type Banners = { - banners?: Banner; -}; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/index.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/index.ts index 577b72dd74..6dc010ab54 100644 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/index.ts +++ b/clients/algoliasearch-client-javascript/packages/recommend/model/index.ts @@ -10,7 +10,6 @@ export * from './banner'; export * from './bannerImage'; export * from './bannerImageUrl'; export * from './bannerLink'; -export * from './banners'; export * from './baseIndexSettings'; export * from './baseRecommendIndexSettings'; export * from './baseRecommendRequest'; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/model/widgets.ts b/clients/algoliasearch-client-javascript/packages/recommend/model/widgets.ts index 788ff522e6..0f50c381b5 100644 --- a/clients/algoliasearch-client-javascript/packages/recommend/model/widgets.ts +++ b/clients/algoliasearch-client-javascript/packages/recommend/model/widgets.ts @@ -1,10 +1,13 @@ // Code generated by 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 { Banners } from './banners'; +import type { Banner } from './banner'; /** * widgets returned from any rules that are applied to the current search. */ export type Widgets = { - banners?: Banners; + /** + * banners defined in the merchandising studio for the given search. + */ + banners?: Array; }; diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/BannerImage.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/BannerImage.kt index b1937a5fc1..203da7ea19 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/BannerImage.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/BannerImage.kt @@ -13,7 +13,7 @@ import kotlinx.serialization.json.* @Serializable public data class BannerImage( - @SerialName(value = "urls") val urls: BannerImageUrl? = null, + @SerialName(value = "urls") val urls: List? = null, @SerialName(value = "title") val title: String? = null, ) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/Banners.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/Banners.kt deleted file mode 100644 index 48002ace6d..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/Banners.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.* -import kotlinx.serialization.json.* - -/** - * banners defined in the merchandising studio for the given search. - * - * @param banners - */ -@Serializable -public data class Banners( - - @SerialName(value = "banners") val banners: Banner? = null, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/Widgets.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/Widgets.kt index c153ad7f2b..762f9ff8f4 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/Widgets.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/recommend/Widgets.kt @@ -7,10 +7,11 @@ import kotlinx.serialization.json.* /** * widgets returned from any rules that are applied to the current search. * - * @param banners + * @param banners banners defined in the merchandising studio for the given search. */ @Serializable public data class Widgets( - @SerialName(value = "banners") val banners: Banners? = null, + /** banners defined in the merchandising studio for the given search. */ + @SerialName(value = "banners") val banners: List? = null, ) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/BannerImage.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/BannerImage.kt index 01b9ff5ddc..5fa5e426bc 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/BannerImage.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/BannerImage.kt @@ -13,7 +13,7 @@ import kotlinx.serialization.json.* @Serializable public data class BannerImage( - @SerialName(value = "urls") val urls: BannerImageUrl? = null, + @SerialName(value = "urls") val urls: List? = null, @SerialName(value = "title") val title: String? = null, ) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/Banners.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/Banners.kt deleted file mode 100644 index d778b11ea4..0000000000 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/Banners.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.search - -import kotlinx.serialization.* -import kotlinx.serialization.json.* - -/** - * banners defined in the merchandising studio for the given search. - * - * @param banners - */ -@Serializable -public data class Banners( - - @SerialName(value = "banners") val banners: Banner? = null, -) diff --git a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/Widgets.kt b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/Widgets.kt index 6ec8886a88..8d9ff942cf 100644 --- a/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/Widgets.kt +++ b/clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/Widgets.kt @@ -7,10 +7,11 @@ import kotlinx.serialization.json.* /** * widgets returned from any rules that are applied to the current search. * - * @param banners + * @param banners banners defined in the merchandising studio for the given search. */ @Serializable public data class Widgets( - @SerialName(value = "banners") val banners: Banners? = null, + /** banners defined in the merchandising studio for the given search. */ + @SerialName(value = "banners") val banners: List? = null, ) diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/BannerImage.php b/clients/algoliasearch-client-php/lib/Model/Recommend/BannerImage.php index f90944e38b..51aecfc4bc 100644 --- a/clients/algoliasearch-client-php/lib/Model/Recommend/BannerImage.php +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/BannerImage.php @@ -22,7 +22,7 @@ class BannerImage extends AbstractModel implements ModelInterface, \ArrayAccess, * @var string[] */ protected static $modelTypes = [ - 'urls' => '\Algolia\AlgoliaSearch\Model\Recommend\BannerImageUrl', + 'urls' => '\Algolia\AlgoliaSearch\Model\Recommend\BannerImageUrl[]', 'title' => 'string', ]; @@ -164,7 +164,7 @@ public function valid() /** * Gets urls. * - * @return null|BannerImageUrl + * @return null|\Algolia\AlgoliaSearch\Model\Recommend\BannerImageUrl[] */ public function getUrls() { @@ -174,7 +174,7 @@ public function getUrls() /** * Sets urls. * - * @param null|BannerImageUrl $urls urls + * @param null|\Algolia\AlgoliaSearch\Model\Recommend\BannerImageUrl[] $urls urls * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/Banners.php b/clients/algoliasearch-client-php/lib/Model/Recommend/Banners.php deleted file mode 100644 index bc6c387c4a..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/Recommend/Banners.php +++ /dev/null @@ -1,226 +0,0 @@ - '\Algolia\AlgoliaSearch\Model\Recommend\Banner', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization. - * - * @var string[] - */ - protected static $modelFormats = [ - 'banners' => null, - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name. - * - * @var string[] - */ - protected static $attributeMap = [ - 'banners' => 'banners', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses). - * - * @var string[] - */ - protected static $setters = [ - 'banners' => 'setBanners', - ]; - - /** - * Array of attributes to getter functions (for serialization of requests). - * - * @var string[] - */ - protected static $getters = [ - 'banners' => 'getBanners', - ]; - - /** - * 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['banners'])) { - $this->container['banners'] = $data['banners']; - } - } - - /** - * 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() - { - return []; - } - - /** - * 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 banners. - * - * @return null|Banner - */ - public function getBanners() - { - return $this->container['banners'] ?? null; - } - - /** - * Sets banners. - * - * @param null|Banner $banners banners - * - * @return self - */ - public function setBanners($banners) - { - $this->container['banners'] = $banners; - - 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-php/lib/Model/Recommend/Widgets.php b/clients/algoliasearch-client-php/lib/Model/Recommend/Widgets.php index 63421a92f3..e6159fc1a3 100644 --- a/clients/algoliasearch-client-php/lib/Model/Recommend/Widgets.php +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/Widgets.php @@ -22,7 +22,7 @@ class Widgets extends AbstractModel implements ModelInterface, \ArrayAccess, \Js * @var string[] */ protected static $modelTypes = [ - 'banners' => '\Algolia\AlgoliaSearch\Model\Recommend\Banners', + 'banners' => '\Algolia\AlgoliaSearch\Model\Recommend\Banner[]', ]; /** @@ -156,7 +156,7 @@ public function valid() /** * Gets banners. * - * @return null|Banners + * @return null|\Algolia\AlgoliaSearch\Model\Recommend\Banner[] */ public function getBanners() { @@ -166,7 +166,7 @@ public function getBanners() /** * Sets banners. * - * @param null|Banners $banners banners + * @param null|\Algolia\AlgoliaSearch\Model\Recommend\Banner[] $banners banners defined in the merchandising studio for the given search * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Search/BannerImage.php b/clients/algoliasearch-client-php/lib/Model/Search/BannerImage.php index 10f9d4d227..b167031ac0 100644 --- a/clients/algoliasearch-client-php/lib/Model/Search/BannerImage.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/BannerImage.php @@ -22,7 +22,7 @@ class BannerImage extends AbstractModel implements ModelInterface, \ArrayAccess, * @var string[] */ protected static $modelTypes = [ - 'urls' => '\Algolia\AlgoliaSearch\Model\Search\BannerImageUrl', + 'urls' => '\Algolia\AlgoliaSearch\Model\Search\BannerImageUrl[]', 'title' => 'string', ]; @@ -164,7 +164,7 @@ public function valid() /** * Gets urls. * - * @return null|BannerImageUrl + * @return null|\Algolia\AlgoliaSearch\Model\Search\BannerImageUrl[] */ public function getUrls() { @@ -174,7 +174,7 @@ public function getUrls() /** * Sets urls. * - * @param null|BannerImageUrl $urls urls + * @param null|\Algolia\AlgoliaSearch\Model\Search\BannerImageUrl[] $urls urls * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Search/Banners.php b/clients/algoliasearch-client-php/lib/Model/Search/Banners.php deleted file mode 100644 index 3bf90b19f5..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/Search/Banners.php +++ /dev/null @@ -1,226 +0,0 @@ - '\Algolia\AlgoliaSearch\Model\Search\Banner', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization. - * - * @var string[] - */ - protected static $modelFormats = [ - 'banners' => null, - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name. - * - * @var string[] - */ - protected static $attributeMap = [ - 'banners' => 'banners', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses). - * - * @var string[] - */ - protected static $setters = [ - 'banners' => 'setBanners', - ]; - - /** - * Array of attributes to getter functions (for serialization of requests). - * - * @var string[] - */ - protected static $getters = [ - 'banners' => 'getBanners', - ]; - - /** - * 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['banners'])) { - $this->container['banners'] = $data['banners']; - } - } - - /** - * 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() - { - return []; - } - - /** - * 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 banners. - * - * @return null|Banner - */ - public function getBanners() - { - return $this->container['banners'] ?? null; - } - - /** - * Sets banners. - * - * @param null|Banner $banners banners - * - * @return self - */ - public function setBanners($banners) - { - $this->container['banners'] = $banners; - - 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-php/lib/Model/Search/Widgets.php b/clients/algoliasearch-client-php/lib/Model/Search/Widgets.php index 120073b643..26f50015d4 100644 --- a/clients/algoliasearch-client-php/lib/Model/Search/Widgets.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/Widgets.php @@ -22,7 +22,7 @@ class Widgets extends AbstractModel implements ModelInterface, \ArrayAccess, \Js * @var string[] */ protected static $modelTypes = [ - 'banners' => '\Algolia\AlgoliaSearch\Model\Search\Banners', + 'banners' => '\Algolia\AlgoliaSearch\Model\Search\Banner[]', ]; /** @@ -156,7 +156,7 @@ public function valid() /** * Gets banners. * - * @return null|Banners + * @return null|\Algolia\AlgoliaSearch\Model\Search\Banner[] */ public function getBanners() { @@ -166,7 +166,7 @@ public function getBanners() /** * Sets banners. * - * @param null|Banners $banners banners + * @param null|\Algolia\AlgoliaSearch\Model\Search\Banner[] $banners banners defined in the merchandising studio for the given search * * @return self */ diff --git a/clients/algoliasearch-client-python/algoliasearch/recommend/models/banner_image.py b/clients/algoliasearch-client-python/algoliasearch/recommend/models/banner_image.py index 2b960bd56d..ab64f99c5d 100644 --- a/clients/algoliasearch-client-python/algoliasearch/recommend/models/banner_image.py +++ b/clients/algoliasearch-client-python/algoliasearch/recommend/models/banner_image.py @@ -8,7 +8,7 @@ from json import loads from sys import version_info -from typing import Any, Dict, Optional +from typing import Any, Dict, List, Optional from pydantic import BaseModel, ConfigDict @@ -35,7 +35,7 @@ class BannerImage(BaseModel): image of a search banner. """ - urls: Optional[BannerImageUrl] = None + urls: Optional[List[BannerImageUrl]] = None title: Optional[str] = None model_config = ConfigDict( @@ -72,7 +72,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) obj["urls"] = ( - BannerImageUrl.from_dict(obj["urls"]) + [BannerImageUrl.from_dict(_item) for _item in obj["urls"]] if obj.get("urls") is not None else None ) diff --git a/clients/algoliasearch-client-python/algoliasearch/recommend/models/banners.py b/clients/algoliasearch-client-python/algoliasearch/recommend/models/banners.py deleted file mode 100644 index 83ea01f021..0000000000 --- a/clients/algoliasearch-client-python/algoliasearch/recommend/models/banners.py +++ /dev/null @@ -1,76 +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.banner import Banner - -_ALIASES = { - "banners": "banners", -} - - -def _alias_generator(name: str) -> str: - return _ALIASES.get(name, name) - - -class Banners(BaseModel): - """ - banners defined in the merchandising studio for the given search. - """ - - banners: Optional[Banner] = 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 Banners 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 Banners from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - obj["banners"] = ( - Banner.from_dict(obj["banners"]) if obj.get("banners") is not None else None - ) - - return cls.model_validate(obj) diff --git a/clients/algoliasearch-client-python/algoliasearch/recommend/models/widgets.py b/clients/algoliasearch-client-python/algoliasearch/recommend/models/widgets.py index df7fc687dc..c469584bcd 100644 --- a/clients/algoliasearch-client-python/algoliasearch/recommend/models/widgets.py +++ b/clients/algoliasearch-client-python/algoliasearch/recommend/models/widgets.py @@ -8,7 +8,7 @@ from json import loads from sys import version_info -from typing import Any, Dict, Optional +from typing import Any, Dict, List, Optional from pydantic import BaseModel, ConfigDict @@ -18,7 +18,7 @@ from typing_extensions import Self -from algoliasearch.recommend.models.banners import Banners +from algoliasearch.recommend.models.banner import Banner _ALIASES = { "banners": "banners", @@ -34,7 +34,8 @@ class Widgets(BaseModel): widgets returned from any rules that are applied to the current search. """ - banners: Optional[Banners] = None + banners: Optional[List[Banner]] = None + """ banners defined in the merchandising studio for the given search. """ model_config = ConfigDict( use_enum_values=True, @@ -70,7 +71,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) obj["banners"] = ( - Banners.from_dict(obj["banners"]) + [Banner.from_dict(_item) for _item in obj["banners"]] if obj.get("banners") is not None else None ) diff --git a/clients/algoliasearch-client-python/algoliasearch/search/models/banner_image.py b/clients/algoliasearch-client-python/algoliasearch/search/models/banner_image.py index bcc62198b9..84a0e7fc92 100644 --- a/clients/algoliasearch-client-python/algoliasearch/search/models/banner_image.py +++ b/clients/algoliasearch-client-python/algoliasearch/search/models/banner_image.py @@ -8,7 +8,7 @@ from json import loads from sys import version_info -from typing import Any, Dict, Optional +from typing import Any, Dict, List, Optional from pydantic import BaseModel, ConfigDict @@ -35,7 +35,7 @@ class BannerImage(BaseModel): image of a search banner. """ - urls: Optional[BannerImageUrl] = None + urls: Optional[List[BannerImageUrl]] = None title: Optional[str] = None model_config = ConfigDict( @@ -72,7 +72,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) obj["urls"] = ( - BannerImageUrl.from_dict(obj["urls"]) + [BannerImageUrl.from_dict(_item) for _item in obj["urls"]] if obj.get("urls") is not None else None ) diff --git a/clients/algoliasearch-client-python/algoliasearch/search/models/banners.py b/clients/algoliasearch-client-python/algoliasearch/search/models/banners.py deleted file mode 100644 index fda833736b..0000000000 --- a/clients/algoliasearch-client-python/algoliasearch/search/models/banners.py +++ /dev/null @@ -1,76 +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.search.models.banner import Banner - -_ALIASES = { - "banners": "banners", -} - - -def _alias_generator(name: str) -> str: - return _ALIASES.get(name, name) - - -class Banners(BaseModel): - """ - banners defined in the merchandising studio for the given search. - """ - - banners: Optional[Banner] = 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 Banners 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 Banners from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - obj["banners"] = ( - Banner.from_dict(obj["banners"]) if obj.get("banners") is not None else None - ) - - return cls.model_validate(obj) diff --git a/clients/algoliasearch-client-python/algoliasearch/search/models/widgets.py b/clients/algoliasearch-client-python/algoliasearch/search/models/widgets.py index 5baaaf592a..965989aa05 100644 --- a/clients/algoliasearch-client-python/algoliasearch/search/models/widgets.py +++ b/clients/algoliasearch-client-python/algoliasearch/search/models/widgets.py @@ -8,7 +8,7 @@ from json import loads from sys import version_info -from typing import Any, Dict, Optional +from typing import Any, Dict, List, Optional from pydantic import BaseModel, ConfigDict @@ -18,7 +18,7 @@ from typing_extensions import Self -from algoliasearch.search.models.banners import Banners +from algoliasearch.search.models.banner import Banner _ALIASES = { "banners": "banners", @@ -34,7 +34,8 @@ class Widgets(BaseModel): widgets returned from any rules that are applied to the current search. """ - banners: Optional[Banners] = None + banners: Optional[List[Banner]] = None + """ banners defined in the merchandising studio for the given search. """ model_config = ConfigDict( use_enum_values=True, @@ -70,7 +71,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) obj["banners"] = ( - Banners.from_dict(obj["banners"]) + [Banner.from_dict(_item) for _item in obj["banners"]] if obj.get("banners") is not None else None ) diff --git a/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/banner_image.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/banner_image.rb index 06dc97b53f..d33289e2c6 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/banner_image.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/banner_image.rb @@ -27,7 +27,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.types_mapping { - :urls => :"BannerImageUrl", + :urls => :"Array", :title => :"String" } end @@ -63,7 +63,9 @@ def initialize(attributes = {}) } if attributes.key?(:urls) - self.urls = attributes[:urls] + if (value = attributes[:urls]).is_a?(Array) + self.urls = value + end end if attributes.key?(:title) diff --git a/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/banners.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/banners.rb deleted file mode 100644 index 31c1dde09e..0000000000 --- a/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/banners.rb +++ /dev/null @@ -1,209 +0,0 @@ -# Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -require "date" -require "time" - -module Algolia - module Recommend - # banners defined in the merchandising studio for the given search. - class Banners - attr_accessor :banners - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :banners => :banners - } - 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 - { - :banners => :"Banner" - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new( - [] - ) - 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::Banners` 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::Banners`. 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?(:banners) - self.banners = attributes[:banners] - 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 && - banners == other.banners - 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 - [banners].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-ruby/lib/algolia/models/recommend/widgets.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/widgets.rb index 6ef17a4dc4..196aa074d1 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/widgets.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/models/recommend/widgets.rb @@ -7,6 +7,7 @@ module Algolia module Recommend # widgets returned from any rules that are applied to the current search. class Widgets + # banners defined in the merchandising studio for the given search. attr_accessor :banners # Attribute mapping from ruby-style variable name to JSON key. @@ -24,7 +25,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.types_mapping { - :banners => :"Banners" + :banners => :"Array" } end @@ -56,7 +57,9 @@ def initialize(attributes = {}) } if attributes.key?(:banners) - self.banners = attributes[:banners] + if (value = attributes[:banners]).is_a?(Array) + self.banners = value + end end end diff --git a/clients/algoliasearch-client-ruby/lib/algolia/models/search/banner_image.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/search/banner_image.rb index 2353ea76d8..e27ea9473a 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/models/search/banner_image.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/models/search/banner_image.rb @@ -27,7 +27,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.types_mapping { - :urls => :"BannerImageUrl", + :urls => :"Array", :title => :"String" } end @@ -63,7 +63,9 @@ def initialize(attributes = {}) } if attributes.key?(:urls) - self.urls = attributes[:urls] + if (value = attributes[:urls]).is_a?(Array) + self.urls = value + end end if attributes.key?(:title) diff --git a/clients/algoliasearch-client-ruby/lib/algolia/models/search/banners.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/search/banners.rb deleted file mode 100644 index e7836b46de..0000000000 --- a/clients/algoliasearch-client-ruby/lib/algolia/models/search/banners.rb +++ /dev/null @@ -1,209 +0,0 @@ -# Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -require "date" -require "time" - -module Algolia - module Search - # banners defined in the merchandising studio for the given search. - class Banners - attr_accessor :banners - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :banners => :banners - } - 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 - { - :banners => :"Banner" - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new( - [] - ) - 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::Banners` 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::Banners`. 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?(:banners) - self.banners = attributes[:banners] - 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 && - banners == other.banners - 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 - [banners].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::Search.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-ruby/lib/algolia/models/search/widgets.rb b/clients/algoliasearch-client-ruby/lib/algolia/models/search/widgets.rb index 6a9124cef5..3ea4e104cc 100644 --- a/clients/algoliasearch-client-ruby/lib/algolia/models/search/widgets.rb +++ b/clients/algoliasearch-client-ruby/lib/algolia/models/search/widgets.rb @@ -7,6 +7,7 @@ module Algolia module Search # widgets returned from any rules that are applied to the current search. class Widgets + # banners defined in the merchandising studio for the given search. attr_accessor :banners # Attribute mapping from ruby-style variable name to JSON key. @@ -24,7 +25,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.types_mapping { - :banners => :"Banners" + :banners => :"Array" } end @@ -56,7 +57,9 @@ def initialize(attributes = {}) } if attributes.key?(:banners) - self.banners = attributes[:banners] + if (value = attributes[:banners]).is_a?(Array) + self.banners = value + end end end diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/BannerImage.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/BannerImage.scala index 609fb0338a..29f4b791f2 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/BannerImage.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/BannerImage.scala @@ -32,6 +32,6 @@ package algoliasearch.recommend /** image of a search banner. */ case class BannerImage( - urls: Option[BannerImageUrl] = scala.None, + urls: Option[Seq[BannerImageUrl]] = scala.None, title: Option[String] = scala.None ) diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/Banners.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/Banners.scala deleted file mode 100644 index 32a5796475..0000000000 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/Banners.scala +++ /dev/null @@ -1,36 +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 - -/** banners defined in the merchandising studio for the given search. - */ -case class Banners( - banners: Option[Banner] = scala.None -) diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/Widgets.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/Widgets.scala index 327427dcce..8d06a3228f 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/Widgets.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/recommend/Widgets.scala @@ -30,7 +30,10 @@ package algoliasearch.recommend /** widgets returned from any rules that are applied to the current search. + * + * @param banners + * banners defined in the merchandising studio for the given search. */ case class Widgets( - banners: Option[Banners] = scala.None + banners: Option[Seq[Banner]] = scala.None ) diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/BannerImage.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/BannerImage.scala index 29b6005ed7..9f219cd511 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/BannerImage.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/BannerImage.scala @@ -36,6 +36,6 @@ package algoliasearch.search /** image of a search banner. */ case class BannerImage( - urls: Option[BannerImageUrl] = scala.None, + urls: Option[Seq[BannerImageUrl]] = scala.None, title: Option[String] = scala.None ) diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/Banners.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/Banners.scala deleted file mode 100644 index 6cd6f49621..0000000000 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/Banners.scala +++ /dev/null @@ -1,40 +0,0 @@ -/** Search API The Algolia Search API lets you search, configure, and manage your indices and records. ## 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 Search 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 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 Depending on the endpoint, request bodies are - * either JSON objects or arrays of JSON objects, ## Parameters Parameters are passed as query parameters for GET and - * DELETE requests, and in the request body for POST and PUT requests. Query parameters must be - * [URL-encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding). Non-ASCII characters must be - * UTF-8 encoded. Plus characters (`+`) are interpreted as spaces. Arrays as query parameters must be one of: - A - * comma-separated string: `attributesToRetrieve=title,description` - A URL-encoded JSON array: - * `attributesToRetrieve=%5B%22title%22,%22description%22%D` ## Response status and errors The Search 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 Search 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.search - -/** banners defined in the merchandising studio for the given search. - */ -case class Banners( - banners: Option[Banner] = scala.None -) diff --git a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/Widgets.scala b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/Widgets.scala index 8c3263f3b8..72202cc746 100644 --- a/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/Widgets.scala +++ b/clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/Widgets.scala @@ -34,7 +34,10 @@ package algoliasearch.search /** widgets returned from any rules that are applied to the current search. + * + * @param banners + * banners defined in the merchandising studio for the given search. */ case class Widgets( - banners: Option[Banners] = scala.None + banners: Option[Seq[Banner]] = scala.None ) diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendBannerImage.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendBannerImage.swift index 6fa60d005b..1db77f3534 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendBannerImage.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendBannerImage.swift @@ -8,10 +8,10 @@ import Foundation /// image of a search banner. public struct RecommendBannerImage: Codable, JSONEncodable { - public var urls: RecommendBannerImageUrl? + public var urls: [RecommendBannerImageUrl]? public var title: String? - public init(urls: RecommendBannerImageUrl? = nil, title: String? = nil) { + public init(urls: [RecommendBannerImageUrl]? = nil, title: String? = nil) { self.urls = urls self.title = title } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendBanners.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendBanners.swift deleted file mode 100644 index 602ccbdadb..0000000000 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendBanners.swift +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on -// https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -import Foundation -#if canImport(Core) - import Core -#endif - -/// banners defined in the merchandising studio for the given search. -public struct RecommendBanners: Codable, JSONEncodable { - public var banners: RecommendBanner? - - public init(banners: RecommendBanner? = nil) { - self.banners = banners - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case banners - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(self.banners, forKey: .banners) - } -} - -extension RecommendBanners: Equatable { - public static func ==(lhs: RecommendBanners, rhs: RecommendBanners) -> Bool { - lhs.banners == rhs.banners - } -} - -extension RecommendBanners: Hashable { - public func hash(into hasher: inout Hasher) { - hasher.combine(self.banners?.hashValue) - } -} diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendWidgets.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendWidgets.swift index 80c707f554..26df3469b5 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendWidgets.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendWidgets.swift @@ -8,9 +8,10 @@ import Foundation /// widgets returned from any rules that are applied to the current search. public struct RecommendWidgets: Codable, JSONEncodable { - public var banners: RecommendBanners? + /// banners defined in the merchandising studio for the given search. + public var banners: [RecommendBanner]? - public init(banners: RecommendBanners? = nil) { + public init(banners: [RecommendBanner]? = nil) { self.banners = banners } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBannerImage.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBannerImage.swift index 81db44dffc..27957786b2 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBannerImage.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBannerImage.swift @@ -8,10 +8,10 @@ import Foundation /// image of a search banner. public struct SearchBannerImage: Codable, JSONEncodable { - public var urls: SearchBannerImageUrl? + public var urls: [SearchBannerImageUrl]? public var title: String? - public init(urls: SearchBannerImageUrl? = nil, title: String? = nil) { + public init(urls: [SearchBannerImageUrl]? = nil, title: String? = nil) { self.urls = urls self.title = title } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBanners.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBanners.swift deleted file mode 100644 index 527c222355..0000000000 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBanners.swift +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on -// https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -import Foundation -#if canImport(Core) - import Core -#endif - -/// banners defined in the merchandising studio for the given search. -public struct SearchBanners: Codable, JSONEncodable { - public var banners: SearchBanner? - - public init(banners: SearchBanner? = nil) { - self.banners = banners - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case banners - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(self.banners, forKey: .banners) - } -} - -extension SearchBanners: Equatable { - public static func ==(lhs: SearchBanners, rhs: SearchBanners) -> Bool { - lhs.banners == rhs.banners - } -} - -extension SearchBanners: Hashable { - public func hash(into hasher: inout Hasher) { - hasher.combine(self.banners?.hashValue) - } -} diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchWidgets.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchWidgets.swift index e961e13c39..76e9223a4b 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchWidgets.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchWidgets.swift @@ -8,9 +8,10 @@ import Foundation /// widgets returned from any rules that are applied to the current search. public struct SearchWidgets: Codable, JSONEncodable { - public var banners: SearchBanners? + /// banners defined in the merchandising studio for the given search. + public var banners: [SearchBanner]? - public init(banners: SearchBanners? = nil) { + public init(banners: [SearchBanner]? = nil) { self.banners = banners } diff --git a/specs/bundled/algoliasearch.yml b/specs/bundled/algoliasearch.yml index e2e7cb2346..4a2d6124fd 100644 --- a/specs/bundled/algoliasearch.yml +++ b/specs/bundled/algoliasearch.yml @@ -1534,7 +1534,7 @@ components: type: string bannerImageUrl: description: url for a search banner image. - type: array + type: object additionalProperties: false properties: url: @@ -1545,7 +1545,9 @@ components: additionalProperties: false properties: urls: - $ref: '#/components/schemas/bannerImageUrl' + type: array + items: + $ref: '#/components/schemas/bannerImageUrl' title: type: string bannerLink: @@ -1568,9 +1570,8 @@ components: description: banners defined in the merchandising studio for the given search. type: array additionalProperties: false - properties: - banners: - $ref: '#/components/schemas/banner' + items: + $ref: '#/components/schemas/banner' widgets: description: widgets returned from any rules that are applied to the current search. type: object diff --git a/specs/bundled/crawler.doc.yml b/specs/bundled/crawler.doc.yml index 903ae9c921..b8a4d1e6c0 100644 --- a/specs/bundled/crawler.doc.yml +++ b/specs/bundled/crawler.doc.yml @@ -1884,7 +1884,7 @@ components: type: string bannerImageUrl: description: url for a search banner image. - type: array + type: object additionalProperties: false properties: url: @@ -1895,7 +1895,9 @@ components: additionalProperties: false properties: urls: - $ref: '#/components/schemas/bannerImageUrl' + type: array + items: + $ref: '#/components/schemas/bannerImageUrl' title: type: string bannerLink: @@ -1918,9 +1920,8 @@ components: description: banners defined in the merchandising studio for the given search. type: array additionalProperties: false - properties: - banners: - $ref: '#/components/schemas/banner' + items: + $ref: '#/components/schemas/banner' widgets: description: widgets returned from any rules that are applied to the current search. type: object diff --git a/specs/bundled/crawler.yml b/specs/bundled/crawler.yml index bf148c2515..513233ccf3 100644 --- a/specs/bundled/crawler.yml +++ b/specs/bundled/crawler.yml @@ -1884,7 +1884,7 @@ components: type: string bannerImageUrl: description: url for a search banner image. - type: array + type: object additionalProperties: false properties: url: @@ -1895,7 +1895,9 @@ components: additionalProperties: false properties: urls: - $ref: '#/components/schemas/bannerImageUrl' + type: array + items: + $ref: '#/components/schemas/bannerImageUrl' title: type: string bannerLink: @@ -1918,9 +1920,8 @@ components: description: banners defined in the merchandising studio for the given search. type: array additionalProperties: false - properties: - banners: - $ref: '#/components/schemas/banner' + items: + $ref: '#/components/schemas/banner' widgets: description: widgets returned from any rules that are applied to the current search. type: object diff --git a/specs/bundled/recommend.doc.yml b/specs/bundled/recommend.doc.yml index 24516c11b3..3a3576e5cc 100644 --- a/specs/bundled/recommend.doc.yml +++ b/specs/bundled/recommend.doc.yml @@ -1485,7 +1485,7 @@ paths: --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ - --data '{"requests":[{"indexName":"products","threshold":0,"maxRecommendations":30,"queryParameters":{"similarQuery":"comedy drama crime Macy Buscemi","filters":"(category:Book OR category:Ebook) AND _tags:published","facetFilters":[["category:Book","category:-Movie"],"author:John Doe"],"optionalFilters":["category:Book","author:John Doe"],"numericFilters":[["inStock = 1","deliveryDate < 1441755506"],"price < 1000"],"tagFilters":[["Book","Movie"],"SciFi"],"sumOrFiltersScores":false,"restrictSearchableAttributes":["title","author"],"facets":["*"],"facetingAfterDistinct":false,"aroundLatLng":"40.71,-74.01","aroundLatLngViaIP":false,"aroundRadius":1,"aroundPrecision":10,"minimumAroundRadius":1,"insideBoundingBox":[[47.3165,4.9665,47.3424,5.0201],[40.9234,2.1185,38.643,1.9916]],"insidePolygon":[[47.3165,4.9665,47.3424,5.0201,47.32,4.9],[40.9234,2.1185,38.643,1.9916,39.2587,2.0104]],"naturalLanguages":[],"ruleContexts":["mobile"],"personalizationImpact":100,"userToken":"test-user-123","getRankingInfo":false,"synonyms":true,"clickAnalytics":false,"analytics":true,"analyticsTags":[],"percentileComputation":true,"enableABTest":true,"query":"","attributesForFaceting":["author","filterOnly(isbn)","searchable(edition)","afterDistinct(category)","afterDistinct(searchable(publisher))"],"replicas":["virtual(prod_products_price_asc)","dev_products_replica"],"paginationLimitedTo":100,"unretrievableAttributes":["total_sales"],"disableTypoToleranceOnWords":["wheel","1X2BCD"],"attributesToTransliterate":["name","description"],"camelCaseAttributes":["description"],"decompoundedAttributes":{"de":["name"]},"indexLanguages":["ja"],"disablePrefixOnAttributes":["sku"],"allowCompressionOfIntegerArray":false,"numericAttributesForFiltering":["equalOnly(quantity)","popularity"],"separatorsToIndex":"+#","searchableAttributes":["title,alternative_title","author","unordered(text)","emails.personal"],"userData":{"settingID":"f2a7b51e3503acc6a39b3784ffb84300","pluginVersion":"1.6.0"},"customNormalization":{"default":{"ä":"ae","ü":"ue"}},"attributeForDistinct":"url","attributesToRetrieve":["author","title","content"],"ranking":["typo","geo","words","filters","proximity","attribute","exact","custom"],"relevancyStrictness":90,"attributesToHighlight":["author","title","conten","content"],"attributesToSnippet":["content:80","description"],"highlightPreTag":"","highlightPostTag":"","snippetEllipsisText":"…","restrictHighlightAndSnippetArrays":false,"minWordSizefor1Typo":4,"minWordSizefor2Typos":8,"typoTolerance":true,"allowTyposOnNumericTokens":true,"disableTypoToleranceOnAttributes":["sku"],"ignorePlurals":["ca","es"],"removeStopWords":["ca","es"],"queryLanguages":["es"],"decompoundQuery":true,"enableRules":true,"enablePersonalization":false,"queryType":"prefixLast","removeWordsIfNoResults":"firstWords","advancedSyntax":false,"optionalWords":["blue","iphone case"],"disableExactOnAttributes":["description"],"exactOnSingleWordQuery":"attribute","alternativesAsExact":["ignorePlurals","singleWordSynonym"],"advancedSyntaxFeatures":["exactPhrase","excludeWords"],"distinct":1,"replaceSynonymsInHighlight":false,"minProximity":1,"responseFields":["*"],"maxFacetHits":10,"maxValuesPerFacet":100,"sortFacetValuesBy":"count","attributeCriteriaComputedByMinProximity":false,"renderingContent":{"facetOrdering":{"facets":{"order":["lorem"]},"values":{"property1":{"order":["lorem"],"sortRemainingBy":"count","hide":["lorem"]},"property2":{"order":["lorem"],"sortRemainingBy":"count","hide":["lorem"]}}},"redirect":{"url":"lorem"},"widgets":{"banners":[]}},"enableReRanking":true,"reRankingApplyFilter":[[]]},"model":"bought-together","objectID":"test-record-123"}]}' + --data '{"requests":[{"indexName":"products","threshold":0,"maxRecommendations":30,"queryParameters":{"similarQuery":"comedy drama crime Macy Buscemi","filters":"(category:Book OR category:Ebook) AND _tags:published","facetFilters":[["category:Book","category:-Movie"],"author:John Doe"],"optionalFilters":["category:Book","author:John Doe"],"numericFilters":[["inStock = 1","deliveryDate < 1441755506"],"price < 1000"],"tagFilters":[["Book","Movie"],"SciFi"],"sumOrFiltersScores":false,"restrictSearchableAttributes":["title","author"],"facets":["*"],"facetingAfterDistinct":false,"aroundLatLng":"40.71,-74.01","aroundLatLngViaIP":false,"aroundRadius":1,"aroundPrecision":10,"minimumAroundRadius":1,"insideBoundingBox":[[47.3165,4.9665,47.3424,5.0201],[40.9234,2.1185,38.643,1.9916]],"insidePolygon":[[47.3165,4.9665,47.3424,5.0201,47.32,4.9],[40.9234,2.1185,38.643,1.9916,39.2587,2.0104]],"naturalLanguages":[],"ruleContexts":["mobile"],"personalizationImpact":100,"userToken":"test-user-123","getRankingInfo":false,"synonyms":true,"clickAnalytics":false,"analytics":true,"analyticsTags":[],"percentileComputation":true,"enableABTest":true,"query":"","attributesForFaceting":["author","filterOnly(isbn)","searchable(edition)","afterDistinct(category)","afterDistinct(searchable(publisher))"],"replicas":["virtual(prod_products_price_asc)","dev_products_replica"],"paginationLimitedTo":100,"unretrievableAttributes":["total_sales"],"disableTypoToleranceOnWords":["wheel","1X2BCD"],"attributesToTransliterate":["name","description"],"camelCaseAttributes":["description"],"decompoundedAttributes":{"de":["name"]},"indexLanguages":["ja"],"disablePrefixOnAttributes":["sku"],"allowCompressionOfIntegerArray":false,"numericAttributesForFiltering":["equalOnly(quantity)","popularity"],"separatorsToIndex":"+#","searchableAttributes":["title,alternative_title","author","unordered(text)","emails.personal"],"userData":{"settingID":"f2a7b51e3503acc6a39b3784ffb84300","pluginVersion":"1.6.0"},"customNormalization":{"default":{"ä":"ae","ü":"ue"}},"attributeForDistinct":"url","attributesToRetrieve":["author","title","content"],"ranking":["typo","geo","words","filters","proximity","attribute","exact","custom"],"relevancyStrictness":90,"attributesToHighlight":["author","title","conten","content"],"attributesToSnippet":["content:80","description"],"highlightPreTag":"","highlightPostTag":"","snippetEllipsisText":"…","restrictHighlightAndSnippetArrays":false,"minWordSizefor1Typo":4,"minWordSizefor2Typos":8,"typoTolerance":true,"allowTyposOnNumericTokens":true,"disableTypoToleranceOnAttributes":["sku"],"ignorePlurals":["ca","es"],"removeStopWords":["ca","es"],"queryLanguages":["es"],"decompoundQuery":true,"enableRules":true,"enablePersonalization":false,"queryType":"prefixLast","removeWordsIfNoResults":"firstWords","advancedSyntax":false,"optionalWords":["blue","iphone case"],"disableExactOnAttributes":["description"],"exactOnSingleWordQuery":"attribute","alternativesAsExact":["ignorePlurals","singleWordSynonym"],"advancedSyntaxFeatures":["exactPhrase","excludeWords"],"distinct":1,"replaceSynonymsInHighlight":false,"minProximity":1,"responseFields":["*"],"maxFacetHits":10,"maxValuesPerFacet":100,"sortFacetValuesBy":"count","attributeCriteriaComputedByMinProximity":false,"renderingContent":{"facetOrdering":{"facets":{"order":["lorem"]},"values":{"property1":{"order":["lorem"],"sortRemainingBy":"count","hide":["lorem"]},"property2":{"order":["lorem"],"sortRemainingBy":"count","hide":["lorem"]}}},"redirect":{"url":"lorem"},"widgets":{"banners":[{"image":{"urls":[{"url":"lorem"}],"title":"lorem"},"link":{"url":"lorem"}}]}},"enableReRanking":true,"reRankingApplyFilter":[[]]},"model":"bought-together","objectID":"test-record-123"}]}' /1/indexes/{indexName}/{model}/recommend/rules/{objectID}: get: tags: @@ -4738,7 +4738,7 @@ components: type: string bannerImageUrl: description: url for a search banner image. - type: array + type: object additionalProperties: false properties: url: @@ -4749,7 +4749,9 @@ components: additionalProperties: false properties: urls: - $ref: '#/components/schemas/bannerImageUrl' + type: array + items: + $ref: '#/components/schemas/bannerImageUrl' title: type: string bannerLink: @@ -4772,9 +4774,8 @@ components: description: banners defined in the merchandising studio for the given search. type: array additionalProperties: false - properties: - banners: - $ref: '#/components/schemas/banner' + items: + $ref: '#/components/schemas/banner' widgets: description: widgets returned from any rules that are applied to the current search. type: object diff --git a/specs/bundled/recommend.yml b/specs/bundled/recommend.yml index e284ad413a..d4465db27a 100644 --- a/specs/bundled/recommend.yml +++ b/specs/bundled/recommend.yml @@ -2644,7 +2644,7 @@ components: type: string bannerImageUrl: description: url for a search banner image. - type: array + type: object additionalProperties: false properties: url: @@ -2655,7 +2655,9 @@ components: additionalProperties: false properties: urls: - $ref: '#/components/schemas/bannerImageUrl' + type: array + items: + $ref: '#/components/schemas/bannerImageUrl' title: type: string bannerLink: @@ -2678,9 +2680,8 @@ components: description: banners defined in the merchandising studio for the given search. type: array additionalProperties: false - properties: - banners: - $ref: '#/components/schemas/banner' + items: + $ref: '#/components/schemas/banner' widgets: description: widgets returned from any rules that are applied to the current search. type: object diff --git a/specs/bundled/search.doc.yml b/specs/bundled/search.doc.yml index 305430fe06..8a6651a2b0 100644 --- a/specs/bundled/search.doc.yml +++ b/specs/bundled/search.doc.yml @@ -9424,7 +9424,7 @@ paths: --header 'content-type: application/json' \ --header 'x-algolia-api-key: ALGOLIA_API_KEY' \ --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \ - --data '[{"objectID":"lorem","conditions":[{"pattern":"{facet:genre}","anchoring":"is","alternatives":false,"context":"mobile","filters":"genre:comedy"}],"consequence":{"params":{"similarQuery":"comedy drama crime Macy Buscemi","filters":"(category:Book OR category:Ebook) AND _tags:published","facetFilters":[["category:Book","category:-Movie"],"author:John Doe"],"optionalFilters":["category:Book","author:John Doe"],"numericFilters":[["inStock = 1","deliveryDate < 1441755506"],"price < 1000"],"tagFilters":[["Book","Movie"],"SciFi"],"sumOrFiltersScores":false,"restrictSearchableAttributes":["title","author"],"facets":["*"],"facetingAfterDistinct":false,"page":0,"offset":42,"length":0,"aroundLatLng":"40.71,-74.01","aroundLatLngViaIP":false,"aroundRadius":1,"aroundPrecision":10,"minimumAroundRadius":1,"insideBoundingBox":[[47.3165,4.9665,47.3424,5.0201],[40.9234,2.1185,38.643,1.9916]],"insidePolygon":[[47.3165,4.9665,47.3424,5.0201,47.32,4.9],[40.9234,2.1185,38.643,1.9916,39.2587,2.0104]],"naturalLanguages":[],"ruleContexts":["mobile"],"personalizationImpact":100,"userToken":"test-user-123","getRankingInfo":false,"synonyms":true,"clickAnalytics":false,"analytics":true,"analyticsTags":[],"percentileComputation":true,"enableABTest":true,"attributesToRetrieve":["author","title","content"],"ranking":["typo","geo","words","filters","proximity","attribute","exact","custom"],"customRanking":["desc(popularity)","asc(price)"],"relevancyStrictness":90,"attributesToHighlight":["author","title","conten","content"],"attributesToSnippet":["content:80","description"],"highlightPreTag":"","highlightPostTag":"","snippetEllipsisText":"…","restrictHighlightAndSnippetArrays":false,"hitsPerPage":20,"minWordSizefor1Typo":4,"minWordSizefor2Typos":8,"typoTolerance":true,"allowTyposOnNumericTokens":true,"disableTypoToleranceOnAttributes":["sku"],"ignorePlurals":["ca","es"],"removeStopWords":["ca","es"],"keepDiacriticsOnCharacters":"øé","queryLanguages":["es"],"decompoundQuery":true,"enableRules":true,"enablePersonalization":false,"queryType":"prefixLast","removeWordsIfNoResults":"firstWords","mode":"keywordSearch","semanticSearch":{"eventSources":["lorem"]},"advancedSyntax":false,"optionalWords":["blue","iphone case"],"disableExactOnAttributes":["description"],"exactOnSingleWordQuery":"attribute","alternativesAsExact":["ignorePlurals","singleWordSynonym"],"advancedSyntaxFeatures":["exactPhrase","excludeWords"],"distinct":1,"replaceSynonymsInHighlight":false,"minProximity":1,"responseFields":["*"],"maxFacetHits":10,"maxValuesPerFacet":100,"sortFacetValuesBy":"count","attributeCriteriaComputedByMinProximity":false,"renderingContent":{"facetOrdering":{"facets":{"order":["lorem"]},"values":{"property1":{"order":["lorem"],"sortRemainingBy":"count","hide":["lorem"]},"property2":{"order":["lorem"],"sortRemainingBy":"count","hide":["lorem"]}}},"redirect":{"url":"lorem"},"widgets":{"banners":[]}},"enableReRanking":true,"reRankingApplyFilter":[[]],"query":{"remove":["lorem"],"edits":[{"type":"remove","delete":"lorem","insert":"lorem"}]},"automaticFacetFilters":[{"facet":"lorem","score":1,"disjunctive":false}],"automaticOptionalFacetFilters":[{"facet":"lorem","score":1,"disjunctive":false}]},"promote":[{"objectIDs":["test-record-123"],"position":0}],"filterPromotes":false,"hide":[{"objectID":"test-record-123"}],"userData":{"settingID":"f2a7b51e3503acc6a39b3784ffb84300","pluginVersion":"1.6.0"}},"description":"Display a promotional banner","enabled":true,"validity":[{"from":42,"until":42}]}]' + --data '[{"objectID":"lorem","conditions":[{"pattern":"{facet:genre}","anchoring":"is","alternatives":false,"context":"mobile","filters":"genre:comedy"}],"consequence":{"params":{"similarQuery":"comedy drama crime Macy Buscemi","filters":"(category:Book OR category:Ebook) AND _tags:published","facetFilters":[["category:Book","category:-Movie"],"author:John Doe"],"optionalFilters":["category:Book","author:John Doe"],"numericFilters":[["inStock = 1","deliveryDate < 1441755506"],"price < 1000"],"tagFilters":[["Book","Movie"],"SciFi"],"sumOrFiltersScores":false,"restrictSearchableAttributes":["title","author"],"facets":["*"],"facetingAfterDistinct":false,"page":0,"offset":42,"length":0,"aroundLatLng":"40.71,-74.01","aroundLatLngViaIP":false,"aroundRadius":1,"aroundPrecision":10,"minimumAroundRadius":1,"insideBoundingBox":[[47.3165,4.9665,47.3424,5.0201],[40.9234,2.1185,38.643,1.9916]],"insidePolygon":[[47.3165,4.9665,47.3424,5.0201,47.32,4.9],[40.9234,2.1185,38.643,1.9916,39.2587,2.0104]],"naturalLanguages":[],"ruleContexts":["mobile"],"personalizationImpact":100,"userToken":"test-user-123","getRankingInfo":false,"synonyms":true,"clickAnalytics":false,"analytics":true,"analyticsTags":[],"percentileComputation":true,"enableABTest":true,"attributesToRetrieve":["author","title","content"],"ranking":["typo","geo","words","filters","proximity","attribute","exact","custom"],"customRanking":["desc(popularity)","asc(price)"],"relevancyStrictness":90,"attributesToHighlight":["author","title","conten","content"],"attributesToSnippet":["content:80","description"],"highlightPreTag":"","highlightPostTag":"","snippetEllipsisText":"…","restrictHighlightAndSnippetArrays":false,"hitsPerPage":20,"minWordSizefor1Typo":4,"minWordSizefor2Typos":8,"typoTolerance":true,"allowTyposOnNumericTokens":true,"disableTypoToleranceOnAttributes":["sku"],"ignorePlurals":["ca","es"],"removeStopWords":["ca","es"],"keepDiacriticsOnCharacters":"øé","queryLanguages":["es"],"decompoundQuery":true,"enableRules":true,"enablePersonalization":false,"queryType":"prefixLast","removeWordsIfNoResults":"firstWords","mode":"keywordSearch","semanticSearch":{"eventSources":["lorem"]},"advancedSyntax":false,"optionalWords":["blue","iphone case"],"disableExactOnAttributes":["description"],"exactOnSingleWordQuery":"attribute","alternativesAsExact":["ignorePlurals","singleWordSynonym"],"advancedSyntaxFeatures":["exactPhrase","excludeWords"],"distinct":1,"replaceSynonymsInHighlight":false,"minProximity":1,"responseFields":["*"],"maxFacetHits":10,"maxValuesPerFacet":100,"sortFacetValuesBy":"count","attributeCriteriaComputedByMinProximity":false,"renderingContent":{"facetOrdering":{"facets":{"order":["lorem"]},"values":{"property1":{"order":["lorem"],"sortRemainingBy":"count","hide":["lorem"]},"property2":{"order":["lorem"],"sortRemainingBy":"count","hide":["lorem"]}}},"redirect":{"url":"lorem"},"widgets":{"banners":[{"image":{"urls":[{"url":"lorem"}],"title":"lorem"},"link":{"url":"lorem"}}]}},"enableReRanking":true,"reRankingApplyFilter":[[]],"query":{"remove":["lorem"],"edits":[{"type":"remove","delete":"lorem","insert":"lorem"}]},"automaticFacetFilters":[{"facet":"lorem","score":1,"disjunctive":false}],"automaticOptionalFacetFilters":[{"facet":"lorem","score":1,"disjunctive":false}]},"promote":[{"objectIDs":["test-record-123"],"position":0}],"filterPromotes":false,"hide":[{"objectID":"test-record-123"}],"userData":{"settingID":"f2a7b51e3503acc6a39b3784ffb84300","pluginVersion":"1.6.0"}},"description":"Display a promotional banner","enabled":true,"validity":[{"from":42,"until":42}]}]' /1/indexes/{indexName}/rules/clear: post: tags: @@ -17737,7 +17737,7 @@ components: type: string bannerImageUrl: description: url for a search banner image. - type: array + type: object additionalProperties: false properties: url: @@ -17748,7 +17748,9 @@ components: additionalProperties: false properties: urls: - $ref: '#/components/schemas/bannerImageUrl' + type: array + items: + $ref: '#/components/schemas/bannerImageUrl' title: type: string bannerLink: @@ -17771,9 +17773,8 @@ components: description: banners defined in the merchandising studio for the given search. type: array additionalProperties: false - properties: - banners: - $ref: '#/components/schemas/banner' + items: + $ref: '#/components/schemas/banner' widgets: description: widgets returned from any rules that are applied to the current search. type: object diff --git a/specs/bundled/search.yml b/specs/bundled/search.yml index 339648f7a5..9c642502ca 100644 --- a/specs/bundled/search.yml +++ b/specs/bundled/search.yml @@ -4776,7 +4776,7 @@ components: type: string bannerImageUrl: description: url for a search banner image. - type: array + type: object additionalProperties: false properties: url: @@ -4787,7 +4787,9 @@ components: additionalProperties: false properties: urls: - $ref: '#/components/schemas/bannerImageUrl' + type: array + items: + $ref: '#/components/schemas/bannerImageUrl' title: type: string bannerLink: @@ -4810,9 +4812,8 @@ components: description: banners defined in the merchandising studio for the given search. type: array additionalProperties: false - properties: - banners: - $ref: '#/components/schemas/banner' + items: + $ref: '#/components/schemas/banner' widgets: description: widgets returned from any rules that are applied to the current search. type: object