Skip to content

Commit a0b7eff

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 42fa429 commit a0b7eff

File tree

5 files changed

+46
-0
lines changed

5 files changed

+46
-0
lines changed

packages/client_search/lib/algolia_client_search.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export 'src/model/deleted_at_response.dart';
4747
export 'src/model/dictionary_action.dart';
4848
export 'src/model/dictionary_entry.dart';
4949
export 'src/model/dictionary_entry_state.dart';
50+
export 'src/model/dictionary_entry_type.dart';
5051
export 'src/model/dictionary_language.dart';
5152
export 'src/model/dictionary_settings_params.dart';
5253
export 'src/model/dictionary_type.dart';

packages/client_search/lib/src/deserialize.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import 'package:algolia_client_search/src/model/deleted_at_response.dart';
4040
import 'package:algolia_client_search/src/model/dictionary_action.dart';
4141
import 'package:algolia_client_search/src/model/dictionary_entry.dart';
4242
import 'package:algolia_client_search/src/model/dictionary_entry_state.dart';
43+
import 'package:algolia_client_search/src/model/dictionary_entry_type.dart';
4344
import 'package:algolia_client_search/src/model/dictionary_language.dart';
4445
import 'package:algolia_client_search/src/model/dictionary_settings_params.dart';
4546
import 'package:algolia_client_search/src/model/dictionary_type.dart';
@@ -278,6 +279,8 @@ ReturnType deserialize<ReturnType, BaseType>(dynamic value, String targetType,
278279
as ReturnType;
279280
case 'DictionaryEntryState':
280281
return DictionaryEntryState.fromJson(value) as ReturnType;
282+
case 'DictionaryEntryType':
283+
return DictionaryEntryType.fromJson(value) as ReturnType;
281284
case 'DictionaryLanguage':
282285
return DictionaryLanguage.fromJson(value as Map<String, dynamic>)
283286
as ReturnType;

packages/client_search/lib/src/model/dictionary_entry.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// 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.
22
// ignore_for_file: unused_element
33
import 'package:algolia_client_search/src/model/supported_language.dart';
4+
import 'package:algolia_client_search/src/model/dictionary_entry_type.dart';
45
import 'package:algolia_client_search/src/model/dictionary_entry_state.dart';
56

67
import 'package:collection/collection.dart';
@@ -18,6 +19,7 @@ final class DictionaryEntry extends DelegatingMap<String, dynamic> {
1819
this.words,
1920
this.decomposition,
2021
this.state,
22+
this.type,
2123
Map<String, dynamic> additionalProperties = const {},
2224
}) : super(additionalProperties);
2325

@@ -43,6 +45,9 @@ final class DictionaryEntry extends DelegatingMap<String, dynamic> {
4345
@JsonKey(name: r'state')
4446
final DictionaryEntryState? state;
4547

48+
@JsonKey(name: r'type')
49+
final DictionaryEntryType? type;
50+
4651
@override
4752
bool operator ==(Object other) =>
4853
identical(this, other) ||
@@ -53,6 +58,7 @@ final class DictionaryEntry extends DelegatingMap<String, dynamic> {
5358
other.words == words &&
5459
other.decomposition == decomposition &&
5560
other.state == state &&
61+
other.type == type &&
5662
const MapEquality<String, dynamic>().equals(this, this);
5763

5864
@override
@@ -63,6 +69,7 @@ final class DictionaryEntry extends DelegatingMap<String, dynamic> {
6369
words.hashCode +
6470
decomposition.hashCode +
6571
state.hashCode +
72+
type.hashCode +
6673
const MapEquality<String, dynamic>().hash(this);
6774

6875
factory DictionaryEntry.fromJson(Map<String, dynamic> json) {
@@ -76,6 +83,7 @@ final class DictionaryEntry extends DelegatingMap<String, dynamic> {
7683
words: instance.words,
7784
decomposition: instance.decomposition,
7885
state: instance.state,
86+
type: instance.type,
7987
additionalProperties: additionalProperties,
8088
);
8189
}

packages/client_search/lib/src/model/dictionary_entry.g.dart

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
// ignore_for_file: unused_element
3+
import 'package:json_annotation/json_annotation.dart';
4+
5+
/// Whether a dictionary entry is provided by Algolia (standard), or has been added by you (custom).
6+
@JsonEnum(valueField: 'raw')
7+
enum DictionaryEntryType {
8+
custom(r'custom'),
9+
standard(r'standard');
10+
11+
const DictionaryEntryType(this.raw);
12+
final dynamic raw;
13+
14+
dynamic toJson() => raw;
15+
16+
static DictionaryEntryType fromJson(dynamic json) {
17+
for (final value in values) {
18+
if (value.raw == json) return value;
19+
}
20+
throw ArgumentError.value(json, "raw", "No enum value with that value");
21+
}
22+
23+
@override
24+
String toString() => raw.toString();
25+
}

0 commit comments

Comments
 (0)