Skip to content

Commit fe9e9af

Browse files
feat(specs): add authentications to ingestion transformations (generated)
algolia/api-clients-automation#3494 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 111beca commit fe9e9af

File tree

4 files changed

+152
-1
lines changed

4 files changed

+152
-1
lines changed

lib/Api/IngestionClient.php

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ public function createTaskV1($taskCreate, $requestOptions = [])
309309
* - $transformationCreate['code'] => (string) The source code of the transformation. (required)
310310
* - $transformationCreate['name'] => (string) The uniquely identified name of your transformation. (required)
311311
* - $transformationCreate['description'] => (string) A descriptive name for your transformation of what it does.
312+
* - $transformationCreate['authenticationIDs'] => (array) The authentications associated for the current transformation.
312313
*
313314
* @see TransformationCreate
314315
*
@@ -2275,7 +2276,7 @@ public function triggerDockerSourceDiscover($sourceID, $requestOptions = [])
22752276
}
22762277

22772278
/**
2278-
* Try a transformation.
2279+
* Try a transformation before creating it.
22792280
*
22802281
* Required API Key ACLs:
22812282
* - addObject
@@ -2285,6 +2286,7 @@ public function triggerDockerSourceDiscover($sourceID, $requestOptions = [])
22852286
* @param array $transformationTry transformationTry (required)
22862287
* - $transformationTry['code'] => (string) The source code of the transformation. (required)
22872288
* - $transformationTry['sampleRecord'] => (array) The record to apply the given code to. (required)
2289+
* - $transformationTry['authentications'] => (array)
22882290
*
22892291
* @see TransformationTry
22902292
*
@@ -2309,6 +2311,58 @@ public function tryTransformation($transformationTry, $requestOptions = [])
23092311
return $this->sendRequest('POST', $resourcePath, $headers, $queryParameters, $httpBody, $requestOptions);
23102312
}
23112313

2314+
/**
2315+
* Try a transformation before updating it.
2316+
*
2317+
* Required API Key ACLs:
2318+
* - addObject
2319+
* - deleteIndex
2320+
* - editSettings
2321+
*
2322+
* @param string $transformationID Unique identifier of a transformation. (required)
2323+
* @param array $transformationTry transformationTry (required)
2324+
* - $transformationTry['code'] => (string) The source code of the transformation. (required)
2325+
* - $transformationTry['sampleRecord'] => (array) The record to apply the given code to. (required)
2326+
* - $transformationTry['authentications'] => (array)
2327+
*
2328+
* @see TransformationTry
2329+
*
2330+
* @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions
2331+
*
2332+
* @return \Algolia\AlgoliaSearch\Model\Ingestion\TransformationTryResponse|array<string, mixed>
2333+
*/
2334+
public function tryTransformationBeforeUpdate($transformationID, $transformationTry, $requestOptions = [])
2335+
{
2336+
// verify the required parameter 'transformationID' is set
2337+
if (!isset($transformationID)) {
2338+
throw new \InvalidArgumentException(
2339+
'Parameter `transformationID` is required when calling `tryTransformationBeforeUpdate`.'
2340+
);
2341+
}
2342+
// verify the required parameter 'transformationTry' is set
2343+
if (!isset($transformationTry)) {
2344+
throw new \InvalidArgumentException(
2345+
'Parameter `transformationTry` is required when calling `tryTransformationBeforeUpdate`.'
2346+
);
2347+
}
2348+
2349+
$resourcePath = '/1/transformations/{transformationID}/try';
2350+
$queryParameters = [];
2351+
$headers = [];
2352+
$httpBody = $transformationTry;
2353+
2354+
// path params
2355+
if (null !== $transformationID) {
2356+
$resourcePath = str_replace(
2357+
'{transformationID}',
2358+
ObjectSerializer::toPathValue($transformationID),
2359+
$resourcePath
2360+
);
2361+
}
2362+
2363+
return $this->sendRequest('POST', $resourcePath, $headers, $queryParameters, $httpBody, $requestOptions);
2364+
}
2365+
23122366
/**
23132367
* Updates an authentication resource.
23142368
*
@@ -2574,6 +2628,7 @@ public function updateTaskV1($taskID, $taskUpdate, $requestOptions = [])
25742628
* - $transformationCreate['code'] => (string) The source code of the transformation. (required)
25752629
* - $transformationCreate['name'] => (string) The uniquely identified name of your transformation. (required)
25762630
* - $transformationCreate['description'] => (string) A descriptive name for your transformation of what it does.
2631+
* - $transformationCreate['authenticationIDs'] => (array) The authentications associated for the current transformation.
25772632
*
25782633
* @see TransformationCreate
25792634
*

lib/Model/Ingestion/Transformation.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class Transformation extends AbstractModel implements ModelInterface, \ArrayAcce
2020
*/
2121
protected static $modelTypes = [
2222
'transformationID' => 'string',
23+
'authenticationIDs' => 'string[]',
2324
'code' => 'string',
2425
'name' => 'string',
2526
'description' => 'string',
@@ -34,6 +35,7 @@ class Transformation extends AbstractModel implements ModelInterface, \ArrayAcce
3435
*/
3536
protected static $modelFormats = [
3637
'transformationID' => null,
38+
'authenticationIDs' => null,
3739
'code' => null,
3840
'name' => null,
3941
'description' => null,
@@ -49,6 +51,7 @@ class Transformation extends AbstractModel implements ModelInterface, \ArrayAcce
4951
*/
5052
protected static $attributeMap = [
5153
'transformationID' => 'transformationID',
54+
'authenticationIDs' => 'authenticationIDs',
5255
'code' => 'code',
5356
'name' => 'name',
5457
'description' => 'description',
@@ -63,6 +66,7 @@ class Transformation extends AbstractModel implements ModelInterface, \ArrayAcce
6366
*/
6467
protected static $setters = [
6568
'transformationID' => 'setTransformationID',
69+
'authenticationIDs' => 'setAuthenticationIDs',
6670
'code' => 'setCode',
6771
'name' => 'setName',
6872
'description' => 'setDescription',
@@ -77,6 +81,7 @@ class Transformation extends AbstractModel implements ModelInterface, \ArrayAcce
7781
*/
7882
protected static $getters = [
7983
'transformationID' => 'getTransformationID',
84+
'authenticationIDs' => 'getAuthenticationIDs',
8085
'code' => 'getCode',
8186
'name' => 'getName',
8287
'description' => 'getDescription',
@@ -101,6 +106,9 @@ public function __construct(?array $data = null)
101106
if (isset($data['transformationID'])) {
102107
$this->container['transformationID'] = $data['transformationID'];
103108
}
109+
if (isset($data['authenticationIDs'])) {
110+
$this->container['authenticationIDs'] = $data['authenticationIDs'];
111+
}
104112
if (isset($data['code'])) {
105113
$this->container['code'] = $data['code'];
106114
}
@@ -229,6 +237,30 @@ public function setTransformationID($transformationID)
229237
return $this;
230238
}
231239

240+
/**
241+
* Gets authenticationIDs.
242+
*
243+
* @return null|string[]
244+
*/
245+
public function getAuthenticationIDs()
246+
{
247+
return $this->container['authenticationIDs'] ?? null;
248+
}
249+
250+
/**
251+
* Sets authenticationIDs.
252+
*
253+
* @param null|string[] $authenticationIDs the authentications associated for the current transformation
254+
*
255+
* @return self
256+
*/
257+
public function setAuthenticationIDs($authenticationIDs)
258+
{
259+
$this->container['authenticationIDs'] = $authenticationIDs;
260+
261+
return $this;
262+
}
263+
232264
/**
233265
* Gets code.
234266
*

lib/Model/Ingestion/TransformationCreate.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class TransformationCreate extends AbstractModel implements ModelInterface, \Arr
2424
'code' => 'string',
2525
'name' => 'string',
2626
'description' => 'string',
27+
'authenticationIDs' => 'string[]',
2728
];
2829

2930
/**
@@ -35,6 +36,7 @@ class TransformationCreate extends AbstractModel implements ModelInterface, \Arr
3536
'code' => null,
3637
'name' => null,
3738
'description' => null,
39+
'authenticationIDs' => null,
3840
];
3941

4042
/**
@@ -47,6 +49,7 @@ class TransformationCreate extends AbstractModel implements ModelInterface, \Arr
4749
'code' => 'code',
4850
'name' => 'name',
4951
'description' => 'description',
52+
'authenticationIDs' => 'authenticationIDs',
5053
];
5154

5255
/**
@@ -58,6 +61,7 @@ class TransformationCreate extends AbstractModel implements ModelInterface, \Arr
5861
'code' => 'setCode',
5962
'name' => 'setName',
6063
'description' => 'setDescription',
64+
'authenticationIDs' => 'setAuthenticationIDs',
6165
];
6266

6367
/**
@@ -69,6 +73,7 @@ class TransformationCreate extends AbstractModel implements ModelInterface, \Arr
6973
'code' => 'getCode',
7074
'name' => 'getName',
7175
'description' => 'getDescription',
76+
'authenticationIDs' => 'getAuthenticationIDs',
7277
];
7378

7479
/**
@@ -94,6 +99,9 @@ public function __construct(?array $data = null)
9499
if (isset($data['description'])) {
95100
$this->container['description'] = $data['description'];
96101
}
102+
if (isset($data['authenticationIDs'])) {
103+
$this->container['authenticationIDs'] = $data['authenticationIDs'];
104+
}
97105
}
98106

99107
/**
@@ -249,6 +257,30 @@ public function setDescription($description)
249257
return $this;
250258
}
251259

260+
/**
261+
* Gets authenticationIDs.
262+
*
263+
* @return null|string[]
264+
*/
265+
public function getAuthenticationIDs()
266+
{
267+
return $this->container['authenticationIDs'] ?? null;
268+
}
269+
270+
/**
271+
* Sets authenticationIDs.
272+
*
273+
* @param null|string[] $authenticationIDs the authentications associated for the current transformation
274+
*
275+
* @return self
276+
*/
277+
public function setAuthenticationIDs($authenticationIDs)
278+
{
279+
$this->container['authenticationIDs'] = $authenticationIDs;
280+
281+
return $this;
282+
}
283+
252284
/**
253285
* Returns true if offset exists. False otherwise.
254286
*

lib/Model/Ingestion/TransformationTry.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class TransformationTry extends AbstractModel implements ModelInterface, \ArrayA
2121
protected static $modelTypes = [
2222
'code' => 'string',
2323
'sampleRecord' => 'object',
24+
'authentications' => '\Algolia\AlgoliaSearch\Model\Ingestion\AuthenticationCreate[]',
2425
];
2526

2627
/**
@@ -31,6 +32,7 @@ class TransformationTry extends AbstractModel implements ModelInterface, \ArrayA
3132
protected static $modelFormats = [
3233
'code' => null,
3334
'sampleRecord' => null,
35+
'authentications' => null,
3436
];
3537

3638
/**
@@ -42,6 +44,7 @@ class TransformationTry extends AbstractModel implements ModelInterface, \ArrayA
4244
protected static $attributeMap = [
4345
'code' => 'code',
4446
'sampleRecord' => 'sampleRecord',
47+
'authentications' => 'authentications',
4548
];
4649

4750
/**
@@ -52,6 +55,7 @@ class TransformationTry extends AbstractModel implements ModelInterface, \ArrayA
5255
protected static $setters = [
5356
'code' => 'setCode',
5457
'sampleRecord' => 'setSampleRecord',
58+
'authentications' => 'setAuthentications',
5559
];
5660

5761
/**
@@ -62,6 +66,7 @@ class TransformationTry extends AbstractModel implements ModelInterface, \ArrayA
6266
protected static $getters = [
6367
'code' => 'getCode',
6468
'sampleRecord' => 'getSampleRecord',
69+
'authentications' => 'getAuthentications',
6570
];
6671

6772
/**
@@ -84,6 +89,9 @@ public function __construct(?array $data = null)
8489
if (isset($data['sampleRecord'])) {
8590
$this->container['sampleRecord'] = $data['sampleRecord'];
8691
}
92+
if (isset($data['authentications'])) {
93+
$this->container['authentications'] = $data['authentications'];
94+
}
8795
}
8896

8997
/**
@@ -215,6 +223,30 @@ public function setSampleRecord($sampleRecord)
215223
return $this;
216224
}
217225

226+
/**
227+
* Gets authentications.
228+
*
229+
* @return null|\Algolia\AlgoliaSearch\Model\Ingestion\AuthenticationCreate[]
230+
*/
231+
public function getAuthentications()
232+
{
233+
return $this->container['authentications'] ?? null;
234+
}
235+
236+
/**
237+
* Sets authentications.
238+
*
239+
* @param null|\Algolia\AlgoliaSearch\Model\Ingestion\AuthenticationCreate[] $authentications authentications
240+
*
241+
* @return self
242+
*/
243+
public function setAuthentications($authentications)
244+
{
245+
$this->container['authentications'] = $authentications;
246+
247+
return $this;
248+
}
249+
218250
/**
219251
* Returns true if offset exists. False otherwise.
220252
*

0 commit comments

Comments
 (0)