Skip to content

Commit a66c69b

Browse files
fix(specs): add deprecated field condition in rule schemas (generated)
algolia/api-clients-automation#5983 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Mario-Alexandru Dan <[email protected]>
1 parent 3509971 commit a66c69b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

algoliasearch/search/models/rule.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"validity": "validity",
3232
"tags": "tags",
3333
"scope": "scope",
34+
"condition": "condition",
3435
}
3536

3637

@@ -56,6 +57,7 @@ class Rule(BaseModel):
5657
""" Time periods when the rule is active. """
5758
tags: Optional[List[str]] = None
5859
scope: Optional[str] = None
60+
condition: Optional[Condition] = None
5961

6062
model_config = ConfigDict(
6163
strict=False,
@@ -107,5 +109,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
107109
if obj.get("validity") is not None
108110
else None
109111
)
112+
obj["condition"] = (
113+
Condition.from_dict(obj["condition"])
114+
if obj.get("condition") is not None
115+
else None
116+
)
110117

111118
return cls.model_validate(obj)

0 commit comments

Comments
 (0)