Skip to content

Commit f5724c5

Browse files
algolia-botKalmar99Jonas Kalmar Rønningmillotp
committed
feat(specs): add support for widgets / banners in search for the csharp client (generated)
algolia/api-clients-automation#3870 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Jonas <[email protected]> Co-authored-by: Jonas Kalmar Rønning <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent ddab809 commit f5724c5

File tree

14 files changed

+2904
-0
lines changed

14 files changed

+2904
-0
lines changed

lib/Model/Recommend/Banner.php

Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
<?php
2+
3+
// 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.
4+
5+
namespace Algolia\AlgoliaSearch\Model\Recommend;
6+
7+
use Algolia\AlgoliaSearch\Model\AbstractModel;
8+
use Algolia\AlgoliaSearch\Model\ModelInterface;
9+
10+
/**
11+
* Banner Class Doc Comment.
12+
*
13+
* @category Class
14+
*
15+
* @description a search banner with image and url.
16+
*/
17+
class Banner extends AbstractModel implements ModelInterface, \ArrayAccess, \JsonSerializable
18+
{
19+
/**
20+
* Array of property to type mappings. Used for (de)serialization.
21+
*
22+
* @var string[]
23+
*/
24+
protected static $modelTypes = [
25+
'image' => '\Algolia\AlgoliaSearch\Model\Recommend\BannerImage',
26+
'link' => '\Algolia\AlgoliaSearch\Model\Recommend\BannerLink',
27+
];
28+
29+
/**
30+
* Array of property to format mappings. Used for (de)serialization.
31+
*
32+
* @var string[]
33+
*/
34+
protected static $modelFormats = [
35+
'image' => null,
36+
'link' => null,
37+
];
38+
39+
/**
40+
* Array of attributes where the key is the local name,
41+
* and the value is the original name.
42+
*
43+
* @var string[]
44+
*/
45+
protected static $attributeMap = [
46+
'image' => 'image',
47+
'link' => 'link',
48+
];
49+
50+
/**
51+
* Array of attributes to setter functions (for deserialization of responses).
52+
*
53+
* @var string[]
54+
*/
55+
protected static $setters = [
56+
'image' => 'setImage',
57+
'link' => 'setLink',
58+
];
59+
60+
/**
61+
* Array of attributes to getter functions (for serialization of requests).
62+
*
63+
* @var string[]
64+
*/
65+
protected static $getters = [
66+
'image' => 'getImage',
67+
'link' => 'getLink',
68+
];
69+
70+
/**
71+
* Associative array for storing property values.
72+
*
73+
* @var mixed[]
74+
*/
75+
protected $container = [];
76+
77+
/**
78+
* Constructor.
79+
*
80+
* @param mixed[] $data Associated array of property values
81+
*/
82+
public function __construct(?array $data = null)
83+
{
84+
if (isset($data['image'])) {
85+
$this->container['image'] = $data['image'];
86+
}
87+
if (isset($data['link'])) {
88+
$this->container['link'] = $data['link'];
89+
}
90+
}
91+
92+
/**
93+
* Array of attributes where the key is the local name,
94+
* and the value is the original name.
95+
*
96+
* @return array
97+
*/
98+
public static function attributeMap()
99+
{
100+
return self::$attributeMap;
101+
}
102+
103+
/**
104+
* Array of property to type mappings. Used for (de)serialization.
105+
*
106+
* @return array
107+
*/
108+
public static function modelTypes()
109+
{
110+
return self::$modelTypes;
111+
}
112+
113+
/**
114+
* Array of property to format mappings. Used for (de)serialization.
115+
*
116+
* @return array
117+
*/
118+
public static function modelFormats()
119+
{
120+
return self::$modelFormats;
121+
}
122+
123+
/**
124+
* Array of attributes to setter functions (for deserialization of responses).
125+
*
126+
* @return array
127+
*/
128+
public static function setters()
129+
{
130+
return self::$setters;
131+
}
132+
133+
/**
134+
* Array of attributes to getter functions (for serialization of requests).
135+
*
136+
* @return array
137+
*/
138+
public static function getters()
139+
{
140+
return self::$getters;
141+
}
142+
143+
/**
144+
* Show all the invalid properties with reasons.
145+
*
146+
* @return array invalid properties with reasons
147+
*/
148+
public function listInvalidProperties()
149+
{
150+
return [];
151+
}
152+
153+
/**
154+
* Validate all the properties in the model
155+
* return true if all passed.
156+
*
157+
* @return bool True if all properties are valid
158+
*/
159+
public function valid()
160+
{
161+
return 0 === count($this->listInvalidProperties());
162+
}
163+
164+
/**
165+
* Gets image.
166+
*
167+
* @return null|BannerImage
168+
*/
169+
public function getImage()
170+
{
171+
return $this->container['image'] ?? null;
172+
}
173+
174+
/**
175+
* Sets image.
176+
*
177+
* @param null|BannerImage $image image
178+
*
179+
* @return self
180+
*/
181+
public function setImage($image)
182+
{
183+
$this->container['image'] = $image;
184+
185+
return $this;
186+
}
187+
188+
/**
189+
* Gets link.
190+
*
191+
* @return null|BannerLink
192+
*/
193+
public function getLink()
194+
{
195+
return $this->container['link'] ?? null;
196+
}
197+
198+
/**
199+
* Sets link.
200+
*
201+
* @param null|BannerLink $link link
202+
*
203+
* @return self
204+
*/
205+
public function setLink($link)
206+
{
207+
$this->container['link'] = $link;
208+
209+
return $this;
210+
}
211+
212+
/**
213+
* Returns true if offset exists. False otherwise.
214+
*
215+
* @param int $offset Offset
216+
*/
217+
public function offsetExists($offset): bool
218+
{
219+
return isset($this->container[$offset]);
220+
}
221+
222+
/**
223+
* Gets offset.
224+
*
225+
* @param int $offset Offset
226+
*
227+
* @return null|mixed
228+
*/
229+
public function offsetGet($offset): mixed
230+
{
231+
return $this->container[$offset] ?? null;
232+
}
233+
234+
/**
235+
* Sets value based on offset.
236+
*
237+
* @param null|int $offset Offset
238+
* @param mixed $value Value to be set
239+
*/
240+
public function offsetSet($offset, $value): void
241+
{
242+
if (is_null($offset)) {
243+
$this->container[] = $value;
244+
} else {
245+
$this->container[$offset] = $value;
246+
}
247+
}
248+
249+
/**
250+
* Unsets offset.
251+
*
252+
* @param int $offset Offset
253+
*/
254+
public function offsetUnset($offset): void
255+
{
256+
unset($this->container[$offset]);
257+
}
258+
}

0 commit comments

Comments
 (0)