From 8ef8240c00b411adb2ccf399e30759941ff634af Mon Sep 17 00:00:00 2001 From: algolia-bot Date: Wed, 25 Sep 2024 11:00:52 +0000 Subject: [PATCH] fix(specs): correct query params for ingestion [skip-bc] (generated) https://github.com/algolia/api-clients-automation/pull/3830 Co-authored-by: algolia-bot Co-authored-by: Pierre Millot Co-authored-by: shortcuts --- .../algoliasearch/api/IngestionClient.scala | 17 ++++++----- .../ingestion/AuthenticationSortKeys.scala | 8 ++--- .../algoliasearch/ingestion/JsonSupport.scala | 2 +- ...eys.scala => TransformationSortKeys.scala} | 29 +++++++++---------- 4 files changed, 28 insertions(+), 28 deletions(-) rename src/main/scala/algoliasearch/ingestion/{SortKeys.scala => TransformationSortKeys.scala} (76%) diff --git a/src/main/scala/algoliasearch/api/IngestionClient.scala b/src/main/scala/algoliasearch/api/IngestionClient.scala index 8e4267d6..deaaece7 100644 --- a/src/main/scala/algoliasearch/api/IngestionClient.scala +++ b/src/main/scala/algoliasearch/api/IngestionClient.scala @@ -44,7 +44,6 @@ import algoliasearch.ingestion.RunSourcePayload import algoliasearch.ingestion.RunSourceResponse import algoliasearch.ingestion.RunStatus._ import algoliasearch.ingestion.RunType._ -import algoliasearch.ingestion.SortKeys._ import algoliasearch.ingestion.Source import algoliasearch.ingestion.SourceCreate import algoliasearch.ingestion.SourceCreateResponse @@ -68,6 +67,7 @@ import algoliasearch.ingestion.Transformation import algoliasearch.ingestion.TransformationCreate import algoliasearch.ingestion.TransformationCreateResponse import algoliasearch.ingestion.TransformationSearch +import algoliasearch.ingestion.TransformationSortKeys._ import algoliasearch.ingestion.TransformationTry import algoliasearch.ingestion.TransformationTryResponse import algoliasearch.ingestion.TransformationUpdateResponse @@ -780,9 +780,9 @@ class IngestionClient( * @param `type` * Type of authentication resource to retrieve. * @param platform - * Ecommerce platform for which to retrieve authentication resources. + * Ecommerce platform for which to retrieve authentications. * @param sort - * Property by which to sort the list of authentication resources. + * Property by which to sort the list of authentications. * @param order * Sort order of the response, ascending or descending. */ @@ -825,6 +825,8 @@ class IngestionClient( * Destination type. * @param authenticationID * Authentication ID used by destinations. + * @param transformationID + * Get the list of destinations used by a transformation. * @param sort * Property by which to sort the destinations. * @param order @@ -835,6 +837,7 @@ class IngestionClient( page: Option[Int] = None, `type`: Option[Seq[DestinationType]] = None, authenticationID: Option[Seq[String]] = None, + transformationID: Option[String] = None, sort: Option[DestinationSortKeys] = None, order: Option[OrderKeys] = None, requestOptions: Option[RequestOptions] = None @@ -848,6 +851,7 @@ class IngestionClient( .withQueryParameter("page", page) .withQueryParameter("type", `type`) .withQueryParameter("authenticationID", authenticationID) + .withQueryParameter("transformationID", transformationID) .withQueryParameter("sort", sort) .withQueryParameter("order", order) .build() @@ -981,8 +985,7 @@ class IngestionClient( * @param `type` * Source type. Some sources require authentication. * @param authenticationID - * Authentication IDs of the sources to retrieve. 'none' returns sources that doesn't have an authentication - * resource. + * Authentication IDs of the sources to retrieve. 'none' returns sources that doesn't have an authentication. * @param sort * Property by which to sort the list of sources. * @param order @@ -1136,14 +1139,14 @@ class IngestionClient( * @param page * Page number of the paginated API response. * @param sort - * Property by which to sort the list. + * Property by which to sort the list of transformations. * @param order * Sort order of the response, ascending or descending. */ def listTransformations( itemsPerPage: Option[Int] = None, page: Option[Int] = None, - sort: Option[SortKeys] = None, + sort: Option[TransformationSortKeys] = None, order: Option[OrderKeys] = None, requestOptions: Option[RequestOptions] = None )(implicit ec: ExecutionContext): Future[ListTransformationsResponse] = Future { diff --git a/src/main/scala/algoliasearch/ingestion/AuthenticationSortKeys.scala b/src/main/scala/algoliasearch/ingestion/AuthenticationSortKeys.scala index f62e3b15..5d1081e2 100644 --- a/src/main/scala/algoliasearch/ingestion/AuthenticationSortKeys.scala +++ b/src/main/scala/algoliasearch/ingestion/AuthenticationSortKeys.scala @@ -27,14 +27,14 @@ import org.json4s._ sealed trait AuthenticationSortKeys -/** Property by which to sort the list of authentication resources. +/** Property by which to sort the list of authentications. */ object AuthenticationSortKeys { case object Name extends AuthenticationSortKeys { override def toString = "name" } - case object AuthType extends AuthenticationSortKeys { - override def toString = "auth_type" + case object `Type` extends AuthenticationSortKeys { + override def toString = "type" } case object Platform extends AuthenticationSortKeys { override def toString = "platform" @@ -45,7 +45,7 @@ object AuthenticationSortKeys { case object CreatedAt extends AuthenticationSortKeys { override def toString = "createdAt" } - val values: Seq[AuthenticationSortKeys] = Seq(Name, AuthType, Platform, UpdatedAt, CreatedAt) + val values: Seq[AuthenticationSortKeys] = Seq(Name, `Type`, Platform, UpdatedAt, CreatedAt) def withName(name: String): AuthenticationSortKeys = AuthenticationSortKeys.values .find(_.toString == name) diff --git a/src/main/scala/algoliasearch/ingestion/JsonSupport.scala b/src/main/scala/algoliasearch/ingestion/JsonSupport.scala index 1c0d37ad..43e29187 100644 --- a/src/main/scala/algoliasearch/ingestion/JsonSupport.scala +++ b/src/main/scala/algoliasearch/ingestion/JsonSupport.scala @@ -55,12 +55,12 @@ object JsonSupport { new RunStatusSerializer() :+ new RunTypeSerializer() :+ new ScheduleTriggerTypeSerializer() :+ - new SortKeysSerializer() :+ new SourceSortKeysSerializer() :+ new SourceTypeSerializer() :+ new StreamingTriggerTypeSerializer() :+ new SubscriptionTriggerTypeSerializer() :+ new TaskSortKeysSerializer() :+ + new TransformationSortKeysSerializer() :+ new TriggerTypeSerializer() private def oneOfsSerializers: Seq[Serializer[_]] = Seq[Serializer[_]]() :+ diff --git a/src/main/scala/algoliasearch/ingestion/SortKeys.scala b/src/main/scala/algoliasearch/ingestion/TransformationSortKeys.scala similarity index 76% rename from src/main/scala/algoliasearch/ingestion/SortKeys.scala rename to src/main/scala/algoliasearch/ingestion/TransformationSortKeys.scala index 3ad08a2c..2783b773 100644 --- a/src/main/scala/algoliasearch/ingestion/SortKeys.scala +++ b/src/main/scala/algoliasearch/ingestion/TransformationSortKeys.scala @@ -25,38 +25,35 @@ package algoliasearch.ingestion import org.json4s._ -sealed trait SortKeys +sealed trait TransformationSortKeys -/** Property by which to sort the list. +/** Property by which to sort the list of transformations. */ -object SortKeys { - case object Name extends SortKeys { +object TransformationSortKeys { + case object Name extends TransformationSortKeys { override def toString = "name" } - case object `Type` extends SortKeys { - override def toString = "type" - } - case object UpdatedAt extends SortKeys { + case object UpdatedAt extends TransformationSortKeys { override def toString = "updatedAt" } - case object CreatedAt extends SortKeys { + case object CreatedAt extends TransformationSortKeys { override def toString = "createdAt" } - val values: Seq[SortKeys] = Seq(Name, `Type`, UpdatedAt, CreatedAt) + val values: Seq[TransformationSortKeys] = Seq(Name, UpdatedAt, CreatedAt) - def withName(name: String): SortKeys = SortKeys.values + def withName(name: String): TransformationSortKeys = TransformationSortKeys.values .find(_.toString == name) - .getOrElse(throw new MappingException(s"Unknown SortKeys value: $name")) + .getOrElse(throw new MappingException(s"Unknown TransformationSortKeys value: $name")) } -class SortKeysSerializer - extends CustomSerializer[SortKeys](_ => +class TransformationSortKeysSerializer + extends CustomSerializer[TransformationSortKeys](_ => ( { - case JString(value) => SortKeys.withName(value) + case JString(value) => TransformationSortKeys.withName(value) case JNull => null }, - { case value: SortKeys => + { case value: TransformationSortKeys => JString(value.toString) } )