Skip to content

Commit b585fd6

Browse files
committed
fix(specs): correct type for banners [skip-bc] (generated)
algolia/api-clients-automation#3939 Co-authored-by: algolia-bot <[email protected]>
1 parent f667bbf commit b585fd6

File tree

6 files changed

+18
-426
lines changed

6 files changed

+18
-426
lines changed

lib/algolia/models/recommend/banner_image.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def self.acceptable_attributes
2727
# Attribute type mapping.
2828
def self.types_mapping
2929
{
30-
:urls => :"BannerImageUrl",
30+
:urls => :"Array<BannerImageUrl>",
3131
:title => :"String"
3232
}
3333
end
@@ -63,7 +63,9 @@ def initialize(attributes = {})
6363
}
6464

6565
if attributes.key?(:urls)
66-
self.urls = attributes[:urls]
66+
if (value = attributes[:urls]).is_a?(Array)
67+
self.urls = value
68+
end
6769
end
6870

6971
if attributes.key?(:title)

lib/algolia/models/recommend/banners.rb

Lines changed: 0 additions & 209 deletions
This file was deleted.

lib/algolia/models/recommend/widgets.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module Algolia
77
module Recommend
88
# widgets returned from any rules that are applied to the current search.
99
class Widgets
10+
# banners defined in the merchandising studio for the given search.
1011
attr_accessor :banners
1112

1213
# Attribute mapping from ruby-style variable name to JSON key.
@@ -24,7 +25,7 @@ def self.acceptable_attributes
2425
# Attribute type mapping.
2526
def self.types_mapping
2627
{
27-
:banners => :"Banners"
28+
:banners => :"Array<Banner>"
2829
}
2930
end
3031

@@ -56,7 +57,9 @@ def initialize(attributes = {})
5657
}
5758

5859
if attributes.key?(:banners)
59-
self.banners = attributes[:banners]
60+
if (value = attributes[:banners]).is_a?(Array)
61+
self.banners = value
62+
end
6063
end
6164
end
6265

lib/algolia/models/search/banner_image.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def self.acceptable_attributes
2727
# Attribute type mapping.
2828
def self.types_mapping
2929
{
30-
:urls => :"BannerImageUrl",
30+
:urls => :"Array<BannerImageUrl>",
3131
:title => :"String"
3232
}
3333
end
@@ -63,7 +63,9 @@ def initialize(attributes = {})
6363
}
6464

6565
if attributes.key?(:urls)
66-
self.urls = attributes[:urls]
66+
if (value = attributes[:urls]).is_a?(Array)
67+
self.urls = value
68+
end
6769
end
6870

6971
if attributes.key?(:title)

0 commit comments

Comments
 (0)