From e0502dd16471e0563406538419efb183d42c1ea4 Mon Sep 17 00:00:00 2001 From: algolia-bot Date: Thu, 10 Oct 2024 10:47:57 +0000 Subject: [PATCH] fix(specs): correct type for banners [skip-bc] (generated) https://github.com/algolia/api-clients-automation/pull/3939 Co-authored-by: algolia-bot --- .../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 ++++-- 6 files changed, 54 insertions(+), 138 deletions(-) delete mode 100644 algoliasearch/src/main/java/com/algolia/model/recommend/Banners.java delete mode 100644 algoliasearch/src/main/java/com/algolia/model/search/Banners.java diff --git a/algoliasearch/src/main/java/com/algolia/model/recommend/BannerImage.java b/algoliasearch/src/main/java/com/algolia/model/recommend/BannerImage.java index ea2c8c50..16816c95 100644 --- a/algoliasearch/src/main/java/com/algolia/model/recommend/BannerImage.java +++ b/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/algoliasearch/src/main/java/com/algolia/model/recommend/Banners.java b/algoliasearch/src/main/java/com/algolia/model/recommend/Banners.java deleted file mode 100644 index 2e7626da..00000000 --- a/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/algoliasearch/src/main/java/com/algolia/model/recommend/Widgets.java b/algoliasearch/src/main/java/com/algolia/model/recommend/Widgets.java index 7458bf1a..5bb569bf 100644 --- a/algoliasearch/src/main/java/com/algolia/model/recommend/Widgets.java +++ b/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/algoliasearch/src/main/java/com/algolia/model/search/BannerImage.java b/algoliasearch/src/main/java/com/algolia/model/search/BannerImage.java index c38a1f4c..7ec15062 100644 --- a/algoliasearch/src/main/java/com/algolia/model/search/BannerImage.java +++ b/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/algoliasearch/src/main/java/com/algolia/model/search/Banners.java b/algoliasearch/src/main/java/com/algolia/model/search/Banners.java deleted file mode 100644 index 77a74c39..00000000 --- a/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/algoliasearch/src/main/java/com/algolia/model/search/Widgets.java b/algoliasearch/src/main/java/com/algolia/model/search/Widgets.java index d512a87f..42070c20 100644 --- a/algoliasearch/src/main/java/com/algolia/model/search/Widgets.java +++ b/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; }