Skip to content

Commit dfb2aa7

Browse files
algolia-botkai687millotp
committed
fix(specs): required prop for dictionaryEntry (#3449) (generated) [skip ci]
Co-authored-by: Kai Welke <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent 9a2e7a8 commit dfb2aa7

File tree

37 files changed

+94
-297
lines changed

37 files changed

+94
-297
lines changed

clients/algoliasearch-client-csharp/algoliasearch/Models/Search/DictionaryEntry.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ public DictionaryEntry()
4040
/// Initializes a new instance of the DictionaryEntry class.
4141
/// </summary>
4242
/// <param name="objectID">Unique identifier for the dictionary entry. (required).</param>
43-
/// <param name="language">language (required).</param>
44-
public DictionaryEntry(string objectID, SupportedLanguage? language)
43+
public DictionaryEntry(string objectID)
4544
{
4645
ObjectID = objectID ?? throw new ArgumentNullException(nameof(objectID));
47-
Language = language;
4846
AdditionalProperties = new Dictionary<string, object>();
4947
}
5048

clients/algoliasearch-client-dart/packages/client_search/lib/src/model/dictionary_entry.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ final class DictionaryEntry extends DelegatingMap<String, dynamic> {
1313
/// Returns a new [DictionaryEntry] instance.
1414
const DictionaryEntry({
1515
required this.objectID,
16-
required this.language,
16+
this.language,
1717
this.word,
1818
this.words,
1919
this.decomposition,
@@ -26,7 +26,7 @@ final class DictionaryEntry extends DelegatingMap<String, dynamic> {
2626
final String objectID;
2727

2828
@JsonKey(name: r'language')
29-
final SupportedLanguage language;
29+
final SupportedLanguage? language;
3030

3131
/// Matching dictionary word for `stopwords` and `compounds` dictionaries.
3232
@JsonKey(name: r'word')

clients/algoliasearch-client-dart/packages/client_search/lib/src/model/dictionary_entry.g.dart

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/algoliasearch-client-go/algolia/search/model_dictionary_entry.go

Lines changed: 27 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/DictionaryEntry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public DictionaryEntry setLanguage(SupportedLanguage language) {
6262
}
6363

6464
/** Get language */
65-
@javax.annotation.Nonnull
65+
@javax.annotation.Nullable
6666
public SupportedLanguage getLanguage() {
6767
return language;
6868
}

clients/algoliasearch-client-javascript/packages/client-search/model/dictionaryEntry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export type DictionaryEntry = Record<string, any> & {
1212
*/
1313
objectID: string;
1414

15-
language: SupportedLanguage;
15+
language?: SupportedLanguage;
1616

1717
/**
1818
* Matching dictionary word for `stopwords` and `compounds` dictionaries.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public data class DictionaryEntry(
2323
/** Unique identifier for the dictionary entry. */
2424
val objectID: String,
2525

26-
val language: SupportedLanguage,
26+
val language: SupportedLanguage? = null,
2727

2828
/** Matching dictionary word for `stopwords` and `compounds` dictionaries. */
2929
val word: String? = null,
@@ -43,7 +43,7 @@ internal object DictionaryEntrySerializer : KSerializer<DictionaryEntry> {
4343

4444
override val descriptor: SerialDescriptor = buildClassSerialDescriptor("DictionaryEntry") {
4545
element<String>("objectID")
46-
element<SupportedLanguage>("language")
46+
element<SupportedLanguage>("language", isOptional = true)
4747
element<String>("word", isOptional = true)
4848
element<List<String>>("words", isOptional = true)
4949
element<List<String>>("decomposition", isOptional = true)
@@ -55,7 +55,7 @@ internal object DictionaryEntrySerializer : KSerializer<DictionaryEntry> {
5555
val tree = input.decodeJsonObject()
5656
return DictionaryEntry(
5757
objectID = tree.getValue("objectID").let { input.json.decodeFromJsonElement(it) },
58-
language = tree.getValue("language").let { input.json.decodeFromJsonElement(it) },
58+
language = tree["language"]?.let { input.json.decodeFromJsonElement(it) },
5959
word = tree["word"]?.let { input.json.decodeFromJsonElement(it) },
6060
words = tree["words"]?.let { input.json.decodeFromJsonElement(it) },
6161
decomposition = tree["decomposition"]?.let { input.json.decodeFromJsonElement(it) },
@@ -68,7 +68,7 @@ internal object DictionaryEntrySerializer : KSerializer<DictionaryEntry> {
6868
val output = encoder.asJsonEncoder()
6969
val json = buildJsonObject {
7070
put("objectID", output.json.encodeToJsonElement(value.objectID))
71-
put("language", output.json.encodeToJsonElement(value.language))
71+
value.language?.let { put("language", output.json.encodeToJsonElement(it)) }
7272
value.word?.let { put("word", output.json.encodeToJsonElement(it)) }
7373
value.words?.let { put("words", output.json.encodeToJsonElement(it)) }
7474
value.decomposition?.let { put("decomposition", output.json.encodeToJsonElement(it)) }

clients/algoliasearch-client-php/lib/Model/Search/DictionaryEntry.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,6 @@ public function listInvalidProperties()
183183
if (!isset($this->container['objectID']) || null === $this->container['objectID']) {
184184
$invalidProperties[] = "'objectID' can't be null";
185185
}
186-
if (!isset($this->container['language']) || null === $this->container['language']) {
187-
$invalidProperties[] = "'language' can't be null";
188-
}
189186

190187
return $invalidProperties;
191188
}
@@ -228,7 +225,7 @@ public function setObjectID($objectID)
228225
/**
229226
* Gets language.
230227
*
231-
* @return SupportedLanguage
228+
* @return null|SupportedLanguage
232229
*/
233230
public function getLanguage()
234231
{
@@ -238,7 +235,7 @@ public function getLanguage()
238235
/**
239236
* Sets language.
240237
*
241-
* @param SupportedLanguage $language language
238+
* @param null|SupportedLanguage $language language
242239
*
243240
* @return self
244241
*/

clients/algoliasearch-client-python/algoliasearch/search/models/dictionary_entry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class DictionaryEntry(BaseModel):
2323
object_id: StrictStr = Field(
2424
description="Unique identifier for the dictionary entry.", alias="objectID"
2525
)
26-
language: SupportedLanguage
26+
language: Optional[SupportedLanguage] = None
2727
word: Optional[StrictStr] = Field(
2828
default=None,
2929
description="Matching dictionary word for `stopwords` and `compounds` dictionaries.",

clients/algoliasearch-client-ruby/lib/algolia/models/search/dictionary_entry.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ def initialize(attributes = {})
101101

102102
if attributes.key?(:language)
103103
self.language = attributes[:language]
104-
else
105-
self.language = nil
106104
end
107105

108106
if attributes.key?(:word)

0 commit comments

Comments
 (0)