Skip to content

Commit

Permalink
fix(specs): correct query params for ingestion [skip-bc] (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#3830

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
Co-authored-by: Pierre Millot <pierre.millot@algolia.com>
Co-authored-by: shortcuts <vannicattec@gmail.com>
  • Loading branch information
3 people committed Sep 25, 2024
1 parent 440b369 commit 8ef8240
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
17 changes: 10 additions & 7 deletions src/main/scala/algoliasearch/api/IngestionClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/algoliasearch/ingestion/JsonSupport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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[_]]() :+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
)
Expand Down

0 comments on commit 8ef8240

Please sign in to comment.