Skip to content

Commit f717292

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 c06af3c commit f717292

File tree

4 files changed

+43
-3
lines changed

4 files changed

+43
-3
lines changed

src/main/scala/algoliasearch/api/IngestionClient.scala

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1460,7 +1460,7 @@ class IngestionClient(
14601460
execute[SourceWatchResponse](request, requestOptions)
14611461
}
14621462

1463-
/** Try a transformation.
1463+
/** Try a transformation before creating it.
14641464
*
14651465
* Required API Key ACLs:
14661466
* - addObject
@@ -1481,6 +1481,39 @@ class IngestionClient(
14811481
execute[TransformationTryResponse](request, requestOptions)
14821482
}
14831483

1484+
/** Try a transformation before updating it.
1485+
*
1486+
* Required API Key ACLs:
1487+
* - addObject
1488+
* - deleteIndex
1489+
* - editSettings
1490+
*
1491+
* @param transformationID
1492+
* Unique identifier of a transformation.
1493+
*/
1494+
def tryTransformationBeforeUpdate(
1495+
transformationID: String,
1496+
transformationTry: TransformationTry,
1497+
requestOptions: Option[RequestOptions] = None
1498+
)(implicit ec: ExecutionContext): Future[TransformationTryResponse] = Future {
1499+
requireNotNull(
1500+
transformationID,
1501+
"Parameter `transformationID` is required when calling `tryTransformationBeforeUpdate`."
1502+
)
1503+
requireNotNull(
1504+
transformationTry,
1505+
"Parameter `transformationTry` is required when calling `tryTransformationBeforeUpdate`."
1506+
)
1507+
1508+
val request = HttpRequest
1509+
.builder()
1510+
.withMethod("POST")
1511+
.withPath(s"/1/transformations/${escape(transformationID)}/try")
1512+
.withBody(transformationTry)
1513+
.build()
1514+
execute[TransformationTryResponse](request, requestOptions)
1515+
}
1516+
14841517
/** Updates an authentication resource.
14851518
*
14861519
* Required API Key ACLs:

src/main/scala/algoliasearch/ingestion/Transformation.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ package algoliasearch.ingestion
2727
*
2828
* @param transformationID
2929
* Universally unique identifier (UUID) of a transformation.
30+
* @param authenticationIDs
31+
* The authentications associated for the current transformation.
3032
* @param code
3133
* The source code of the transformation.
3234
* @param name
@@ -40,6 +42,7 @@ package algoliasearch.ingestion
4042
*/
4143
case class Transformation(
4244
transformationID: String,
45+
authenticationIDs: Option[Seq[String]] = scala.None,
4346
code: String,
4447
name: String,
4548
description: Option[String] = scala.None,

src/main/scala/algoliasearch/ingestion/TransformationCreate.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,12 @@ package algoliasearch.ingestion
3131
* The uniquely identified name of your transformation.
3232
* @param description
3333
* A descriptive name for your transformation of what it does.
34+
* @param authenticationIDs
35+
* The authentications associated for the current transformation.
3436
*/
3537
case class TransformationCreate(
3638
code: String,
3739
name: String,
38-
description: Option[String] = scala.None
40+
description: Option[String] = scala.None,
41+
authenticationIDs: Option[Seq[String]] = scala.None
3942
)

src/main/scala/algoliasearch/ingestion/TransformationTry.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@ package algoliasearch.ingestion
3232
*/
3333
case class TransformationTry(
3434
code: String,
35-
sampleRecord: Any
35+
sampleRecord: Any,
36+
authentications: Option[Seq[AuthenticationCreate]] = scala.None
3637
)

0 commit comments

Comments
 (0)