Skip to content

Commit f786c96

Browse files
feat(javascript): add replaceAllObjectsWithTransformation (generated)
algolia/api-clients-automation#5008 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent bbac560 commit f786c96

File tree

1 file changed

+300
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)