Skip to content

Commit 05af6cd

Browse files
algolia-botkai687shortcuts
committed
fix(specs): dictionary entry for stopwords has type property (generated)
algolia/api-clients-automation#3456 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Kai Welke <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent d13f700 commit 05af6cd

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

client/src/commonMain/kotlin/com/algolia/client/model/search/DictionaryEntry.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import kotlinx.serialization.json.*
1616
* @param words Matching words in the `plurals` dictionary including declensions.
1717
* @param decomposition Invividual components of a compound word in the `compounds` dictionary.
1818
* @param state
19+
* @param type
1920
*/
2021
@Serializable(DictionaryEntrySerializer::class)
2122
public data class DictionaryEntry(
@@ -36,6 +37,8 @@ public data class DictionaryEntry(
3637

3738
val state: DictionaryEntryState? = null,
3839

40+
val type: DictionaryEntryType? = null,
41+
3942
val additionalProperties: Map<String, JsonElement>? = null,
4043
)
4144

@@ -48,6 +51,7 @@ internal object DictionaryEntrySerializer : KSerializer<DictionaryEntry> {
4851
element<List<String>>("words", isOptional = true)
4952
element<List<String>>("decomposition", isOptional = true)
5053
element<DictionaryEntryState>("state", isOptional = true)
54+
element<DictionaryEntryType>("type", isOptional = true)
5155
}
5256

5357
override fun deserialize(decoder: Decoder): DictionaryEntry {
@@ -60,6 +64,7 @@ internal object DictionaryEntrySerializer : KSerializer<DictionaryEntry> {
6064
words = tree["words"]?.let { input.json.decodeFromJsonElement(it) },
6165
decomposition = tree["decomposition"]?.let { input.json.decodeFromJsonElement(it) },
6266
state = tree["state"]?.let { input.json.decodeFromJsonElement(it) },
67+
type = tree["type"]?.let { input.json.decodeFromJsonElement(it) },
6368
additionalProperties = tree.filterKeys { it !in descriptor.elementNames },
6469
)
6570
}
@@ -73,6 +78,7 @@ internal object DictionaryEntrySerializer : KSerializer<DictionaryEntry> {
7378
value.words?.let { put("words", output.json.encodeToJsonElement(it)) }
7479
value.decomposition?.let { put("decomposition", output.json.encodeToJsonElement(it)) }
7580
value.state?.let { put("state", output.json.encodeToJsonElement(it)) }
81+
value.type?.let { put("type", output.json.encodeToJsonElement(it)) }
7682
value.additionalProperties?.onEach { (key, element) -> put(key, element) }
7783
}
7884
(encoder as JsonEncoder).encodeJsonElement(json)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/** 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. */
2+
package com.algolia.client.model.search
3+
4+
import kotlinx.serialization.*
5+
6+
/**
7+
* Whether a dictionary entry is provided by Algolia (standard), or has been added by you (custom).
8+
*/
9+
@Serializable
10+
public enum class DictionaryEntryType(public val value: kotlin.String) {
11+
12+
@SerialName(value = "custom")
13+
Custom("custom"),
14+
15+
@SerialName(value = "standard")
16+
Standard("standard");
17+
18+
override fun toString(): kotlin.String = value
19+
}

0 commit comments

Comments
 (0)