-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(specs): make the searchParams compatible with v4 [skip-bc] (gener…
…ated) algolia/api-clients-automation#4108 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
- Loading branch information
1 parent
fe4a888
commit db1b3c7
Showing
15 changed files
with
250 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 8 additions & 10 deletions
18
client/src/commonMain/kotlin/com/algolia/client/model/recommend/FallbackParams.kt
Large diffs are not rendered by default.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
client/src/commonMain/kotlin/com/algolia/client/model/recommend/InsideBoundingBox.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ | ||
package com.algolia.client.model.recommend | ||
|
||
import com.algolia.client.exception.AlgoliaClientException | ||
import com.algolia.client.extensions.internal.* | ||
import kotlinx.serialization.* | ||
import kotlinx.serialization.builtins.* | ||
import kotlinx.serialization.descriptors.* | ||
import kotlinx.serialization.encoding.* | ||
import kotlinx.serialization.json.* | ||
import kotlin.jvm.JvmInline | ||
|
||
/** | ||
* InsideBoundingBox | ||
* | ||
* Implementations: | ||
* - [List<List<Double>>] - *[InsideBoundingBox.of]* | ||
* - [String] - *[InsideBoundingBox.of]* | ||
*/ | ||
@Serializable(InsideBoundingBoxSerializer::class) | ||
public sealed interface InsideBoundingBox { | ||
@Serializable | ||
@JvmInline | ||
public value class StringValue(public val value: String) : InsideBoundingBox | ||
|
||
@Serializable | ||
@JvmInline | ||
public value class ListOfListOfDoubleValue(public val value: List<List<Double>>) : InsideBoundingBox | ||
|
||
public companion object { | ||
|
||
public fun of(value: String): InsideBoundingBox { | ||
return StringValue(value) | ||
} | ||
public fun of(value: List<List<Double>>): InsideBoundingBox { | ||
return ListOfListOfDoubleValue(value) | ||
} | ||
} | ||
} | ||
|
||
internal class InsideBoundingBoxSerializer : JsonContentPolymorphicSerializer<InsideBoundingBox>(InsideBoundingBox::class) { | ||
override fun selectDeserializer(element: JsonElement): DeserializationStrategy<InsideBoundingBox> { | ||
return when { | ||
element.isString -> InsideBoundingBox.StringValue.serializer() | ||
element is JsonArray -> InsideBoundingBox.ListOfListOfDoubleValue.serializer() | ||
else -> throw AlgoliaClientException("Failed to deserialize json element: $element") | ||
} | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
client/src/commonMain/kotlin/com/algolia/client/model/recommend/OptionalWords.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */ | ||
package com.algolia.client.model.recommend | ||
|
||
import com.algolia.client.exception.AlgoliaClientException | ||
import com.algolia.client.extensions.internal.* | ||
import kotlinx.serialization.* | ||
import kotlinx.serialization.builtins.* | ||
import kotlinx.serialization.descriptors.* | ||
import kotlinx.serialization.encoding.* | ||
import kotlinx.serialization.json.* | ||
import kotlin.jvm.JvmInline | ||
|
||
/** | ||
* OptionalWords | ||
* | ||
* Implementations: | ||
* - [List<String>] - *[OptionalWords.of]* | ||
* - [String] - *[OptionalWords.of]* | ||
*/ | ||
@Serializable(OptionalWordsSerializer::class) | ||
public sealed interface OptionalWords { | ||
@Serializable | ||
@JvmInline | ||
public value class StringValue(public val value: String) : OptionalWords | ||
|
||
@Serializable | ||
@JvmInline | ||
public value class ListOfStringValue(public val value: List<String>) : OptionalWords | ||
|
||
public companion object { | ||
|
||
public fun of(value: String): OptionalWords { | ||
return StringValue(value) | ||
} | ||
public fun of(value: List<String>): OptionalWords { | ||
return ListOfStringValue(value) | ||
} | ||
} | ||
} | ||
|
||
internal class OptionalWordsSerializer : JsonContentPolymorphicSerializer<OptionalWords>(OptionalWords::class) { | ||
override fun selectDeserializer(element: JsonElement): DeserializationStrategy<OptionalWords> { | ||
return when { | ||
element.isString -> OptionalWords.StringValue.serializer() | ||
element is JsonArray -> OptionalWords.ListOfStringValue.serializer() | ||
else -> throw AlgoliaClientException("Failed to deserialize json element: $element") | ||
} | ||
} | ||
} |
18 changes: 8 additions & 10 deletions
18
client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendSearchParams.kt
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.