Skip to content

Commit b605170

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 b744d0b commit b605170

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

algoliasearch/search/models/dictionary_entry.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from pydantic import BaseModel, ConfigDict, Field, StrictStr
1313

1414
from algoliasearch.search.models.dictionary_entry_state import DictionaryEntryState
15+
from algoliasearch.search.models.dictionary_entry_type import DictionaryEntryType
1516
from algoliasearch.search.models.supported_language import SupportedLanguage
1617

1718

@@ -37,6 +38,7 @@ class DictionaryEntry(BaseModel):
3738
description="Invividual components of a compound word in the `compounds` dictionary.",
3839
)
3940
state: Optional[DictionaryEntryState] = None
41+
type: Optional[DictionaryEntryType] = None
4042
additional_properties: Dict[str, Any] = {}
4143
__properties: ClassVar[List[str]] = [
4244
"objectID",
@@ -45,6 +47,7 @@ class DictionaryEntry(BaseModel):
4547
"words",
4648
"decomposition",
4749
"state",
50+
"type",
4851
]
4952

5053
model_config = ConfigDict(
@@ -101,6 +104,7 @@ def from_dict(cls, obj: Dict) -> Self:
101104
"words": obj.get("words"),
102105
"decomposition": obj.get("decomposition"),
103106
"state": obj.get("state"),
107+
"type": obj.get("type"),
104108
}
105109
)
106110
# store additional fields in additional_properties
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# coding: utf-8
2+
3+
"""
4+
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.
5+
"""
6+
7+
from __future__ import annotations
8+
9+
from enum import Enum
10+
from json import loads
11+
from typing import Self
12+
13+
14+
class DictionaryEntryType(str, Enum):
15+
"""
16+
Whether a dictionary entry is provided by Algolia (standard), or has been added by you (custom).
17+
"""
18+
19+
"""
20+
allowed enum values
21+
"""
22+
CUSTOM = "custom"
23+
STANDARD = "standard"
24+
25+
@classmethod
26+
def from_json(cls, json_str: str) -> Self:
27+
"""Create an instance of DictionaryEntryType from a JSON string"""
28+
return cls(loads(json_str))

0 commit comments

Comments
 (0)