Skip to content

Commit

Permalink
feat(specs): add support for widgets / banners in search for the csha…
Browse files Browse the repository at this point in the history
…rp client (generated)

algolia/api-clients-automation#3870

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
Co-authored-by: Jonas <42573917+Kalmar99@users.noreply.github.com>
Co-authored-by: Jonas Kalmar Rønning <jonaskalmar.ronning@komplett.com>
Co-authored-by: Pierre Millot <pierre.millot@algolia.com>
  • Loading branch information
4 people committed Oct 6, 2024
1 parent ddab809 commit f5724c5
Show file tree
Hide file tree
Showing 14 changed files with 2,904 additions and 0 deletions.
258 changes: 258 additions & 0 deletions lib/Model/Recommend/Banner.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
<?php

// 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.

namespace Algolia\AlgoliaSearch\Model\Recommend;

use Algolia\AlgoliaSearch\Model\AbstractModel;
use Algolia\AlgoliaSearch\Model\ModelInterface;

/**
* Banner Class Doc Comment.
*
* @category Class
*
* @description a search banner with image and url.
*/
class Banner extends AbstractModel implements ModelInterface, \ArrayAccess, \JsonSerializable
{
/**
* Array of property to type mappings. Used for (de)serialization.
*
* @var string[]
*/
protected static $modelTypes = [
'image' => '\Algolia\AlgoliaSearch\Model\Recommend\BannerImage',
'link' => '\Algolia\AlgoliaSearch\Model\Recommend\BannerLink',
];

/**
* Array of property to format mappings. Used for (de)serialization.
*
* @var string[]
*/
protected static $modelFormats = [
'image' => null,
'link' => null,
];

/**
* Array of attributes where the key is the local name,
* and the value is the original name.
*
* @var string[]
*/
protected static $attributeMap = [
'image' => 'image',
'link' => 'link',
];

/**
* Array of attributes to setter functions (for deserialization of responses).
*
* @var string[]
*/
protected static $setters = [
'image' => 'setImage',
'link' => 'setLink',
];

/**
* Array of attributes to getter functions (for serialization of requests).
*
* @var string[]
*/
protected static $getters = [
'image' => 'getImage',
'link' => 'getLink',
];

/**
* 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['image'])) {
$this->container['image'] = $data['image'];
}
if (isset($data['link'])) {
$this->container['link'] = $data['link'];
}
}

/**
* 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 image.
*
* @return null|BannerImage
*/
public function getImage()
{
return $this->container['image'] ?? null;
}

/**
* Sets image.
*
* @param null|BannerImage $image image
*
* @return self
*/
public function setImage($image)
{
$this->container['image'] = $image;

return $this;
}

/**
* Gets link.
*
* @return null|BannerLink
*/
public function getLink()
{
return $this->container['link'] ?? null;
}

/**
* Sets link.
*
* @param null|BannerLink $link link
*
* @return self
*/
public function setLink($link)
{
$this->container['link'] = $link;

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]);
}
}
Loading

0 comments on commit f5724c5

Please sign in to comment.