Skip to content

Commit

Permalink
fix(specs): correct type for banners [skip-bc] (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#3939

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
  • Loading branch information
algolia-bot committed Oct 10, 2024
1 parent 3f044f8 commit 9cfce85
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 166 deletions.
6 changes: 3 additions & 3 deletions algoliasearch/recommend/models/banner_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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(
Expand Down Expand Up @@ -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
)
Expand Down
76 changes: 0 additions & 76 deletions algoliasearch/recommend/models/banners.py

This file was deleted.

9 changes: 5 additions & 4 deletions algoliasearch/recommend/models/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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",
Expand All @@ -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,
Expand Down Expand Up @@ -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
)
Expand Down
6 changes: 3 additions & 3 deletions algoliasearch/search/models/banner_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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(
Expand Down Expand Up @@ -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
)
Expand Down
76 changes: 0 additions & 76 deletions algoliasearch/search/models/banners.py

This file was deleted.

9 changes: 5 additions & 4 deletions algoliasearch/search/models/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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",
Expand All @@ -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,
Expand Down Expand Up @@ -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
)
Expand Down

0 comments on commit 9cfce85

Please sign in to comment.