From f961ab51b3dddc15390eb95f9f487add33205129 Mon Sep 17 00:00:00 2001 From: algolia-bot Date: Thu, 10 Oct 2024 10:48:04 +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 --- 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 +- 6 files changed, 12 insertions(+), 464 deletions(-) delete mode 100644 lib/Model/Recommend/Banners.php delete mode 100644 lib/Model/Search/Banners.php diff --git a/lib/Model/Recommend/BannerImage.php b/lib/Model/Recommend/BannerImage.php index f90944e3..51aecfc4 100644 --- a/lib/Model/Recommend/BannerImage.php +++ b/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/lib/Model/Recommend/Banners.php b/lib/Model/Recommend/Banners.php deleted file mode 100644 index bc6c387c..00000000 --- a/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/lib/Model/Recommend/Widgets.php b/lib/Model/Recommend/Widgets.php index 63421a92..e6159fc1 100644 --- a/lib/Model/Recommend/Widgets.php +++ b/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/lib/Model/Search/BannerImage.php b/lib/Model/Search/BannerImage.php index 10f9d4d2..b167031a 100644 --- a/lib/Model/Search/BannerImage.php +++ b/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/lib/Model/Search/Banners.php b/lib/Model/Search/Banners.php deleted file mode 100644 index 3bf90b19..00000000 --- a/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/lib/Model/Search/Widgets.php b/lib/Model/Search/Widgets.php index 120073b6..26f50015 100644 --- a/lib/Model/Search/Widgets.php +++ b/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 */