Skip to content

Commit 8efbc30

Browse files
feat(specs): update try transformation specs for no-code (generated)
algolia/api-clients-automation#4974 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Mehmet Ali Gok <[email protected]>
1 parent 927ddeb commit 8efbc30

File tree

3 files changed

+80
-21
lines changed

3 files changed

+80
-21
lines changed

lib/Api/IngestionClient.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,8 @@ public function createTaskV1($taskCreate, $requestOptions = [])
359359
* @param array|TransformationCreate $transformationCreate Request body for creating a transformation. (required)
360360
* - $transformationCreate['code'] => (string) It is deprecated. Use the `input` field with proper `type` instead to specify the transformation code.
361361
* - $transformationCreate['name'] => (string) The uniquely identified name of your transformation. (required)
362-
* - $transformationCreate['type'] => (array) (required)
363-
* - $transformationCreate['input'] => (array) (required)
362+
* - $transformationCreate['type'] => (array)
363+
* - $transformationCreate['input'] => (array)
364364
* - $transformationCreate['description'] => (string) A descriptive name for your transformation of what it does.
365365
* - $transformationCreate['authenticationIDs'] => (array) The authentications associated with the current transformation.
366366
*
@@ -2322,7 +2322,9 @@ public function triggerDockerSourceDiscover($sourceID, $requestOptions = [])
23222322
* - editSettings
23232323
*
23242324
* @param array|TransformationTry $transformationTry transformationTry (required)
2325-
* - $transformationTry['code'] => (string) It is deprecated. Use the `input` field with proper `type` instead to specify the transformation code. (required)
2325+
* - $transformationTry['code'] => (string) It is deprecated. Use the `input` field with proper `type` instead to specify the transformation code.
2326+
* - $transformationTry['type'] => (array)
2327+
* - $transformationTry['input'] => (array)
23262328
* - $transformationTry['sampleRecord'] => (array) The record to apply the given code to. (required)
23272329
* - $transformationTry['authentications'] => (array)
23282330
*
@@ -2359,7 +2361,9 @@ public function tryTransformation($transformationTry, $requestOptions = [])
23592361
*
23602362
* @param string $transformationID Unique identifier of a transformation. (required)
23612363
* @param array|TransformationTry $transformationTry transformationTry (required)
2362-
* - $transformationTry['code'] => (string) It is deprecated. Use the `input` field with proper `type` instead to specify the transformation code. (required)
2364+
* - $transformationTry['code'] => (string) It is deprecated. Use the `input` field with proper `type` instead to specify the transformation code.
2365+
* - $transformationTry['type'] => (array)
2366+
* - $transformationTry['input'] => (array)
23632367
* - $transformationTry['sampleRecord'] => (array) The record to apply the given code to. (required)
23642368
* - $transformationTry['authentications'] => (array)
23652369
*
@@ -2670,8 +2674,8 @@ public function updateTaskV1($taskID, $taskUpdate, $requestOptions = [])
26702674
* @param array|TransformationCreate $transformationCreate transformationCreate (required)
26712675
* - $transformationCreate['code'] => (string) It is deprecated. Use the `input` field with proper `type` instead to specify the transformation code.
26722676
* - $transformationCreate['name'] => (string) The uniquely identified name of your transformation. (required)
2673-
* - $transformationCreate['type'] => (array) (required)
2674-
* - $transformationCreate['input'] => (array) (required)
2677+
* - $transformationCreate['type'] => (array)
2678+
* - $transformationCreate['input'] => (array)
26752679
* - $transformationCreate['description'] => (string) A descriptive name for your transformation of what it does.
26762680
* - $transformationCreate['authenticationIDs'] => (array) The authentications associated with the current transformation.
26772681
*

lib/Model/Ingestion/TransformationCreate.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,6 @@ public function listInvalidProperties()
184184
if (!isset($this->container['name']) || null === $this->container['name']) {
185185
$invalidProperties[] = "'name' can't be null";
186186
}
187-
if (!isset($this->container['type']) || null === $this->container['type']) {
188-
$invalidProperties[] = "'type' can't be null";
189-
}
190-
if (!isset($this->container['input']) || null === $this->container['input']) {
191-
$invalidProperties[] = "'input' can't be null";
192-
}
193187

194188
return $invalidProperties;
195189
}
@@ -260,7 +254,7 @@ public function setName($name)
260254
/**
261255
* Gets type.
262256
*
263-
* @return TransformationType
257+
* @return null|TransformationType
264258
*/
265259
public function getType()
266260
{
@@ -270,7 +264,7 @@ public function getType()
270264
/**
271265
* Sets type.
272266
*
273-
* @param TransformationType $type type
267+
* @param null|TransformationType $type type
274268
*
275269
* @return self
276270
*/
@@ -284,7 +278,7 @@ public function setType($type)
284278
/**
285279
* Gets input.
286280
*
287-
* @return TransformationInput
281+
* @return null|TransformationInput
288282
*/
289283
public function getInput()
290284
{
@@ -294,7 +288,7 @@ public function getInput()
294288
/**
295289
* Sets input.
296290
*
297-
* @param TransformationInput $input input
291+
* @param null|TransformationInput $input input
298292
*
299293
* @return self
300294
*/

lib/Model/Ingestion/TransformationTry.php

Lines changed: 66 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class TransformationTry extends AbstractModel implements ModelInterface, \ArrayA
2121
*/
2222
protected static $modelTypes = [
2323
'code' => 'string',
24+
'type' => '\Algolia\AlgoliaSearch\Model\Ingestion\TransformationType',
25+
'input' => '\Algolia\AlgoliaSearch\Model\Ingestion\TransformationInput',
2426
'sampleRecord' => 'object',
2527
'authentications' => '\Algolia\AlgoliaSearch\Model\Ingestion\AuthenticationCreate[]',
2628
];
@@ -32,6 +34,8 @@ class TransformationTry extends AbstractModel implements ModelInterface, \ArrayA
3234
*/
3335
protected static $modelFormats = [
3436
'code' => null,
37+
'type' => null,
38+
'input' => null,
3539
'sampleRecord' => null,
3640
'authentications' => null,
3741
];
@@ -44,6 +48,8 @@ class TransformationTry extends AbstractModel implements ModelInterface, \ArrayA
4448
*/
4549
protected static $attributeMap = [
4650
'code' => 'code',
51+
'type' => 'type',
52+
'input' => 'input',
4753
'sampleRecord' => 'sampleRecord',
4854
'authentications' => 'authentications',
4955
];
@@ -55,6 +61,8 @@ class TransformationTry extends AbstractModel implements ModelInterface, \ArrayA
5561
*/
5662
protected static $setters = [
5763
'code' => 'setCode',
64+
'type' => 'setType',
65+
'input' => 'setInput',
5866
'sampleRecord' => 'setSampleRecord',
5967
'authentications' => 'setAuthentications',
6068
];
@@ -66,6 +74,8 @@ class TransformationTry extends AbstractModel implements ModelInterface, \ArrayA
6674
*/
6775
protected static $getters = [
6876
'code' => 'getCode',
77+
'type' => 'getType',
78+
'input' => 'getInput',
6979
'sampleRecord' => 'getSampleRecord',
7080
'authentications' => 'getAuthentications',
7181
];
@@ -87,6 +97,12 @@ public function __construct(?array $data = null)
8797
if (isset($data['code'])) {
8898
$this->container['code'] = $data['code'];
8999
}
100+
if (isset($data['type'])) {
101+
$this->container['type'] = $data['type'];
102+
}
103+
if (isset($data['input'])) {
104+
$this->container['input'] = $data['input'];
105+
}
90106
if (isset($data['sampleRecord'])) {
91107
$this->container['sampleRecord'] = $data['sampleRecord'];
92108
}
@@ -155,9 +171,6 @@ public function listInvalidProperties()
155171
{
156172
$invalidProperties = [];
157173

158-
if (!isset($this->container['code']) || null === $this->container['code']) {
159-
$invalidProperties[] = "'code' can't be null";
160-
}
161174
if (!isset($this->container['sampleRecord']) || null === $this->container['sampleRecord']) {
162175
$invalidProperties[] = "'sampleRecord' can't be null";
163176
}
@@ -179,7 +192,7 @@ public function valid()
179192
/**
180193
* Gets code.
181194
*
182-
* @return string
195+
* @return null|string
183196
*
184197
* @deprecated
185198
*/
@@ -191,7 +204,7 @@ public function getCode()
191204
/**
192205
* Sets code.
193206
*
194-
* @param string $code It is deprecated. Use the `input` field with proper `type` instead to specify the transformation code.
207+
* @param null|string $code It is deprecated. Use the `input` field with proper `type` instead to specify the transformation code.
195208
*
196209
* @return self
197210
*
@@ -204,6 +217,54 @@ public function setCode($code)
204217
return $this;
205218
}
206219

220+
/**
221+
* Gets type.
222+
*
223+
* @return null|TransformationType
224+
*/
225+
public function getType()
226+
{
227+
return $this->container['type'] ?? null;
228+
}
229+
230+
/**
231+
* Sets type.
232+
*
233+
* @param null|TransformationType $type type
234+
*
235+
* @return self
236+
*/
237+
public function setType($type)
238+
{
239+
$this->container['type'] = $type;
240+
241+
return $this;
242+
}
243+
244+
/**
245+
* Gets input.
246+
*
247+
* @return null|TransformationInput
248+
*/
249+
public function getInput()
250+
{
251+
return $this->container['input'] ?? null;
252+
}
253+
254+
/**
255+
* Sets input.
256+
*
257+
* @param null|TransformationInput $input input
258+
*
259+
* @return self
260+
*/
261+
public function setInput($input)
262+
{
263+
$this->container['input'] = $input;
264+
265+
return $this;
266+
}
267+
207268
/**
208269
* Gets sampleRecord.
209270
*

0 commit comments

Comments
 (0)