Skip to content

Commit c31a006

Browse files
algolia-botClaraMullerFluf22
committed
fix(specs): invalid API format for multi feed in Comp API (generated)
algolia/api-clients-automation#5993 Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com> Co-authored-by: Clara Muller <5667350+ClaraMuller@users.noreply.github.com> Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
1 parent a3e3218 commit c31a006

File tree

2 files changed

+235
-3
lines changed

2 files changed

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

lib/Model/Composition/Multifeed.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Multifeed extends AbstractModel implements ModelInterface, \ArrayAccess, \
2020
* @var string[]
2121
*/
2222
protected static $modelTypes = [
23-
'feeds' => 'array<string,\Algolia\AlgoliaSearch\Model\Composition\Injection>',
23+
'feeds' => 'array<string,\Algolia\AlgoliaSearch\Model\Composition\FeedInjection>',
2424
'feedsOrder' => 'string[]',
2525
];
2626

@@ -168,7 +168,7 @@ public function valid()
168168
/**
169169
* Gets feeds.
170170
*
171-
* @return array<string,Injection>
171+
* @return array<string,FeedInjection>
172172
*/
173173
public function getFeeds()
174174
{
@@ -178,7 +178,7 @@ public function getFeeds()
178178
/**
179179
* Sets feeds.
180180
*
181-
* @param array<string,Injection> $feeds A key-value store of Feed ID to Feed. Currently, the only supported Feed type is an Injection.
181+
* @param array<string,FeedInjection> $feeds A key-value store of Feed ID to Feed. Currently, the only supported Feed type is an Injection.
182182
*
183183
* @return self
184184
*/

0 commit comments

Comments
 (0)